[llvm-commits] [poolalloc] r166041 - in /poolalloc/trunk/lib: AssistDS/GEPExprArgs.cpp AssistDS/LoadArgs.cpp AssistDS/StructReturnToPointer.cpp AssistDS/TypeChecks.cpp PoolAllocate/PoolAllocate.cpp PoolAllocate/RunTimeAssociate.cpp

John Criswell criswell at uiuc.edu
Tue Oct 16 12:17:17 PDT 2012


Author: criswell
Date: Tue Oct 16 14:17:17 2012
New Revision: 166041

URL: http://llvm.org/viewvc/llvm-project?rev=166041&view=rev
Log:
Fixed compilation with mainline LLVM.
Two lit tests fail to pass, but I think that's due to issues other than these
fixes.

Modified:
    poolalloc/trunk/lib/AssistDS/GEPExprArgs.cpp
    poolalloc/trunk/lib/AssistDS/LoadArgs.cpp
    poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp
    poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
    poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
    poolalloc/trunk/lib/PoolAllocate/RunTimeAssociate.cpp

Modified: poolalloc/trunk/lib/AssistDS/GEPExprArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/GEPExprArgs.cpp?rev=166041&r1=166040&r2=166041&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/GEPExprArgs.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/GEPExprArgs.cpp Tue Oct 16 14:17:17 2012
@@ -121,7 +121,7 @@
             NI->addAttr(F->getAttributes().getParamAttributes(II->getArgNo() + 1));
           }
           NewF->setAttributes(NewF->getAttributes().addAttr(
-              0, F->getAttributes().getRetAttributes()));
+              F->getContext(), 0, F->getAttributes().getRetAttributes()));
           // Perform the cloning.
           SmallVector<ReturnInst*,100> Returns;
           CloneFunctionInto(NewF, F, ValueMap, false, Returns);
@@ -132,7 +132,7 @@
           }
 
           NewF->setAttributes(NewF->getAttributes().addAttr(
-              ~0, F->getAttributes().getFnAttributes()));
+              F->getContext(), ~0, F->getAttributes().getFnAttributes()));
           //Get the point to insert the GEP instr.
           SmallVector<Value*, 8> Ops(CI->op_begin()+1, CI->op_end());
           Instruction *InsertPoint;
@@ -158,7 +158,7 @@
           AttrListPtr CallPAL = CI->getAttributes();
           Attributes RAttrs = CallPAL.getRetAttributes();
           Attributes FnAttrs = CallPAL.getFnAttributes();
-          if (RAttrs)
+          if (RAttrs.hasAttributes())
             AttributesVec.push_back(AttributeWithIndex::get(0, RAttrs));
 
           SmallVector<Value*, 8> Args;
@@ -166,7 +166,8 @@
           for(unsigned j =1;j<CI->getNumOperands();j++) {
             Args.push_back(CI->getOperand(j));
             // position in the AttributesVec
-            if (Attributes Attrs = CallPAL.getParamAttributes(j))
+            Attributes Attrs = CallPAL.getParamAttributes(j);
+            if (Attrs.hasAttributes())
               AttributesVec.push_back(AttributeWithIndex::get(Args.size(), Attrs));
           }
           // Create the new attributes vec.

Modified: poolalloc/trunk/lib/AssistDS/LoadArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/LoadArgs.cpp?rev=166041&r1=166040&r2=166041&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/LoadArgs.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/LoadArgs.cpp Tue Oct 16 14:17:17 2012
@@ -169,9 +169,9 @@
             }
 
             NewF->setAttributes(NewF->getAttributes().addAttr(
-                0, F->getAttributes().getRetAttributes()));
+                F->getContext(), 0, F->getAttributes().getRetAttributes()));
             NewF->setAttributes(NewF->getAttributes().addAttr(
-                ~0, F->getAttributes().getFnAttributes()));
+                F->getContext(), ~0, F->getAttributes().getFnAttributes()));
             //Get the point to insert the GEP instr.
             Instruction *InsertPoint;
             for (BasicBlock::iterator insrt = NewF->front().begin(); isa<AllocaInst>(InsertPoint = insrt); ++insrt) {;}
@@ -183,7 +183,7 @@
           AttrListPtr CallPAL = CI->getAttributes();
           Attributes RAttrs = CallPAL.getRetAttributes();
           Attributes FnAttrs = CallPAL.getFnAttributes();
-          if (RAttrs)
+          if (RAttrs.hasAttributes())
             AttributesVec.push_back(AttributeWithIndex::get(0, RAttrs));
 
           SmallVector<Value*, 8> Args;
@@ -193,7 +193,8 @@
             }
             Args.push_back(CI->getArgOperand(j));
             // position in the AttributesVec
-            if (Attributes Attrs = CallPAL.getParamAttributes(j+1))
+            Attributes Attrs = CallPAL.getParamAttributes(j+1);
+            if (Attrs.hasAttributes())
               AttributesVec.push_back(AttributeWithIndex::get(Args.size(), Attrs));
           }
           // Create the new attributes vec.

Modified: poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp?rev=166041&r1=166040&r2=166041&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp Tue Oct 16 14:17:17 2012
@@ -95,9 +95,9 @@
       fargs.push_back(ai);
     }
     NF->setAttributes(NF->getAttributes().addAttr(
-        0, F->getAttributes().getRetAttributes()));
+        M.getContext(), 0, F->getAttributes().getRetAttributes()));
     NF->setAttributes(NF->getAttributes().addAttr(
-        ~0, F->getAttributes().getFnAttributes()));
+        M.getContext(), ~0, F->getAttributes().getFnAttributes()));
     
     for (Function::iterator B = NF->begin(), FE = NF->end(); B != FE; ++B) {      
       for (BasicBlock::iterator I = B->begin(), BE = B->end(); I != BE;) {
@@ -127,14 +127,15 @@
       Attributes RAttrs = CallPAL.getRetAttributes();
       Attributes FnAttrs = CallPAL.getFnAttributes();
       
-      if (RAttrs)
+      if (RAttrs.hasAttributes())
         AttributesVec.push_back(AttributeWithIndex::get(0, RAttrs));
 
       Args.push_back(AllocaNew);
       for(unsigned j =1;j<CI->getNumOperands();j++) {
         Args.push_back(CI->getOperand(j));
         // position in the AttributesVec
-        if (Attributes Attrs = CallPAL.getParamAttributes(j))
+        Attributes Attrs = CallPAL.getParamAttributes(j);
+        if (Attrs.hasAttributes())
           AttributesVec.push_back(AttributeWithIndex::get(Args.size(), Attrs));
       }
       // Create the new attributes vec.

Modified: poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/TypeChecks.cpp?rev=166041&r1=166040&r2=166041&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/TypeChecks.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/TypeChecks.cpp Tue Oct 16 14:17:17 2012
@@ -684,9 +684,9 @@
 
   // 4. Copy over attributes for the function
   NewF->setAttributes(NewF->getAttributes()
-                      .addAttr(0, F.getAttributes().getRetAttributes()));
+                      .addAttr(M.getContext(), 0, F.getAttributes().getRetAttributes()));
   NewF->setAttributes(NewF->getAttributes()
-                      .addAttr(~0, F.getAttributes().getFnAttributes()));
+                      .addAttr(M.getContext(), ~0, F.getAttributes().getFnAttributes()));
 
   // 5. Perform the cloning
   SmallVector<ReturnInst*, 100>Returns;
@@ -850,9 +850,9 @@
 
   // 4. Copy over attributes for the function
   NewF->setAttributes(NewF->getAttributes()
-                      .addAttr(0, F.getAttributes().getRetAttributes()));
+                      .addAttr(M.getContext(), 0, F.getAttributes().getRetAttributes()));
   NewF->setAttributes(NewF->getAttributes()
-                      .addAttr(~0, F.getAttributes().getFnAttributes()));
+                      .addAttr(M.getContext(), ~0, F.getAttributes().getFnAttributes()));
 
   // 5. Perform the cloning
   SmallVector<ReturnInst*, 100>Returns;
@@ -1064,7 +1064,7 @@
         Attributes RAttrs = CallPAL.getRetAttributes();
         Attributes FnAttrs = CallPAL.getFnAttributes();
 
-        if (RAttrs)
+        if (RAttrs.hasAttributes())
           AttributesVec.push_back(AttributeWithIndex::get(0, RAttrs));
 
         Function::arg_iterator NI = F.arg_begin();
@@ -1076,7 +1076,8 @@
           //FIXME: copy the rest of the attributes.
           if(NI->hasByValAttr()) 
             continue;
-          if (Attributes Attrs = CallPAL.getParamAttributes(j)) {
+          Attributes Attrs = CallPAL.getParamAttributes(j);
+          if (Attrs.hasAttributes()) {
             AttributesVec.push_back(AttributeWithIndex::get(j, Attrs));
           }
         }
@@ -1111,7 +1112,7 @@
         Attributes RAttrs = CallPAL.getRetAttributes();
         Attributes FnAttrs = CallPAL.getFnAttributes();
 
-        if (RAttrs)
+        if (RAttrs.hasAttributes())
           AttributesVec.push_back(AttributeWithIndex::get(0, RAttrs));
 
         Function::arg_iterator II = F.arg_begin();
@@ -1123,7 +1124,8 @@
           //FIXME: copy the rest of the attributes.
           if(II->hasByValAttr()) 
             continue;
-          if (Attributes Attrs = CallPAL.getParamAttributes(j)) {
+          Attributes Attrs = CallPAL.getParamAttributes(j);
+          if (Attrs.hasAttributes()) {
             AttributesVec.push_back(AttributeWithIndex::get(j, Attrs));
           }
         }
@@ -1153,12 +1155,12 @@
   }
 
   // remove the byval attribute from the function
-  Attributes::Builder B;
+  AttrBuilder B;
   B.addAttribute(Attributes::ByVal);
   for (Function::arg_iterator I = F.arg_begin(); I != F.arg_end(); ++I) {
     if (!I->hasByValAttr())
       continue;
-    I->removeAttr(Attributes::get(B));
+    I->removeAttr(Attributes::get(M.getContext(), B));
   }
   return true;
 }

Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp?rev=166041&r1=166040&r2=166041&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Tue Oct 16 14:17:17 2012
@@ -996,10 +996,10 @@
   //
   Function::ArgumentListType & ArgList = New->getArgumentList ();
   Function::ArgumentListType::iterator arg = ArgList.begin();
-  Attributes::Builder B;
+  AttrBuilder B;
   B.addAttribute(Attributes::StructRet);
   for (; arg != ArgList.end(); ++arg) {
-    arg->removeAttr (Attributes::get(B));
+    arg->removeAttr (Attributes::get(F.getContext(), B));
   }
 
   //

Modified: poolalloc/trunk/lib/PoolAllocate/RunTimeAssociate.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/RunTimeAssociate.cpp?rev=166041&r1=166040&r2=166041&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/RunTimeAssociate.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/RunTimeAssociate.cpp Tue Oct 16 14:17:17 2012
@@ -194,7 +194,7 @@
       if (argIndex) ++argIndex;
 
       // Add the parameter to the new list.
-      NewAttrsVector.addAttr(argIndex, PAWI.Attrs);
+      NewAttrsVector.addAttr(F.getContext(), argIndex, PAWI.Attrs);
     }
 
     // Assign the new attributes to the function clone





More information about the llvm-commits mailing list