[llvm-commits] [poolalloc] r137596 - /poolalloc/trunk/lib/AssistDS/TypeChecks.cpp

Will Dietz wdietz2 at illinois.edu
Sun Aug 14 17:25:43 PDT 2011


Author: wdietz2
Date: Sun Aug 14 19:25:43 2011
New Revision: 137596

URL: http://llvm.org/viewvc/llvm-project?rev=137596&view=rev
Log:
Fix GetElementPtr operand vector misconstruction in a few places.

Makes us pass simple_varargs.ll test.

Modified:
    poolalloc/trunk/lib/AssistDS/TypeChecks.cpp

Modified: poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/TypeChecks.cpp?rev=137596&r1=137595&r2=137596&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/TypeChecks.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/TypeChecks.cpp Sun Aug 14 19:25:43 2011
@@ -708,7 +708,7 @@
       AllocaInst *AI = new AllocaInst(TypeTagTy, NumArgsVal, "", &*InsPt);
       // set the metadata for the varargs in AI
       for(i = 3; i <II->getNumOperands(); i++) {
-        Value *Idx[2];
+        Value *Idx[1];
         Idx[0] = ConstantInt::get(Int32Ty, i - 3 );
         // For each vararg argument, also add its type information
         GetElementPtrInst *GEP = GetElementPtrInst::CreateInBounds(AI,Idx, "", II);
@@ -745,7 +745,7 @@
       AllocaInst *AI = new AllocaInst(TypeTagTy, NumArgsVal, "", &*InsPt);
       // set the metadata for the varargs in AI
       for(i = 1; i <CI->getNumOperands(); i++) {
-        Value *Idx[2];
+        Value *Idx[1];
         Idx[0] = ConstantInt::get(Int32Ty, i - 1 );
         // For each vararg argument, also add its type information
         GetElementPtrInst *GEP = GetElementPtrInst::CreateInBounds(AI,Idx, "", CI);
@@ -871,7 +871,7 @@
 
   // Increment by the number of Initial Args, so as to not read the metadata
   //for those.
-  Value *Idx[2];
+  Value *Idx[1];
   Idx[0] = InitialArgs;
   // For each vararg argument, also add its type information
   GetElementPtrInst *GEP = GetElementPtrInst::CreateInBounds(NII,Idx, "", &*InsPt);
@@ -937,7 +937,7 @@
       AllocaInst *AI = new AllocaInst(TypeTagTy, NumArgsVal, "", &*InsPt);
       // set the metadata for the varargs in AI
       for(i = 3; i <II->getNumOperands(); i++) {
-        Value *Idx[2];
+        Value *Idx[1];
         Idx[0] = ConstantInt::get(Int32Ty, i - 3 );
         // For each vararg argument, also add its type information
         GetElementPtrInst *GEP = GetElementPtrInst::CreateInBounds(AI, Idx, "", II);
@@ -970,7 +970,7 @@
       AllocaInst *AI = new AllocaInst(TypeTagTy, NumArgsVal, "", &*InsPt);
       // set the metadata for the varargs in AI
       for(i = 1; i <CI->getNumOperands(); i++) {
-        Value *Idx[2];
+        Value *Idx[1];
         Idx[0] = ConstantInt::get(Int32Ty, i - 1 );
         // For each vararg argument, also add its type information
         GetElementPtrInst *GEP = GetElementPtrInst::CreateInBounds(AI,Idx, "", CI);
@@ -2023,7 +2023,7 @@
   Value *NumArgsVal = ConstantInt::get(Int32Ty, NumArgs);
   AllocaInst *AI = new AllocaInst(TypeTagTy, NumArgsVal, "", &*InsPt);
   for(unsigned int i = 0; i < CS.arg_size(); i++) {
-    Value *Idx[2];
+    Value *Idx[1];
     Idx[0] = ConstantInt::get(Int32Ty, i-1);
     GetElementPtrInst *GEP = GetElementPtrInst::CreateInBounds(AI, Idx, "", I);
     Constant *C = getTypeMarkerConstant(CS.getArgument(i));





More information about the llvm-commits mailing list