diff options
author | John McCall <rjmccall@apple.com> | 2010-12-14 07:30:51 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-12-14 07:30:51 +0000 |
commit | 5bfe232d1f07a6fd160fcf82c277c055a412a1c0 (patch) | |
tree | 0970af747e2811a9fa2c649a20e111820ecc7392 /lib/Sema/SemaExprCXX.cpp | |
parent | 0e88aa7100da32acc63bc8a4dcb946ed517868f1 (diff) |
Pull out r121752 in case it's causing the selfhost breakage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121759 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 76fcaeae58..41a342942c 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -1074,24 +1074,21 @@ bool Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range, // To perform this comparison, we compute the function type that // the deallocation function should have, and use that type both // for template argument deduction and for comparison purposes. - // - // FIXME: this comparison should ignore CC and the like. QualType ExpectedFunctionType; { const FunctionProtoType *Proto = OperatorNew->getType()->getAs<FunctionProtoType>(); - llvm::SmallVector<QualType, 4> ArgTypes; ArgTypes.push_back(Context.VoidPtrTy); for (unsigned I = 1, N = Proto->getNumArgs(); I < N; ++I) ArgTypes.push_back(Proto->getArgType(I)); - FunctionProtoType::ExtProtoInfo EPI; - EPI.Variadic = Proto->isVariadic(); - ExpectedFunctionType = Context.getFunctionType(Context.VoidTy, ArgTypes.data(), - ArgTypes.size(), EPI); + ArgTypes.size(), + Proto->isVariadic(), + 0, false, false, 0, 0, + FunctionType::ExtInfo()); } for (LookupResult::iterator D = FoundDelete.begin(), @@ -1343,15 +1340,12 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name, assert(StdBadAlloc && "Must have std::bad_alloc declared"); BadAllocType = Context.getTypeDeclType(getStdBadAlloc()); } - - FunctionProtoType::ExtProtoInfo EPI; - EPI.HasExceptionSpec = true; - if (HasBadAllocExceptionSpec) { - EPI.NumExceptions = 1; - EPI.Exceptions = &BadAllocType; - } - QualType FnType = Context.getFunctionType(Return, &Argument, 1, EPI); + QualType FnType = Context.getFunctionType(Return, &Argument, 1, false, 0, + true, false, + HasBadAllocExceptionSpec? 1 : 0, + &BadAllocType, + FunctionType::ExtInfo()); FunctionDecl *Alloc = FunctionDecl::Create(Context, GlobalCtx, SourceLocation(), Name, FnType, /*TInfo=*/0, SC_None, |