mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-07 16:54:48 +00:00
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
This commit is contained in:
parent
5200ad1b34
commit
82962de3b9
@ -209,7 +209,7 @@ DSGraph::DSGraph(const TargetData &td, Function &F, DSGraph *GG)
|
|||||||
///
|
///
|
||||||
DSNodeHandle GraphBuilder::getValueDest(Value &Val) {
|
DSNodeHandle GraphBuilder::getValueDest(Value &Val) {
|
||||||
Value *V = &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!
|
return 0; // Null doesn't point to anything, don't add to ScalarMap!
|
||||||
|
|
||||||
DSNodeHandle &NH = ScalarMap[V];
|
DSNodeHandle &NH = ScalarMap[V];
|
||||||
@ -528,7 +528,8 @@ void GraphBuilder::visitCallSite(CallSite CS) {
|
|||||||
return;
|
return;
|
||||||
} else if (F->getName() == "realloc") {
|
} else if (F->getName() == "realloc") {
|
||||||
DSNodeHandle RetNH = getValueDest(*CS.getInstruction());
|
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())
|
if (DSNode *N = RetNH.getNode())
|
||||||
N->setHeapNodeMarker()->setModifiedMarker()->setReadMarker();
|
N->setHeapNodeMarker()->setModifiedMarker()->setReadMarker();
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user