summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Linker/IRMover.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-12-02 03:20:58 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-12-02 03:20:58 +0000
commitbc0705240e0f57f16919382b3b75263df9a9f2a5 (patch)
tree1ff0e7415c4d6295cb4baa6ea63b4b38469ff123 /llvm/lib/Linker/IRMover.cpp
parentc3be225895ec2373753b2a23f5aced6bad872d81 (diff)
downloadbcm5719-llvm-bc0705240e0f57f16919382b3b75263df9a9f2a5.tar.gz
bcm5719-llvm-bc0705240e0f57f16919382b3b75263df9a9f2a5.zip
IR: Move NumElements field from {Array,Vector}Type to SequentialType.
Now that PointerType is no longer a SequentialType, all SequentialTypes have an associated number of elements, so we can move that information to the base class, allowing for a number of simplifications. Differential Revision: https://reviews.llvm.org/D27122 llvm-svn: 288464
Diffstat (limited to 'llvm/lib/Linker/IRMover.cpp')
-rw-r--r--llvm/lib/Linker/IRMover.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Linker/IRMover.cpp b/llvm/lib/Linker/IRMover.cpp
index ca91b1e8316..8a2aac3f74b 100644
--- a/llvm/lib/Linker/IRMover.cpp
+++ b/llvm/lib/Linker/IRMover.cpp
@@ -169,11 +169,9 @@ bool TypeMapTy::areTypesIsomorphic(Type *DstTy, Type *SrcTy) {
if (DSTy->isLiteral() != SSTy->isLiteral() ||
DSTy->isPacked() != SSTy->isPacked())
return false;
- } else if (ArrayType *DATy = dyn_cast<ArrayType>(DstTy)) {
- if (DATy->getNumElements() != cast<ArrayType>(SrcTy)->getNumElements())
- return false;
- } else if (VectorType *DVTy = dyn_cast<VectorType>(DstTy)) {
- if (DVTy->getNumElements() != cast<VectorType>(SrcTy)->getNumElements())
+ } else if (auto *DSeqTy = dyn_cast<SequentialType>(DstTy)) {
+ if (DSeqTy->getNumElements() !=
+ cast<SequentialType>(SrcTy)->getNumElements())
return false;
}
OpenPOWER on IntegriCloud