diff options
author | Chris Lattner <sabre@nondot.org> | 2002-11-02 00:36:03 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-11-02 00:36:03 +0000 |
commit | 63ba1aca7ce0bf4f47f2ecfce035bc65ef1c0f65 (patch) | |
tree | 5d4d6801a468010fe681f5492663ad3abc7be56b /llvm/lib/Analysis | |
parent | 364e6e82fd6c405c237efd7a20e94f2274eab6c5 (diff) | |
download | bcm5719-llvm-63ba1aca7ce0bf4f47f2ecfce035bc65ef1c0f65.tar.gz bcm5719-llvm-63ba1aca7ce0bf4f47f2ecfce035bc65ef1c0f65.zip |
Implement the "unknown flag" which mainly consists of aligning printing code
llvm-svn: 4490
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/DataStructure/Local.cpp | 15 | ||||
-rw-r--r-- | llvm/lib/Analysis/DataStructure/Printer.cpp | 13 |
2 files changed, 17 insertions, 11 deletions
diff --git a/llvm/lib/Analysis/DataStructure/Local.cpp b/llvm/lib/Analysis/DataStructure/Local.cpp index 456eb2f3335..0d6046d13d3 100644 --- a/llvm/lib/Analysis/DataStructure/Local.cpp +++ b/llvm/lib/Analysis/DataStructure/Local.cpp @@ -369,12 +369,17 @@ void GraphBuilder::visitCallInst(CallInst &CI) { /// Handle casts... void GraphBuilder::visitCastInst(CastInst &CI) { - if (isPointerType(CI.getType())) { - if (isPointerType(CI.getOperand(0)->getType())) + if (isPointerType(CI.getType())) + if (isPointerType(CI.getOperand(0)->getType())) { + // Cast one pointer to the other, just act like a copy instruction setDestTo(CI, getValueDest(*CI.getOperand(0))); - else - ; // FIXME: "Other" node - } + } else { + // Cast something (floating point, small integer) to a pointer. We need + // to track the fact that the node points to SOMETHING, just something we + // don't know about. Make an "Unknown" node. + // + setDestTo(CI, createNode(DSNode::UnknownNode)); + } } diff --git a/llvm/lib/Analysis/DataStructure/Printer.cpp b/llvm/lib/Analysis/DataStructure/Printer.cpp index fd6006c2a5d..26424bed070 100644 --- a/llvm/lib/Analysis/DataStructure/Printer.cpp +++ b/llvm/lib/Analysis/DataStructure/Printer.cpp @@ -36,12 +36,13 @@ static string getCaption(const DSNode *N, const DSGraph *G) { OS << "\n"; } - if (N->NodeType & DSNode::AllocaNode) OS << "A"; - if (N->NodeType & DSNode::NewNode ) OS << "N"; - if (N->NodeType & DSNode::GlobalNode) OS << "G"; - if (N->NodeType & DSNode::Incomplete) OS << "I"; - if (N->NodeType & DSNode::Modified ) OS << "M"; - if (N->NodeType & DSNode::Read ) OS << "R"; + if (N->NodeType & DSNode::AllocaNode ) OS << "A"; + if (N->NodeType & DSNode::NewNode ) OS << "N"; + if (N->NodeType & DSNode::GlobalNode ) OS << "G"; + if (N->NodeType & DSNode::UnknownNode) OS << "U"; + if (N->NodeType & DSNode::Incomplete ) OS << "I"; + if (N->NodeType & DSNode::Modified ) OS << "M"; + if (N->NodeType & DSNode::Read ) OS << "R"; for (unsigned i = 0, e = N->getGlobals().size(); i != e; ++i) { WriteAsOperand(OS, N->getGlobals()[i], false, true, M); |