diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2011-03-13 17:09:40 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2011-03-13 17:09:40 +0000 |
commit | 8026f6d82f7fa544bc0453714fe94bca62a1196e (patch) | |
tree | 00bb7e23b1bc02496a1677eec6706486d10de725 /lib/Sema | |
parent | 0b34dbaafe412a8437212805dcafa4565ee80ce5 (diff) |
Instead of storing an ASTContext* in FunctionProtoTypes with computed noexcept specifiers, unique FunctionProtoTypes with a ContextualFoldingSet, as suggested by John McCall.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127568 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/SemaExceptionSpec.cpp | 8 | ||||
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index f6551054c1..04c21bc47c 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -3091,7 +3091,7 @@ namespace { // Check out noexcept specs. if (EST == EST_ComputedNoexcept) { - FunctionProtoType::NoexceptResult NR = Proto->getNoexceptSpec(); + FunctionProtoType::NoexceptResult NR = Proto->getNoexceptSpec(Context); assert(NR != FunctionProtoType::NR_NoNoexcept && "Must have noexcept result for EST_ComputedNoexcept."); assert(NR != FunctionProtoType::NR_Dependent && diff --git a/lib/Sema/SemaExceptionSpec.cpp b/lib/Sema/SemaExceptionSpec.cpp index 01ee712254..285f400b07 100644 --- a/lib/Sema/SemaExceptionSpec.cpp +++ b/lib/Sema/SemaExceptionSpec.cpp @@ -313,8 +313,8 @@ bool Sema::CheckEquivalentExceptionSpec(const PartialDiagnostic &DiagID, if (OldEST == EST_None && NewEST == EST_None) return false; - FunctionProtoType::NoexceptResult OldNR = Old->getNoexceptSpec(); - FunctionProtoType::NoexceptResult NewNR = New->getNoexceptSpec(); + FunctionProtoType::NoexceptResult OldNR = Old->getNoexceptSpec(Context); + FunctionProtoType::NoexceptResult NewNR = New->getNoexceptSpec(Context); if (OldNR == FunctionProtoType::NR_BadNoexcept || NewNR == FunctionProtoType::NR_BadNoexcept) return false; @@ -460,7 +460,7 @@ bool Sema::CheckExceptionSpecSubset( // omissions we make here. // We also shortcut checking if a noexcept expression was bad. - FunctionProtoType::NoexceptResult SuperNR =Superset->getNoexceptSpec(); + FunctionProtoType::NoexceptResult SuperNR =Superset->getNoexceptSpec(Context); if (SuperNR == FunctionProtoType::NR_BadNoexcept || SuperNR == FunctionProtoType::NR_Dependent) return false; @@ -479,7 +479,7 @@ bool Sema::CheckExceptionSpecSubset( return true; } - FunctionProtoType::NoexceptResult SubNR = Subset->getNoexceptSpec(); + FunctionProtoType::NoexceptResult SubNR = Subset->getNoexceptSpec(Context); if (SubNR == FunctionProtoType::NR_BadNoexcept || SubNR == FunctionProtoType::NR_Dependent) return false; diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index a1cd43ac23..ea93449d7b 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -2423,7 +2423,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, UnaryTypeTrait UTT, QualType T, FoundAssign = true; const FunctionProtoType *CPT = Operator->getType()->getAs<FunctionProtoType>(); - if (!CPT->isNothrow()) { + if (!CPT->isNothrow(Self.Context)) { AllNoThrow = false; break; } @@ -2465,7 +2465,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, UnaryTypeTrait UTT, QualType T, = Constructor->getType()->getAs<FunctionProtoType>(); // FIXME: check whether evaluating default arguments can throw. // For now, we'll be conservative and assume that they can throw. - if (!CPT->isNothrow() || CPT->getNumArgs() > 1) { + if (!CPT->isNothrow(Self.Context) || CPT->getNumArgs() > 1) { AllNoThrow = false; break; } @@ -2500,7 +2500,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, UnaryTypeTrait UTT, QualType T, = Constructor->getType()->getAs<FunctionProtoType>(); // TODO: check whether evaluating default arguments can throw. // For now, we'll be conservative and assume that they can throw. - return CPT->isNothrow() && CPT->getNumArgs() == 0; + return CPT->isNothrow(Self.Context) && CPT->getNumArgs() == 0; } } } |