diff options
| author | Chris Lattner <sabre@nondot.org> | 2003-02-04 00:59:50 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2003-02-04 00:59:50 +0000 | 
| commit | 04fb4b580815afe7447007dd4120385f46419a7d (patch) | |
| tree | 9551747ac6c1592c23d1a9d0e010a4951e777a1a /llvm/lib/Analysis/DataStructure | |
| parent | 36fd3eccbd32fa4b745cd398e566130fc84fd03f (diff) | |
| download | bcm5719-llvm-04fb4b580815afe7447007dd4120385f46419a7d.tar.gz bcm5719-llvm-04fb4b580815afe7447007dd4120385f46419a7d.zip  | |
Fix a huge bug with handling non-pointer instructions
llvm-svn: 5491
Diffstat (limited to 'llvm/lib/Analysis/DataStructure')
| -rw-r--r-- | llvm/lib/Analysis/DataStructure/Local.cpp | 17 | 
1 files changed, 16 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/DataStructure/Local.cpp b/llvm/lib/Analysis/DataStructure/Local.cpp index 3308fd195bb..a4e7b631816 100644 --- a/llvm/lib/Analysis/DataStructure/Local.cpp +++ b/llvm/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; +} +  //===----------------------------------------------------------------------===//  | 

