aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Type.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-12-14 08:05:40 +0000
committerJohn McCall <rjmccall@apple.com>2010-12-14 08:05:40 +0000
commite23cf437fe76b1ed02d63c3f61b456fd48a915f5 (patch)
tree1e40b8565309154c96cb5997ad4f615a0b8d6ff4 /lib/AST/Type.cpp
parent5bfe232d1f07a6fd160fcf82c277c055a412a1c0 (diff)
Restore r121752 without modification.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121763 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r--lib/AST/Type.cpp66
1 files changed, 28 insertions, 38 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index 127613ed32..25aa5e0ea1 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -1097,65 +1097,55 @@ llvm::StringRef FunctionType::getNameForCallConv(CallingConv CC) {
return "";
}
-FunctionProtoType::FunctionProtoType(QualType Result, const QualType *ArgArray,
- unsigned numArgs, bool isVariadic,
- unsigned typeQuals, bool hasExs,
- bool hasAnyExs, const QualType *ExArray,
- unsigned numExs, QualType Canonical,
- const ExtInfo &Info)
- : FunctionType(FunctionProto, Result, isVariadic, typeQuals, Canonical,
- Result->isDependentType(),
- Result->isVariablyModifiedType(),
- Result->containsUnexpandedParameterPack(),
- Info),
- NumArgs(numArgs), NumExceptions(numExs), HasExceptionSpec(hasExs),
- AnyExceptionSpec(hasAnyExs)
+FunctionProtoType::FunctionProtoType(QualType result, const QualType *args,
+ unsigned numArgs, QualType canonical,
+ const ExtProtoInfo &epi)
+ : FunctionType(FunctionProto, result, epi.Variadic, epi.TypeQuals, canonical,
+ result->isDependentType(),
+ result->isVariablyModifiedType(),
+ result->containsUnexpandedParameterPack(),
+ epi.ExtInfo),
+ NumArgs(numArgs), NumExceptions(epi.NumExceptions),
+ HasExceptionSpec(epi.HasExceptionSpec),
+ HasAnyExceptionSpec(epi.HasAnyExceptionSpec)
{
// Fill in the trailing argument array.
- QualType *ArgInfo = reinterpret_cast<QualType*>(this+1);
+ QualType *argSlot = reinterpret_cast<QualType*>(this+1);
for (unsigned i = 0; i != numArgs; ++i) {
- if (ArgArray[i]->isDependentType())
+ if (args[i]->isDependentType())
setDependent();
- if (ArgArray[i]->containsUnexpandedParameterPack())
+ if (args[i]->containsUnexpandedParameterPack())
setContainsUnexpandedParameterPack();
- ArgInfo[i] = ArgArray[i];
+ argSlot[i] = args[i];
}
// Fill in the exception array.
- QualType *Ex = ArgInfo + numArgs;
- for (unsigned i = 0; i != numExs; ++i)
- Ex[i] = ExArray[i];
+ QualType *exnSlot = argSlot + numArgs;
+ for (unsigned i = 0, e = epi.NumExceptions; i != e; ++i)
+ exnSlot[i] = epi.Exceptions[i];
}
void FunctionProtoType::Profile(llvm::FoldingSetNodeID &ID, QualType Result,
- arg_type_iterator ArgTys,
- unsigned NumArgs, bool isVariadic,
- unsigned TypeQuals, bool hasExceptionSpec,
- bool anyExceptionSpec, unsigned NumExceptions,
- exception_iterator Exs,
- FunctionType::ExtInfo Info) {
+ const QualType *ArgTys, unsigned NumArgs,
+ const ExtProtoInfo &epi) {
ID.AddPointer(Result.getAsOpaquePtr());
for (unsigned i = 0; i != NumArgs; ++i)
ID.AddPointer(ArgTys[i].getAsOpaquePtr());
- ID.AddInteger(isVariadic);
- ID.AddInteger(TypeQuals);
- ID.AddInteger(hasExceptionSpec);
- if (hasExceptionSpec) {
- ID.AddInteger(anyExceptionSpec);
- for (unsigned i = 0; i != NumExceptions; ++i)
- ID.AddPointer(Exs[i].getAsOpaquePtr());
+ ID.AddBoolean(epi.Variadic);
+ ID.AddInteger(epi.TypeQuals);
+ if (epi.HasExceptionSpec) {
+ ID.AddBoolean(epi.HasAnyExceptionSpec);
+ for (unsigned i = 0; i != epi.NumExceptions; ++i)
+ ID.AddPointer(epi.Exceptions[i].getAsOpaquePtr());
}
- Info.Profile(ID);
+ epi.ExtInfo.Profile(ID);
}
void FunctionProtoType::Profile(llvm::FoldingSetNodeID &ID) {
- Profile(ID, getResultType(), arg_type_begin(), NumArgs, isVariadic(),
- getTypeQuals(), hasExceptionSpec(), hasAnyExceptionSpec(),
- getNumExceptions(), exception_begin(),
- getExtInfo());
+ Profile(ID, getResultType(), arg_type_begin(), NumArgs, getExtProtoInfo());
}
QualType TypedefType::desugar() const {