aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure/Local.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/DataStructure/Local.cpp')
-rw-r--r--lib/Analysis/DataStructure/Local.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp
index 3308fd195b..a4e7b63181 100644
--- a/lib/Analysis/DataStructure/Local.cpp
+++ b/lib/Analysis/DataStructure/Local.cpp
@@ -91,7 +91,7 @@ namespace {
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...
@@ -411,6 +411,21 @@ void GraphBuilder::visitCastInst(CastInst &CI) {
}
+// 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;
+}
+
//===----------------------------------------------------------------------===//