[cfe-commits] r107176 - in /cfe/trunk/lib/CodeGen: CGCall.cpp CGCall.h

Chris Lattner sabre at nondot.org
Tue Jun 29 11:13:52 PDT 2010


Author: lattner
Date: Tue Jun 29 13:13:52 2010
New Revision: 107176

URL: http://llvm.org/viewvc/llvm-project?rev=107176&view=rev
Log:
relax the CGFunctionInfo::CGFunctionInfo ctor to allow any sequence 
of CanQualTypes to be passed in.

Modified:
    cfe/trunk/lib/CodeGen/CGCall.cpp
    cfe/trunk/lib/CodeGen/CGCall.h

Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=107176&r1=107175&r2=107176&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Tue Jun 29 13:13:52 2010
@@ -240,7 +240,7 @@
 
   // 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 @@
 }
 
 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];
 }
 

Modified: cfe/trunk/lib/CodeGen/CGCall.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.h?rev=107176&r1=107175&r2=107176&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.h (original)
+++ cfe/trunk/lib/CodeGen/CGCall.h Tue Jun 29 13:13:52 2010
@@ -83,11 +83,9 @@
     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; }





More information about the cfe-commits mailing list