diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-14 00:57:50 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-14 00:57:50 +0000 |
commit | e7515ebf66af838bcec6720c78c716f46a7bc8e3 (patch) | |
tree | ff23aa61adb7eafdf559900014795e4c94016bda | |
parent | 9cb8988b91bf5fb77664d44ad4da4e0057a67732 (diff) | |
download | bcm5719-llvm-e7515ebf66af838bcec6720c78c716f46a7bc8e3.tar.gz bcm5719-llvm-e7515ebf66af838bcec6720c78c716f46a7bc8e3.zip |
DebugInfo: Move an assertion into MDCompositeTypeBase
In the name of gutting the `DIDescriptor` hierarchy.
llvm-svn: 234829
-rw-r--r-- | llvm/include/llvm/IR/DebugInfo.h | 5 | ||||
-rw-r--r-- | llvm/include/llvm/IR/DebugInfoMetadata.h | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/llvm/include/llvm/IR/DebugInfo.h b/llvm/include/llvm/IR/DebugInfo.h index 6fcf1ee65cd..d467b5abe0e 100644 --- a/llvm/include/llvm/IR/DebugInfo.h +++ b/llvm/include/llvm/IR/DebugInfo.h @@ -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(); } diff --git a/llvm/include/llvm/IR/DebugInfoMetadata.h b/llvm/include/llvm/IR/DebugInfoMetadata.h index 48fc8bbb951..9e6117c9521 100644 --- a/llvm/include/llvm/IR/DebugInfoMetadata.h +++ b/llvm/include/llvm/IR/DebugInfoMetadata.h @@ -786,7 +786,13 @@ protected: ~MDCompositeTypeBase() = default; public: + /// \brief Get the elements of the composite type. + /// + /// \note Calling this is only valid for \a MDCompositeType. This assertion + /// can be removed once \a MDSubroutineType has been separated from + /// "composite types". DebugNodeArray getElements() const { + assert(!isa<MDSubroutineType>(this) && "no elements for DISubroutineType"); return cast_or_null<MDTuple>(getRawElements()); } MDTypeRef getVTableHolder() const { return MDTypeRef(getRawVTableHolder()); } |