Calculate mod/ref info

llvm-svn: 4223
This commit is contained in:
Chris Lattner 2002-10-17 22:13:19 +00:00
parent 3d1fddea22
commit b4e800aabf
1 changed files with 3 additions and 0 deletions

View File

@ -328,12 +328,15 @@ void GraphBuilder::visitGetElementPtrInst(GetElementPtrInst &GEP) {
void GraphBuilder::visitLoadInst(LoadInst &LI) { void GraphBuilder::visitLoadInst(LoadInst &LI) {
DSNodeHandle &Ptr = getValueDest(*LI.getOperand(0)); DSNodeHandle &Ptr = getValueDest(*LI.getOperand(0));
Ptr.getNode()->NodeType |= DSNode::Read;
if (isPointerType(LI.getType())) if (isPointerType(LI.getType()))
getValueNode(LI).addEdgeTo(getLink(Ptr, 0, LI.getType())); getValueNode(LI).addEdgeTo(getLink(Ptr, 0, LI.getType()));
} }
void GraphBuilder::visitStoreInst(StoreInst &SI) { void GraphBuilder::visitStoreInst(StoreInst &SI) {
DSNodeHandle &Dest = getValueDest(*SI.getOperand(1)); DSNodeHandle &Dest = getValueDest(*SI.getOperand(1));
Dest.getNode()->NodeType |= DSNode::Modified;
// Avoid adding edges from null, or processing non-"pointer" stores // Avoid adding edges from null, or processing non-"pointer" stores
if (isPointerType(SI.getOperand(0)->getType()) && if (isPointerType(SI.getOperand(0)->getType()) &&