summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2011-03-13 17:09:40 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2011-03-13 17:09:40 +0000
commit31ad754c96673eefe89baf6994fe2c040f1b3dd7 (patch)
tree76ac239f6c78c93339c8b1e1a6de24133ffb82af /clang/lib/AST/ASTContext.cpp
parent72216105433f8cde20b3314322cd6bb8e3a65ba1 (diff)
downloadbcm5719-llvm-31ad754c96673eefe89baf6994fe2c040f1b3dd7.tar.gz
bcm5719-llvm-31ad754c96673eefe89baf6994fe2c040f1b3dd7.zip
Instead of storing an ASTContext* in FunctionProtoTypes with computed noexcept specifiers, unique FunctionProtoTypes with a ContextualFoldingSet, as suggested by John McCall.
llvm-svn: 127568
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index c128ce598bd..0526ebb5cb0 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -195,6 +195,7 @@ ASTContext::ASTContext(const LangOptions& LOpts, SourceManager &SM,
IdentifierTable &idents, SelectorTable &sels,
Builtin::Context &builtins,
unsigned size_reserve) :
+ FunctionProtoTypes(this_()),
TemplateSpecializationTypes(this_()),
DependentTemplateSpecializationTypes(this_()),
GlobalNestedNameSpecifier(0), IsInt128Installed(false),
@@ -1909,7 +1910,7 @@ ASTContext::getFunctionType(QualType ResultTy,
// Unique functions, to guarantee there is only one function of a particular
// structure.
llvm::FoldingSetNodeID ID;
- FunctionProtoType::Profile(ID, ResultTy, ArgArray, NumArgs, EPI, this);
+ FunctionProtoType::Profile(ID, ResultTy, ArgArray, NumArgs, EPI, *this);
void *InsertPos = 0;
if (FunctionProtoType *FTP =
@@ -1960,13 +1961,12 @@ ASTContext::getFunctionType(QualType ResultTy,
if (EPI.ExceptionSpecType == EST_Dynamic)
Size += EPI.NumExceptions * sizeof(QualType);
else if (EPI.ExceptionSpecType == EST_ComputedNoexcept) {
- Size += sizeof(Expr*) + sizeof(ASTContext*);
+ Size += sizeof(Expr*);
}
FunctionProtoType *FTP = (FunctionProtoType*) Allocate(Size, TypeAlignment);
FunctionProtoType::ExtProtoInfo newEPI = EPI;
newEPI.ExtInfo = EPI.ExtInfo.withCallingConv(CallConv);
- new (FTP) FunctionProtoType(ResultTy, ArgArray, NumArgs, Canonical, newEPI,
- this);
+ new (FTP) FunctionProtoType(ResultTy, ArgArray, NumArgs, Canonical, newEPI);
Types.push_back(FTP);
FunctionProtoTypes.InsertNode(FTP, InsertPos);
return QualType(FTP, 0);
OpenPOWER on IntegriCloud