aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-11-03 18:51:26 +0000
committerChris Lattner <sabre@nondot.org>2004-11-03 18:51:26 +0000
commit82962de3b92c1df483430e5b03804a56c8c652dd (patch)
treeca82e830b1ae2b5c3edccd8ae622eb08b173492c /lib/Analysis/DataStructure
parent5200ad1b344ab73139ae798a34513065c2dfde52 (diff)
Don't call Constant::getNullValue when the argument could be VoidTy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17457 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure')
-rw-r--r--lib/Analysis/DataStructure/Local.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp
index b12a8ccb52..18e7df9145 100644
--- a/lib/Analysis/DataStructure/Local.cpp
+++ b/lib/Analysis/DataStructure/Local.cpp
@@ -209,7 +209,7 @@ DSGraph::DSGraph(const TargetData &td, Function &F, DSGraph *GG)
///
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 @@ void GraphBuilder::visitCallSite(CallSite CS) {
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;