mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-03 14:08:57 +00:00
Fix a few places to check if TargetData is available before using it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79493 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5149932068
commit
5e9bb73de6
@ -478,9 +478,9 @@ isEliminableCastPair(
|
||||
// We don't want to form an inttoptr or ptrtoint that converts to an integer
|
||||
// type that differs from the pointer size.
|
||||
if ((Res == Instruction::IntToPtr &&
|
||||
SrcTy != TD->getIntPtrType(CI->getContext())) ||
|
||||
(!TD || SrcTy != TD->getIntPtrType(CI->getContext()))) ||
|
||||
(Res == Instruction::PtrToInt &&
|
||||
DstTy != TD->getIntPtrType(CI->getContext())))
|
||||
(!TD || DstTy != TD->getIntPtrType(CI->getContext()))))
|
||||
Res = 0;
|
||||
|
||||
return Instruction::CastOps(Res);
|
||||
|
Loading…
Reference in New Issue
Block a user