diff options
author | Dan Gohman <gohman@apple.com> | 2009-07-21 23:19:40 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-07-21 23:19:40 +0000 |
commit | cc95b075b55662adba10caea06ae31cec10904bb (patch) | |
tree | 195e59632537c11b4b354e2fc36b0a6bbdb14d3c /lib/VMCore | |
parent | 4050d25eec90656e39c05a7b7adfc57c64686d80 (diff) | |
download | external_llvm-cc95b075b55662adba10caea06ae31cec10904bb.zip external_llvm-cc95b075b55662adba10caea06ae31cec10904bb.tar.gz external_llvm-cc95b075b55662adba10caea06ae31cec10904bb.tar.bz2 |
Permit the IntPtrTy argument to isEliminableCastPair to be null,
to help support use when TargetData is not available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76675 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Instructions.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index e04d54c..5e5ce64 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -1890,6 +1890,8 @@ unsigned CastInst::isEliminableCastPair( return 0; case 7: { // ptrtoint, inttoptr -> bitcast (ptr -> ptr) if int size is >= ptr size + if (!IntPtrTy) + return 0; unsigned PtrSize = IntPtrTy->getScalarSizeInBits(); unsigned MidSize = MidTy->getScalarSizeInBits(); if (MidSize >= PtrSize) @@ -1929,6 +1931,8 @@ unsigned CastInst::isEliminableCastPair( return 0; case 13: { // inttoptr, ptrtoint -> bitcast if SrcSize<=PtrSize and SrcSize==DstSize + if (!IntPtrTy) + return 0; unsigned PtrSize = IntPtrTy->getScalarSizeInBits(); unsigned SrcSize = SrcTy->getScalarSizeInBits(); unsigned DstSize = DstTy->getScalarSizeInBits(); |