[llvm] r234829 - DebugInfo: Move an assertion into MDCompositeTypeBase
Duncan P. N. Exon Smith
dexonsmith at apple.com
Mon Apr 13 17:57:50 PDT 2015
Author: dexonsmith
Date: Mon Apr 13 19:57:50 2015
New Revision: 234829
URL: http://llvm.org/viewvc/llvm-project?rev=234829&view=rev
Log:
DebugInfo: Move an assertion into MDCompositeTypeBase
In the name of gutting the `DIDescriptor` hierarchy.
Modified:
llvm/trunk/include/llvm/IR/DebugInfo.h
llvm/trunk/include/llvm/IR/DebugInfoMetadata.h
Modified: llvm/trunk/include/llvm/IR/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugInfo.h?rev=234829&r1=234828&r2=234829&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/IR/DebugInfo.h Mon Apr 13 19:57:50 2015
@@ -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(); }
Modified: llvm/trunk/include/llvm/IR/DebugInfoMetadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugInfoMetadata.h?rev=234829&r1=234828&r2=234829&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DebugInfoMetadata.h (original)
+++ llvm/trunk/include/llvm/IR/DebugInfoMetadata.h Mon Apr 13 19:57:50 2015
@@ -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()); }
More information about the llvm-commits
mailing list