[llvm-commits] [poolalloc] r113339 - in /poolalloc/trunk/lib/DSA: DSGraph.cpp DSTest.cpp Local.cpp

Arushi Aggarwal aggarwa4 at illinois.edu
Tue Sep 7 21:05:33 PDT 2010


Author: aggarwa4
Date: Tue Sep  7 23:05:33 2010
New Revision: 113339

URL: http://llvm.org/viewvc/llvm-project?rev=113339&view=rev
Log:
Removed redundant code, and fixed some code

Modified:
    poolalloc/trunk/lib/DSA/DSGraph.cpp
    poolalloc/trunk/lib/DSA/DSTest.cpp
    poolalloc/trunk/lib/DSA/Local.cpp

Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSGraph.cpp?rev=113339&r1=113338&r2=113339&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/DSGraph.cpp (original)
+++ poolalloc/trunk/lib/DSA/DSGraph.cpp Tue Sep  7 23:05:33 2010
@@ -549,6 +549,11 @@
   //of a better way.  For now, this assumption is known limitation.
   const FunctionType *CalleeFuncType = DSCallSite::FunctionTypeOfCallSite(CS);
   int NumFixedArgs = CalleeFuncType->getNumParams();
+  
+  // Sanity check--this really, really shouldn't happen
+  if (!CalleeFuncType->isVarArg())
+    assert(CS.arg_size() == static_cast<unsigned>(NumFixedArgs) &&
+        "Too many arguments/incorrect function signature!");
 
   std::vector<DSNodeHandle> Args;
   Args.reserve(CS.arg_end()-CS.arg_begin());

Modified: poolalloc/trunk/lib/DSA/DSTest.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSTest.cpp?rev=113339&r1=113338&r2=113339&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/DSTest.cpp (original)
+++ poolalloc/trunk/lib/DSA/DSTest.cpp Tue Sep  7 23:05:33 2010
@@ -279,14 +279,14 @@
   if (N->type_begin() != N->type_end())
     for (DSNode::TyMapTy::const_iterator ii = N->type_begin(),
         ee = N->type_end(); ii != ee; ++ii) {
-      if (!firstType) O << " ";
+      if (!firstType) O << "::";
       firstType = false;
       O << ii->first << ":";
       if (ii->second) {
         bool first = true;
         for (svset<const Type*>::const_iterator ni = ii->second->begin(),
             ne = ii->second->end(); ni != ne; ++ni) {
-          if (!first) O << ",";
+          if (!first) O << "|";
           WriteTypeSymbolic(O, *ni, M);
           first = false;
         }

Modified: poolalloc/trunk/lib/DSA/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=113339&r1=113338&r2=113339&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Local.cpp (original)
+++ poolalloc/trunk/lib/DSA/Local.cpp Tue Sep  7 23:05:33 2010
@@ -447,8 +447,7 @@
   Dest.getNode()->setModifiedMarker();
 
   // Ensure a type-record exists...
-  Dest.getNode()->mergeTypeInfo(StoredTy, 0); //FIXME: calculate offset
-  Dest.getNode()->foldNodeCompletely();
+  Dest.getNode()->mergeTypeInfo(StoredTy, I.getInsertedValueOperandIndex()); 
 
   // Avoid adding edges from null, or processing non-"pointer" stores
   if (isa<PointerType>(StoredTy))
@@ -462,8 +461,7 @@
   Ptr.getNode()->setReadMarker();
 
   // Ensure a typerecord exists...
-  // FIXME: calculate offset
-  Ptr.getNode()->mergeTypeInfo(I.getType(), 0);
+  Ptr.getNode()->mergeTypeInfo(I.getType(), I.getAggregateOperandIndex());
 
   if (isa<PointerType>(I.getType()))
     setDestTo(I, getLink(Ptr));
@@ -924,31 +922,17 @@
   DSNodeHandle VarArgNH;
 
   // Calculate the arguments vector...
-  if (!CalleeFuncType->isVarArg()) {
-    // Add all pointer arguments
-    for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end();
-        I != E; ++I) {
-      if (isa<PointerType>((*I)->getType()))
-        Args.push_back(getValueDest(*I));
-      if (I - CS.arg_begin() >= NumFixedArgs) {
-        errs() << "WARNING: Call contains too many arguments:\n";
-        CS.getInstruction()->dump();
-        assert(0 && "Failing for now");
-      }
-    }
-  } else {
     // Add all fixed pointer arguments, then merge the rest together
-    for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end();
-        I != E; ++I)
-      if (isa<PointerType>((*I)->getType())) {
-        DSNodeHandle ArgNode = getValueDest(*I);
-        if (I - CS.arg_begin() < NumFixedArgs) {
-          Args.push_back(ArgNode);
-        } else {
-          VarArgNH.mergeWith(ArgNode);
-        }
+  for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end();
+      I != E; ++I)
+    if (isa<PointerType>((*I)->getType())) {
+      DSNodeHandle ArgNode = getValueDest(*I);
+      if (I - CS.arg_begin() < NumFixedArgs) {
+        Args.push_back(ArgNode);
+      } else {
+        VarArgNH.mergeWith(ArgNode);
       }
-  }
+    }
 
   // Add a new function call entry...
   if (CalleeNode) {





More information about the llvm-commits mailing list