aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-06-29 18:13:52 +0000
committerChris Lattner <sabre@nondot.org>2010-06-29 18:13:52 +0000
commitbb52114f81e8829fe29a9a0faa49e8b2157206cc (patch)
tree8f00b7f666d3a6802e74daf684156430aea810d5
parentcfa6a27f3cc5add888c6ac84dbcc45854cfd8666 (diff)
relax the CGFunctionInfo::CGFunctionInfo ctor to allow any sequence
of CanQualTypes to be passed in. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107176 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGCall.cpp14
-rw-r--r--lib/CodeGen/CGCall.h8
2 files changed, 10 insertions, 12 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index cbcd3d1233..820fd9cd3f 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -240,7 +240,7 @@ const CGFunctionInfo &CodeGenTypes::getFunctionInfo(CanQualType ResTy,
// Construct the function info.
FI = new CGFunctionInfo(CC, Info.getNoReturn(), Info.getRegParm(), ResTy,
- ArgTys);
+ ArgTys.data(), ArgTys.size());
FunctionInfos.InsertNode(FI, InsertPos);
// ABI lowering wants to know what our preferred type for the argument is in
@@ -267,20 +267,20 @@ const CGFunctionInfo &CodeGenTypes::getFunctionInfo(CanQualType ResTy,
}
CGFunctionInfo::CGFunctionInfo(unsigned _CallingConvention,
- bool _NoReturn,
- unsigned _RegParm,
+ bool _NoReturn, unsigned _RegParm,
CanQualType ResTy,
- const llvm::SmallVectorImpl<CanQualType> &ArgTys)
+ const CanQualType *ArgTys,
+ unsigned NumArgTys)
: CallingConvention(_CallingConvention),
EffectiveCallingConvention(_CallingConvention),
NoReturn(_NoReturn), RegParm(_RegParm)
{
- NumArgs = ArgTys.size();
+ NumArgs = NumArgTys;
// FIXME: Coallocate with the CGFunctionInfo object.
- Args = new ArgInfo[1 + NumArgs];
+ Args = new ArgInfo[1 + NumArgTys];
Args[0].type = ResTy;
- for (unsigned i = 0; i < NumArgs; ++i)
+ for (unsigned i = 0; i != NumArgTys; ++i)
Args[1 + i].type = ArgTys[i];
}
diff --git a/lib/CodeGen/CGCall.h b/lib/CodeGen/CGCall.h
index 31c8aac3f2..41e707a204 100644
--- a/lib/CodeGen/CGCall.h
+++ b/lib/CodeGen/CGCall.h
@@ -83,11 +83,9 @@ namespace CodeGen {
typedef const ArgInfo *const_arg_iterator;
typedef ArgInfo *arg_iterator;
- CGFunctionInfo(unsigned CallingConvention,
- bool NoReturn,
- unsigned RegParm,
- CanQualType ResTy,
- const llvm::SmallVectorImpl<CanQualType> &ArgTys);
+ CGFunctionInfo(unsigned CallingConvention, bool NoReturn,
+ unsigned RegParm, CanQualType ResTy,
+ const CanQualType *ArgTys, unsigned NumArgTys);
~CGFunctionInfo() { delete[] Args; }
const_arg_iterator arg_begin() const { return Args + 1; }