[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Local.cpp Printer.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri Nov 1 18:37:01 PST 2002
Changes in directory llvm/lib/Analysis/DataStructure:
Local.cpp updated: 1.24 -> 1.25
Printer.cpp updated: 1.28 -> 1.29
---
Log message:
Implement the "unknown flag" which mainly consists of aligning printing code
---
Diffs of the changes:
Index: llvm/lib/Analysis/DataStructure/Local.cpp
diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.24 llvm/lib/Analysis/DataStructure/Local.cpp:1.25
--- llvm/lib/Analysis/DataStructure/Local.cpp:1.24 Fri Nov 1 18:13:20 2002
+++ llvm/lib/Analysis/DataStructure/Local.cpp Fri Nov 1 18:36:02 2002
@@ -369,12 +369,17 @@
/// 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));
+ }
}
Index: llvm/lib/Analysis/DataStructure/Printer.cpp
diff -u llvm/lib/Analysis/DataStructure/Printer.cpp:1.28 llvm/lib/Analysis/DataStructure/Printer.cpp:1.29
--- llvm/lib/Analysis/DataStructure/Printer.cpp:1.28 Fri Nov 1 18:13:20 2002
+++ llvm/lib/Analysis/DataStructure/Printer.cpp Fri Nov 1 18:36:02 2002
@@ -36,12 +36,13 @@
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);
More information about the llvm-commits
mailing list