LegalizeDAG: Implement promote for build_vector
[oota-llvm.git] / lib / IR / Type.cpp
index c3c3f492b5bbdf545ff5369d384cfdda6d90d5d5..649962690dd659b0c0e4759255d2e085d9e952db 100644 (file)
@@ -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