mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-21 18:29:46 +00:00
Add nullptr checks for TargetSelectionDAGInfo in SelectionDAG.
TSI is not guaranteed be non-null in SelectionDAG. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227397 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1f3043175c
commit
c8d6db0fc0
@ -4272,11 +4272,13 @@ SDValue SelectionDAG::getMemcpy(SDValue Chain, SDLoc dl, SDValue Dst,
|
|||||||
|
|
||||||
// Then check to see if we should lower the memcpy with target-specific
|
// Then check to see if we should lower the memcpy with target-specific
|
||||||
// code. If the target chooses to do this, this is the next best.
|
// code. If the target chooses to do this, this is the next best.
|
||||||
SDValue Result =
|
if (TSI) {
|
||||||
TSI->EmitTargetCodeForMemcpy(*this, dl, Chain, Dst, Src, Size, Align,
|
SDValue Result = TSI->EmitTargetCodeForMemcpy(
|
||||||
isVol, AlwaysInline, DstPtrInfo, SrcPtrInfo);
|
*this, dl, Chain, Dst, Src, Size, Align, isVol, AlwaysInline,
|
||||||
if (Result.getNode())
|
DstPtrInfo, SrcPtrInfo);
|
||||||
return Result;
|
if (Result.getNode())
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
|
||||||
// If we really need inline code and the target declined to provide it,
|
// If we really need inline code and the target declined to provide it,
|
||||||
// use a (potentially long) sequence of loads and stores.
|
// use a (potentially long) sequence of loads and stores.
|
||||||
@ -4338,10 +4340,12 @@ SDValue SelectionDAG::getMemmove(SDValue Chain, SDLoc dl, SDValue Dst,
|
|||||||
|
|
||||||
// Then check to see if we should lower the memmove with target-specific
|
// Then check to see if we should lower the memmove with target-specific
|
||||||
// code. If the target chooses to do this, this is the next best.
|
// code. If the target chooses to do this, this is the next best.
|
||||||
SDValue Result = TSI->EmitTargetCodeForMemmove(
|
if (TSI) {
|
||||||
*this, dl, Chain, Dst, Src, Size, Align, isVol, DstPtrInfo, SrcPtrInfo);
|
SDValue Result = TSI->EmitTargetCodeForMemmove(
|
||||||
if (Result.getNode())
|
*this, dl, Chain, Dst, Src, Size, Align, isVol, DstPtrInfo, SrcPtrInfo);
|
||||||
return Result;
|
if (Result.getNode())
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
|
||||||
// FIXME: If the memmove is volatile, lowering it to plain libc memmove may
|
// FIXME: If the memmove is volatile, lowering it to plain libc memmove may
|
||||||
// not be safe. See memcpy above for more details.
|
// not be safe. See memcpy above for more details.
|
||||||
@ -4390,10 +4394,12 @@ SDValue SelectionDAG::getMemset(SDValue Chain, SDLoc dl, SDValue Dst,
|
|||||||
|
|
||||||
// Then check to see if we should lower the memset with target-specific
|
// Then check to see if we should lower the memset with target-specific
|
||||||
// code. If the target chooses to do this, this is the next best.
|
// code. If the target chooses to do this, this is the next best.
|
||||||
SDValue Result = TSI->EmitTargetCodeForMemset(*this, dl, Chain, Dst, Src,
|
if (TSI) {
|
||||||
Size, Align, isVol, DstPtrInfo);
|
SDValue Result = TSI->EmitTargetCodeForMemset(
|
||||||
if (Result.getNode())
|
*this, dl, Chain, Dst, Src, Size, Align, isVol, DstPtrInfo);
|
||||||
return Result;
|
if (Result.getNode())
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
|
||||||
// Emit a library call.
|
// Emit a library call.
|
||||||
Type *IntPtrTy = TLI->getDataLayout()->getIntPtrType(*getContext());
|
Type *IntPtrTy = TLI->getDataLayout()->getIntPtrType(*getContext());
|
||||||
|
Loading…
Reference in New Issue
Block a user