summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/Type.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/IR/Type.cpp b/llvm/lib/IR/Type.cpp
index c3c3f492b5b..649962690dd 100644
--- a/llvm/lib/IR/Type.cpp
+++ b/llvm/lib/IR/Type.cpp
@@ -605,13 +605,11 @@ bool StructType::isValidElementType(Type *ElemTy) {
/// specified struct.
bool StructType::isLayoutIdentical(StructType *Other) const {
if (this == Other) return true;
-
- if (isPacked() != Other->isPacked() ||
- getNumElements() != Other->getNumElements())
+
+ if (isPacked() != Other->isPacked())
return false;
-
- return element_begin() &&
- std::equal(element_begin(), element_end(), Other->element_begin());
+
+ return elements() == Other->elements();
}
/// getTypeByName - Return the type with the specified name, or null if there
OpenPOWER on IntegriCloud