[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Local.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Nov 3 10:51:38 PST 2004
Changes in directory llvm/lib/Analysis/DataStructure:
Local.cpp updated: 1.116 -> 1.117
---
Log message:
Don't call Constant::getNullValue when the argument could be VoidTy
---
Diffs of the changes: (+3 -2)
Index: llvm/lib/Analysis/DataStructure/Local.cpp
diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.116 llvm/lib/Analysis/DataStructure/Local.cpp:1.117
--- llvm/lib/Analysis/DataStructure/Local.cpp:1.116 Fri Oct 29 23:22:45 2004
+++ llvm/lib/Analysis/DataStructure/Local.cpp Wed Nov 3 12:51:26 2004
@@ -209,7 +209,7 @@
///
DSNodeHandle GraphBuilder::getValueDest(Value &Val) {
Value *V = &Val;
- if (V == Constant::getNullValue(V->getType()))
+ if (isa<Constant>(V) && cast<Constant>(V)->isNullValue())
return 0; // Null doesn't point to anything, don't add to ScalarMap!
DSNodeHandle &NH = ScalarMap[V];
@@ -528,7 +528,8 @@
return;
} else if (F->getName() == "realloc") {
DSNodeHandle RetNH = getValueDest(*CS.getInstruction());
- RetNH.mergeWith(getValueDest(**CS.arg_begin()));
+ if (CS.arg_begin() != CS.arg_end())
+ RetNH.mergeWith(getValueDest(**CS.arg_begin()));
if (DSNode *N = RetNH.getNode())
N->setHeapNodeMarker()->setModifiedMarker()->setReadMarker();
return;
More information about the llvm-commits
mailing list