IR: Add specialized debug info metadata nodes

Add specialized debug info metadata nodes that match the `DIDescriptor`
wrappers (used by `DIBuilder`) closely.  Assembly and bitcode support to
follow soon (it'll mostly just be obvious), but this sketches in today's
schema.  This is the first big commit (well, the only *big* one aside
from the testcase changes that'll come when I move this into place) for
PR22464.

I've marked a bunch of obvious changes as `TODO`s in the source; I plan
to make those changes promptly after this hierarchy is moved underneath
`DIDescriptor`, but for now I'm aiming mostly to match the status quo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228640 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-02-10 00:52:32 +00:00
parent cd641756c3
commit 14fcfef23b
8 changed files with 3261 additions and 4 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -51,6 +51,32 @@ HANDLE_MDNODE_LEAF(MDTuple)
HANDLE_MDNODE_LEAF(MDLocation)
HANDLE_MDNODE_BRANCH(DebugNode)
HANDLE_MDNODE_LEAF(GenericDebugNode)
HANDLE_MDNODE_LEAF(MDSubrange)
HANDLE_MDNODE_LEAF(MDEnumerator)
HANDLE_MDNODE_BRANCH(MDScope)
HANDLE_MDNODE_BRANCH(MDType)
HANDLE_MDNODE_LEAF(MDBasicType)
HANDLE_MDNODE_BRANCH(MDDerivedTypeBase)
HANDLE_MDNODE_LEAF(MDDerivedType)
HANDLE_MDNODE_BRANCH(MDCompositeTypeBase)
HANDLE_MDNODE_LEAF(MDCompositeType)
HANDLE_MDNODE_LEAF(MDSubroutineType)
HANDLE_MDNODE_LEAF(MDFile)
HANDLE_MDNODE_LEAF(MDCompileUnit)
HANDLE_MDNODE_LEAF(MDSubprogram)
HANDLE_MDNODE_BRANCH(MDLexicalBlockBase)
HANDLE_MDNODE_LEAF(MDLexicalBlock)
HANDLE_MDNODE_LEAF(MDLexicalBlockFile)
HANDLE_MDNODE_LEAF(MDNamespace)
HANDLE_MDNODE_BRANCH(MDTemplateParameter)
HANDLE_MDNODE_LEAF(MDTemplateTypeParameter)
HANDLE_MDNODE_LEAF(MDTemplateValueParameter)
HANDLE_MDNODE_BRANCH(MDVariable)
HANDLE_MDNODE_LEAF(MDGlobalVariable)
HANDLE_MDNODE_LEAF(MDLocalVariable)
HANDLE_MDNODE_LEAF(MDExpression)
HANDLE_MDNODE_LEAF(MDObjCProperty)
HANDLE_MDNODE_LEAF(MDImportedEntity)
#undef HANDLE_METADATA
#undef HANDLE_METADATA_LEAF

View File

@@ -62,6 +62,25 @@ public:
MDTupleKind,
MDLocationKind,
GenericDebugNodeKind,
MDSubrangeKind,
MDEnumeratorKind,
MDBasicTypeKind,
MDDerivedTypeKind,
MDCompositeTypeKind,
MDSubroutineTypeKind,
MDFileKind,
MDCompileUnitKind,
MDSubprogramKind,
MDLexicalBlockKind,
MDLexicalBlockFileKind,
MDNamespaceKind,
MDTemplateTypeParameterKind,
MDTemplateValueParameterKind,
MDGlobalVariableKind,
MDLocalVariableKind,
MDExpressionKind,
MDObjCPropertyKind,
MDImportedEntityKind,
ConstantAsMetadataKind,
LocalAsMetadataKind,
MDStringKind
@@ -865,9 +884,14 @@ public:
/// \brief Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const Metadata *MD) {
return MD->getMetadataID() == MDTupleKind ||
MD->getMetadataID() == MDLocationKind ||
MD->getMetadataID() == GenericDebugNodeKind;
switch (MD->getMetadataID()) {
default:
return false;
#define HANDLE_MDNODE_LEAF(CLASS) \
case CLASS##Kind: \
return true;
#include "llvm/IR/Metadata.def"
}
}
/// \brief Check whether MDNode is a vtable access.