From 878e521b1e8df93b018ae19faf62a17ea071c33b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 4 Feb 2003 00:59:50 +0000 Subject: [PATCH] Fix a huge bug with handling non-pointer instructions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5491 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/DataStructure/Local.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp index 3308fd195bb..a4e7b631816 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; +} + //===----------------------------------------------------------------------===// -- 2.40.0