DebugInfo: Move an assertion into MDCompositeTypeBase
[oota-llvm.git] / include / llvm / IR / DebugInfo.h
index 6fcf1ee65cd3943b7e6585e571ed61ef2109a680..d467b5abe0ea20e15c39c9492d22c33b59226f0e 100644 (file)
@@ -350,10 +350,7 @@ public:
   MDCompositeTypeBase *operator->() const { return get(); }
   MDCompositeTypeBase &operator*() const { return *get(); }
 
-  DIArray getElements() const {
-    assert(!isa<MDSubroutineType>(*this) && "no elements for DISubroutineType");
-    return DIArray(get()->getElements());
-  }
+  DIArray getElements() const { return get()->getElements(); }
 
   unsigned getRunTimeLang() const { return get()->getRuntimeLang(); }
   DITypeRef getContainingType() const { return get()->getVTableHolder(); }