diff options
author | Chris Lattner <sabre@nondot.org> | 2004-11-03 18:51:26 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-11-03 18:51:26 +0000 |
commit | a67a030d9d3b0af80aeb24bec5ee75fc42b9c7b6 (patch) | |
tree | 77310b276673512ce06a853dbbf72c51ed963b09 /llvm/lib/Analysis/DataStructure | |
parent | f305b0ae1b34bf3aab2c4f861d0717c7f4048f4c (diff) | |
download | bcm5719-llvm-a67a030d9d3b0af80aeb24bec5ee75fc42b9c7b6.tar.gz bcm5719-llvm-a67a030d9d3b0af80aeb24bec5ee75fc42b9c7b6.zip |
Don't call Constant::getNullValue when the argument could be VoidTy
llvm-svn: 17457
Diffstat (limited to 'llvm/lib/Analysis/DataStructure')
-rw-r--r-- | llvm/lib/Analysis/DataStructure/Local.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/DataStructure/Local.cpp b/llvm/lib/Analysis/DataStructure/Local.cpp index b12a8ccb526..18e7df91455 100644 --- a/llvm/lib/Analysis/DataStructure/Local.cpp +++ b/llvm/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; |