[llvm-commits] [poolalloc] r48598 - /poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp

Andrew Lenharth alenhar2 at cs.uiuc.edu
Thu Mar 20 07:32:48 PDT 2008


Author: alenhar2
Date: Thu Mar 20 09:32:48 2008
New Revision: 48598

URL: http://llvm.org/viewvc/llvm-project?rev=48598&view=rev
Log:
unbitrot

Modified:
    poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp

Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp?rev=48598&r1=48597&r2=48598&view=diff

==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Thu Mar 20 09:32:48 2008
@@ -24,7 +24,7 @@
 #include "llvm/Instructions.h"
 #include "llvm/Module.h"
 #include "llvm/Constants.h"
-#include "llvm/ParamAttrsList.h"
+#include "llvm/ParameterAttributes.h"
 #include "llvm/Support/CFG.h"
 #include "llvm/Target/TargetData.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
@@ -432,23 +432,23 @@
   // verbatim.  This is incorrect; each attribute should be shifted one so
   // that the pool descriptor has no attributes.
   //
-  const ParamAttrsList * OldAttrs = New->getParamAttrs();
-  if (OldAttrs) {
-    ParamAttrsVector NewAttrsVector;
-    for (unsigned index = 0; index < OldAttrs->size(); ++index) {
-      // Find the argument index
-      unsigned argIndex = OldAttrs->getParamIndex (index);
+  const PAListPtr OldAttrs = New->getParamAttrs();
+  if (!OldAttrs.isEmpty()) {
+    PAListPtr NewAttrsVector;
+    for (unsigned index = 0; index < OldAttrs.getNumSlots(); ++index) {
+      const ParamAttrsWithIndex & PAWI = OldAttrs.getSlot(index);
+      unsigned argIndex = PAWI.Index;
 
       // If it's not the return value, move the attribute to the next
       // parameter.
       if (argIndex) ++argIndex;
 
       // Add the parameter to the new list.
-      NewAttrsVector.push_back(ParamAttrsWithIndex::get(argIndex,OldAttrs->getParamAttrsAtIndex(index)));
+      NewAttrsVector.addAttr(argIndex, PAWI.Attrs);
     }
 
     // Assign the new attributes to the function clone
-    New->setParamAttrs (ParamAttrsList::get (NewAttrsVector));
+    New->setParamAttrs (NewAttrsVector);
   }
 
   // Invert the ValueMap into the NewToOldValueMap





More information about the llvm-commits mailing list