[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Local.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Oct 31 00:53:02 PST 2002


Changes in directory llvm/lib/Analysis/DataStructure:

Local.cpp updated: 1.22 -> 1.23

---
Log message:

Remove dead code


---
Diffs of the changes:

Index: llvm/lib/Analysis/DataStructure/Local.cpp
diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.22 llvm/lib/Analysis/DataStructure/Local.cpp:1.23
--- llvm/lib/Analysis/DataStructure/Local.cpp:1.22	Wed Oct 30 23:45:02 2002
+++ llvm/lib/Analysis/DataStructure/Local.cpp	Thu Oct 31 00:52:26 2002
@@ -116,7 +116,7 @@
     DSNodeHandle &getValueNode(Value &V);
 
     /// getValueDest - Return the DSNode that the actual value points to.  This
-    /// is basically the same thing as: getLink(getValueNode(V), 0)
+    /// is the same thing as: getLink(getValueNode(V))
     ///
     DSNodeHandle &getValueDest(Value &V);
 
@@ -127,12 +127,9 @@
 
     /// getLink - This method is used to return the specified link in the
     /// specified node if one exists.  If a link does not already exist (it's
-    /// null), then we create a new node, link it, then return it.  We must
-    /// specify the type of the Node field we are accessing so that we know what
-    /// type should be linked to if we need to create a new node.
+    /// null), then we create a new node, link it, then return it.
     ///
-    DSNodeHandle &getLink(const DSNodeHandle &Node, unsigned Link,
-                          const Type *FieldTy);
+    DSNodeHandle &getLink(const DSNodeHandle &Node, unsigned Link = 0);
   };
 }
 
@@ -218,11 +215,11 @@
   }
 }
 
-/// getValueDest - Return the DSNode that the actual value points to.  This
-/// is basically the same thing as: getLink(getValueNode(V), 0)
+/// getValueDest - Return the DSNode that the actual value points to.  This is
+/// the same thing as: getLink(getValueNode(V), 0)
 ///
 DSNodeHandle &GraphBuilder::getValueDest(Value &V) {
-  return getLink(getValueNode(V), 0, V.getType());
+  return getLink(getValueNode(V));
 }
 
 
@@ -232,24 +229,11 @@
 /// specify the type of the Node field we are accessing so that we know what
 /// type should be linked to if we need to create a new node.
 ///
-DSNodeHandle &GraphBuilder::getLink(const DSNodeHandle &node,
-                                    unsigned LinkNo,
-                                    const Type *FieldTy  // FIXME: eliminate
-                                    ) {
+DSNodeHandle &GraphBuilder::getLink(const DSNodeHandle &node, unsigned LinkNo) {
   DSNodeHandle &Node = const_cast<DSNodeHandle&>(node);
   DSNodeHandle *Link = Node.getLink(LinkNo);
   if (Link) return *Link;
 
-#if 0    // FIXME: delete
-  // If we are indexing with a typed pointer, then the thing we are pointing
-  // to is of the pointed type.  If we are pointing to it with an integer
-  // (because of cast to an integer), we represent it with a void type.
-  //
-  const Type *ReqTy = 0;
-  if (const PointerType *Ptr = dyn_cast<PointerType>(FieldTy))
-    ReqTy = Ptr->getElementType();
-#endif
-  
   // If the link hasn't been created yet, make and return a new shadow node
   DSNode *N = createNode(DSNode::ShadowNode, 0);
   Node.setLink(LinkNo, N);
@@ -373,7 +357,7 @@
   Ptr.getNode()->getTypeRec(LI.getType(), Ptr.getOffset());
   
   if (isPointerType(LI.getType()))
-    getValueNode(LI).addEdgeTo(getLink(Ptr, 0, LI.getType()));
+    getValueNode(LI).addEdgeTo(getLink(Ptr));
 }
 
 void GraphBuilder::visitStoreInst(StoreInst &SI) {
@@ -404,15 +388,14 @@
   // Set up the return value...
   DSNodeHandle RetVal;
   if (isPointerType(CI.getType()))
-    RetVal = getLink(getValueNode(CI), 0, CI.getType());
+    RetVal = getLink(getValueNode(CI));
 
   DSNodeHandle Callee;
   // Special case for a direct call, avoid creating spurious scalar node...
   if (GlobalValue *GV = dyn_cast<GlobalValue>(CI.getOperand(0)))
     Callee = getGlobalNode(*GV);
   else
-    Callee = getLink(getValueNode(*CI.getOperand(0)), 0,
-                     CI.getOperand(0)->getType());
+    Callee = getLink(getValueNode(*CI.getOperand(0)));
 
   std::vector<DSNodeHandle> Args;
   Args.reserve(CI.getNumOperands()-1);
@@ -420,8 +403,7 @@
   // Calculate the arguments vector...
   for (unsigned i = 1, e = CI.getNumOperands(); i != e; ++i)
     if (isPointerType(CI.getOperand(i)->getType()))
-      Args.push_back(getLink(getValueNode(*CI.getOperand(i)), 0,
-                             CI.getOperand(i)->getType()));
+      Args.push_back(getLink(getValueNode(*CI.getOperand(i))));
 
   // Add a new function call entry...
   FunctionCalls.push_back(DSCallSite(CI, RetVal, Callee, Args));
@@ -430,8 +412,7 @@
 /// Handle casts...
 void GraphBuilder::visitCastInst(CastInst &CI) {
   if (isPointerType(CI.getType()) && isPointerType(CI.getOperand(0)->getType()))
-    getValueNode(CI).addEdgeTo(getLink(getValueNode(*CI.getOperand(0)), 0,
-                                       CI.getOperand(0)->getType()));
+    getValueNode(CI).addEdgeTo(getLink(getValueNode(*CI.getOperand(0))));
 }
 
 





More information about the llvm-commits mailing list