diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-01-08 00:50:27 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-01-08 00:50:27 +0000 |
commit | aa46d513f47280a9786e8e9aa77f7089b3f8fee6 (patch) | |
tree | bc387475d70f16de352b401885b09a1c757373ad /lib/AST/Type.cpp | |
parent | 97bfb558f69c09b01a5c1510f08dc91eb62329a7 (diff) |
Move ref qualifiers from Type bitfields into FunctionProtoType, stealing two
bits from the number of parameters. This brings the bitfields down from 33 bits
to 32 bits, reducing the size of Types by 4 bytes on 32-bit systems.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171827 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r-- | lib/AST/Type.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 378339242a..bb79b9b57b 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -1561,7 +1561,7 @@ StringRef FunctionType::getNameForCallConv(CallingConv CC) { FunctionProtoType::FunctionProtoType(QualType result, const QualType *args, unsigned numArgs, QualType canonical, const ExtProtoInfo &epi) - : FunctionType(FunctionProto, result, epi.TypeQuals, epi.RefQualifier, + : FunctionType(FunctionProto, result, epi.TypeQuals, canonical, result->isDependentType(), result->isInstantiationDependentType(), @@ -1571,8 +1571,11 @@ FunctionProtoType::FunctionProtoType(QualType result, const QualType *args, NumArgs(numArgs), NumExceptions(epi.NumExceptions), ExceptionSpecType(epi.ExceptionSpecType), HasAnyConsumedArgs(epi.ConsumedArguments != 0), - Variadic(epi.Variadic), HasTrailingReturn(epi.HasTrailingReturn) + Variadic(epi.Variadic), HasTrailingReturn(epi.HasTrailingReturn), + RefQualifier(epi.RefQualifier) { + assert(NumArgs == numArgs && "function has too many parameters"); + // Fill in the trailing argument array. QualType *argSlot = reinterpret_cast<QualType*>(this+1); for (unsigned i = 0; i != numArgs; ++i) { |