diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-05-06 23:27:55 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-05-06 23:27:55 +0000 |
commit | bfa2fcba545fb270f31205d616846c2bfaf4e47e (patch) | |
tree | e4895fb90c27e1c3d2b63df97c124e8c3ba215ca /lib/AST/ASTContext.cpp | |
parent | 3ac79049abf396487546e8807e8763403f444a07 (diff) |
Back out r70506 (exception spec in AST) again. We won't have exception specs until we've had a lot more discussion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71125 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index a947fea95a..c1a232c88e 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -1296,15 +1296,12 @@ QualType ASTContext::getFunctionNoProtoType(QualType ResultTy) { /// list. isVariadic indicates whether the argument list includes '...'. QualType ASTContext::getFunctionType(QualType ResultTy,const QualType *ArgArray, unsigned NumArgs, bool isVariadic, - unsigned TypeQuals, bool hasExceptionSpec, - bool hasAnyExceptionSpec, unsigned NumExs, - const QualType *ExArray) { + unsigned TypeQuals) { // Unique functions, to guarantee there is only one function of a particular // structure. llvm::FoldingSetNodeID ID; FunctionProtoType::Profile(ID, ResultTy, ArgArray, NumArgs, isVariadic, - TypeQuals, hasExceptionSpec, hasAnyExceptionSpec, - NumExs, ExArray); + TypeQuals); void *InsertPos = 0; if (FunctionProtoType *FTP = @@ -1324,32 +1321,24 @@ QualType ASTContext::getFunctionType(QualType ResultTy,const QualType *ArgArray, CanonicalArgs.reserve(NumArgs); for (unsigned i = 0; i != NumArgs; ++i) CanonicalArgs.push_back(getCanonicalType(ArgArray[i])); - llvm::SmallVector<QualType, 2> CanonicalExs; - CanonicalExs.reserve(NumExs); - for (unsigned i = 0; i != NumExs; ++i) - CanonicalExs.push_back(getCanonicalType(ExArray[i])); - + Canonical = getFunctionType(getCanonicalType(ResultTy), &CanonicalArgs[0], NumArgs, - isVariadic, TypeQuals, hasExceptionSpec, - hasAnyExceptionSpec, NumExs, &CanonicalExs[0]); - + isVariadic, TypeQuals); + // Get the new insert position for the node we care about. FunctionProtoType *NewIP = FunctionProtoTypes.FindNodeOrInsertPos(ID, InsertPos); assert(NewIP == 0 && "Shouldn't be in the map!"); NewIP = NewIP; } - + // FunctionProtoType objects are allocated with extra bytes after them - // for two variable size arrays (for parameter and exception types) at the - // end of them. + // for a variable size array (for parameter types) at the end of them. FunctionProtoType *FTP = - (FunctionProtoType*)Allocate(sizeof(FunctionProtoType) + - NumArgs*sizeof(QualType) + - NumExs*sizeof(QualType), 8); + (FunctionProtoType*)Allocate(sizeof(FunctionProtoType) + + NumArgs*sizeof(QualType), 8); new (FTP) FunctionProtoType(ResultTy, ArgArray, NumArgs, isVariadic, - TypeQuals, hasExceptionSpec, hasAnyExceptionSpec, - ExArray, NumExs, Canonical); + TypeQuals, Canonical); Types.push_back(FTP); FunctionProtoTypes.InsertNode(FTP, InsertPos); return QualType(FTP, 0); @@ -2916,8 +2905,6 @@ QualType ASTContext::mergeFunctionTypes(QualType lhs, QualType rhs) { allRTypes = false; if (lproto && rproto) { // two C99 style function prototypes - assert(!lproto->hasExceptionSpec() && !rproto->hasExceptionSpec() && - "C++ shouldn't be here"); unsigned lproto_nargs = lproto->getNumArgs(); unsigned rproto_nargs = rproto->getNumArgs(); @@ -2956,7 +2943,6 @@ QualType ASTContext::mergeFunctionTypes(QualType lhs, QualType rhs) { const FunctionProtoType *proto = lproto ? lproto : rproto; if (proto) { - assert(!proto->hasExceptionSpec() && "C++ shouldn't be here"); if (proto->isVariadic()) return QualType(); // Check that the types are compatible with the types that // would result from default argument promotions (C99 6.7.5.3p15). |