Calculate mod/ref info
llvm-svn: 4223
diff --git a/llvm/lib/Analysis/DataStructure/Local.cpp b/llvm/lib/Analysis/DataStructure/Local.cpp
index 5020cf9..43fd5a4 100644
--- a/llvm/lib/Analysis/DataStructure/Local.cpp
+++ b/llvm/lib/Analysis/DataStructure/Local.cpp
@@ -328,12 +328,15 @@
void GraphBuilder::visitLoadInst(LoadInst &LI) {
DSNodeHandle &Ptr = getValueDest(*LI.getOperand(0));
+ Ptr.getNode()->NodeType |= DSNode::Read;
+
if (isPointerType(LI.getType()))
getValueNode(LI).addEdgeTo(getLink(Ptr, 0, LI.getType()));
}
void GraphBuilder::visitStoreInst(StoreInst &SI) {
DSNodeHandle &Dest = getValueDest(*SI.getOperand(1));
+ Dest.getNode()->NodeType |= DSNode::Modified;
// Avoid adding edges from null, or processing non-"pointer" stores
if (isPointerType(SI.getOperand(0)->getType()) &&