[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Local.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Feb 3 19:01:01 PST 2003
Changes in directory llvm/lib/Analysis/DataStructure:
Local.cpp updated: 1.45 -> 1.46
---
Log message:
Fix a huge bug with handling non-pointer instructions
---
Diffs of the changes:
Index: llvm/lib/Analysis/DataStructure/Local.cpp
diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.45 llvm/lib/Analysis/DataStructure/Local.cpp:1.46
--- llvm/lib/Analysis/DataStructure/Local.cpp:1.45 Fri Jan 31 22:51:55 2003
+++ llvm/lib/Analysis/DataStructure/Local.cpp Mon Feb 3 18:59:50 2003
@@ -91,7 +91,7 @@
void visitSetCondInst(SetCondInst &SCI) {} // SetEQ & friends are ignored
void visitFreeInst(FreeInst &FI);
void visitCastInst(CastInst &CI);
- void visitInstruction(Instruction &I) {}
+ void visitInstruction(Instruction &I);
private:
// Helper functions used to implement the visitation functions...
@@ -410,6 +410,21 @@
}
}
+
+// visitInstruction - For all other instruction types, if we have any arguments
+// that are of pointer type, make them have unknown composition bits, and merge
+// the nodes together.
+void GraphBuilder::visitInstruction(Instruction &Inst) {
+ DSNodeHandle CurNode;
+ if (isPointerType(Inst.getType()))
+ CurNode = getValueDest(Inst);
+ for (User::op_iterator I = Inst.op_begin(), E = Inst.op_end(); I != E; ++I)
+ if (isPointerType((*I)->getType()))
+ CurNode.mergeWith(getValueDest(**I));
+
+ if (CurNode.getNode())
+ CurNode.getNode()->NodeType |= DSNode::UnknownNode;
+}
More information about the llvm-commits
mailing list