From: Aaron Ballman Date: Tue, 21 Jul 2015 21:07:11 +0000 (+0000) Subject: Replace some uses of Self.Context with the local variable C; NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb6c7853296cf95fb4cac60f8c50f48270cac201;p=clang Replace some uses of Self.Context with the local variable C; NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@242835 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 6608d7c1f0..845cd4dcf0 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -3696,15 +3696,15 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, case UTT_IsVolatile: return T.isVolatileQualified(); case UTT_IsTrivial: - return T.isTrivialType(Self.Context); + return T.isTrivialType(C); case UTT_IsTriviallyCopyable: - return T.isTriviallyCopyableType(Self.Context); + return T.isTriviallyCopyableType(C); case UTT_IsStandardLayout: return T->isStandardLayoutType(); case UTT_IsPOD: - return T.isPODType(Self.Context); + return T.isPODType(C); case UTT_IsLiteral: - return T->isLiteralType(Self.Context); + return T->isLiteralType(C); case UTT_IsEmpty: if (const CXXRecordDecl *RD = T->getAsCXXRecordDecl()) return !RD->isUnion() && RD->isEmpty(); @@ -3755,7 +3755,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, // If __is_pod (type) is true then the trait is true, else if type is // a cv class or union type (or array thereof) with a trivial default // constructor ([class.ctor]) then the trait is true, else it is false. - if (T.isPODType(Self.Context)) + if (T.isPODType(C)) return true; if (CXXRecordDecl *RD = C.getBaseElementType(T)->getAsCXXRecordDecl()) return RD->hasTrivialDefaultConstructor() && @@ -3765,7 +3765,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, // This trait is implemented by MSVC 2012 and needed to parse the // standard library headers. Specifically this is used as the logic // behind std::is_trivially_move_constructible (20.9.4.3). - if (T.isPODType(Self.Context)) + if (T.isPODType(C)) return true; if (CXXRecordDecl *RD = C.getBaseElementType(T)->getAsCXXRecordDecl()) return RD->hasTrivialMoveConstructor() && !RD->hasNonTrivialMoveConstructor(); @@ -3776,7 +3776,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, // the trait is true, else if type is a cv class or union type // with a trivial copy constructor ([class.copy]) then the trait // is true, else it is false. - if (T.isPODType(Self.Context) || T->isReferenceType()) + if (T.isPODType(C) || T->isReferenceType()) return true; if (CXXRecordDecl *RD = T->getAsCXXRecordDecl()) return RD->hasTrivialCopyConstructor() && @@ -3786,7 +3786,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, // This trait is implemented by MSVC 2012 and needed to parse the // standard library headers. Specifically it is used as the logic // behind std::is_trivially_move_assignable (20.9.4.3) - if (T.isPODType(Self.Context)) + if (T.isPODType(C)) return true; if (CXXRecordDecl *RD = C.getBaseElementType(T)->getAsCXXRecordDecl()) return RD->hasTrivialMoveAssignment() && !RD->hasNonTrivialMoveAssignment(); @@ -3806,7 +3806,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, if (T.isConstQualified()) return false; - if (T.isPODType(Self.Context)) + if (T.isPODType(C)) return true; if (CXXRecordDecl *RD = T->getAsCXXRecordDecl()) return RD->hasTrivialCopyAssignment() && @@ -3823,7 +3823,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, // type (or array thereof) with a trivial destructor // ([class.dtor]) then the trait is true, else it is // false. - if (T.isPODType(Self.Context) || T->isReferenceType()) + if (T.isPODType(C) || T->isReferenceType()) return true; // Objective-C++ ARC: autorelease types don't require destruction. @@ -3847,7 +3847,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, return false; if (T->isReferenceType()) return false; - if (T.isPODType(Self.Context) || T->isObjCLifetimeType()) + if (T.isPODType(C) || T->isObjCLifetimeType()) return true; if (const RecordType *RT = T->getAs()) @@ -3860,7 +3860,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, // This trait is implemented by MSVC 2012 and needed to parse the // standard library headers. Specifically this is used as the logic // behind std::is_nothrow_move_assignable (20.9.4.3). - if (T.isPODType(Self.Context)) + if (T.isPODType(C)) return true; if (const RecordType *RT = C.getBaseElementType(T)->getAs()) @@ -3902,7 +3902,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, return false; // TODO: check whether evaluating default arguments can throw. // For now, we'll be conservative and assume that they can throw. - if (!CPT->isNothrow(Self.Context) || CPT->getNumParams() > 1) + if (!CPT->isNothrow(C) || CPT->getNumParams() > 1) return false; } } @@ -3940,7 +3940,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, return false; // FIXME: check whether evaluating default arguments can throw. // For now, we'll be conservative and assume that they can throw. - if (!CPT->isNothrow(Self.Context) || CPT->getNumParams() > 0) + if (!CPT->isNothrow(C) || CPT->getNumParams() > 0) return false; } }