Add and use a helper elements() to StructType. NFC.
[oota-llvm.git] / lib / IR / LLVMContextImpl.h
index e743ec3abc45ca22b7d9b4ad9cdd30269f09e707..f018dc737508a134120d9585b3c8608338fe5d9e 100644 (file)
@@ -104,9 +104,8 @@ struct AnonStructTypeKeyInfo {
     bool isPacked;
     KeyTy(const ArrayRef<Type*>& E, bool P) :
       ETypes(E), isPacked(P) {}
-    KeyTy(const StructType* ST) :
-      ETypes(ArrayRef<Type*>(ST->element_begin(), ST->element_end())),
-      isPacked(ST->isPacked()) {}
+    KeyTy(const StructType *ST)
+        : ETypes(ST->elements()), isPacked(ST->isPacked()) {}
     bool operator==(const KeyTy& that) const {
       if (isPacked != that.isPacked)
         return false;