summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Instructions.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-11-13 06:58:45 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-11-13 06:58:45 +0000
commit9d5fd4db814e661ff7acf3a9d473e9d72b5f4d93 (patch)
tree40ebdafdb6f3e6697d4d1cb2c8a4dc2f85164c8c /llvm/lib/IR/Instructions.cpp
parent0528a31ddf430bdeb1711ba930b6d530f78af3ad (diff)
downloadbcm5719-llvm-9d5fd4db814e661ff7acf3a9d473e9d72b5f4d93.tar.gz
bcm5719-llvm-9d5fd4db814e661ff7acf3a9d473e9d72b5f4d93.zip
IR: Change the Type::get{Array,Vector,Pointer}ElementType() functions to perform the correct type assertion.
Previously we were only asserting that the type was a sequential type. llvm-svn: 286749
Diffstat (limited to 'llvm/lib/IR/Instructions.cpp')
-rw-r--r--llvm/lib/IR/Instructions.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp
index dcd0feb43cb..693879be181 100644
--- a/llvm/lib/IR/Instructions.cpp
+++ b/llvm/lib/IR/Instructions.cpp
@@ -2550,7 +2550,8 @@ unsigned CastInst::isEliminableCastPair(
case 14:
// bitcast, addrspacecast -> addrspacecast if the element type of
// bitcast's source is the same as that of addrspacecast's destination.
- if (SrcTy->getPointerElementType() == DstTy->getPointerElementType())
+ if (SrcTy->getScalarType()->getPointerElementType() ==
+ DstTy->getScalarType()->getPointerElementType())
return Instruction::AddrSpaceCast;
return 0;
OpenPOWER on IntegriCloud