From: Duncan P. N. Exon Smith Date: Tue, 17 Mar 2015 21:32:46 +0000 (+0000) Subject: DebugInfo: Drop fake DW_TAG_expression X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=887a8678629406379d79aa123f9c2e2b72d9cdac;p=oota-llvm.git DebugInfo: Drop fake DW_TAG_expression Break MDExpression off of DebugNode (inherit directly from `MDNode`) and drop the fake `DW_TAG_expression` tag in the process. AFAICT, there's no real functionality change here. The tag was originally used by `DIDescriptor::isExpression()` to discriminate between `MDNode`s, but in the new hierarchy we don't need that. Fixes PR22780. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232550 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/IR/DebugInfoMetadata.h b/include/llvm/IR/DebugInfoMetadata.h index c09b7d0477d..5bf1d01a8dd 100644 --- a/include/llvm/IR/DebugInfoMetadata.h +++ b/include/llvm/IR/DebugInfoMetadata.h @@ -146,7 +146,6 @@ public: case MDTemplateValueParameterKind: case MDGlobalVariableKind: case MDLocalVariableKind: - case MDExpressionKind: case MDObjCPropertyKind: case MDImportedEntityKind: return true; @@ -1447,17 +1446,16 @@ public: /// \brief DWARF expression. /// /// TODO: Co-allocate the expression elements. -/// TODO: Drop fake DW_TAG_expression and separate from DebugNode. /// TODO: Separate from MDNode, or otherwise drop Distinct and Temporary /// storage types. -class MDExpression : public DebugNode { +class MDExpression : public MDNode { friend class LLVMContextImpl; friend class MDNode; std::vector Elements; MDExpression(LLVMContext &C, StorageType Storage, ArrayRef Elements) - : DebugNode(C, MDExpressionKind, Storage, dwarf::DW_TAG_expression, None), + : MDNode(C, MDExpressionKind, Storage, None), Elements(Elements.begin(), Elements.end()) {} ~MDExpression() {} diff --git a/include/llvm/IR/Metadata.def b/include/llvm/IR/Metadata.def index 66589e0a709..fa4274b1631 100644 --- a/include/llvm/IR/Metadata.def +++ b/include/llvm/IR/Metadata.def @@ -61,6 +61,7 @@ HANDLE_METADATA_LEAF(LocalAsMetadata) HANDLE_MDNODE_BRANCH(MDNode) HANDLE_MDNODE_LEAF(MDTuple) HANDLE_SPECIALIZED_MDNODE_LEAF(MDLocation) +HANDLE_SPECIALIZED_MDNODE_LEAF(MDExpression) HANDLE_SPECIALIZED_MDNODE_BRANCH(DebugNode) HANDLE_SPECIALIZED_MDNODE_LEAF(GenericDebugNode) HANDLE_SPECIALIZED_MDNODE_LEAF(MDSubrange) @@ -86,7 +87,6 @@ HANDLE_SPECIALIZED_MDNODE_LEAF(MDTemplateValueParameter) HANDLE_SPECIALIZED_MDNODE_BRANCH(MDVariable) HANDLE_SPECIALIZED_MDNODE_LEAF(MDGlobalVariable) HANDLE_SPECIALIZED_MDNODE_LEAF(MDLocalVariable) -HANDLE_SPECIALIZED_MDNODE_LEAF(MDExpression) HANDLE_SPECIALIZED_MDNODE_LEAF(MDObjCProperty) HANDLE_SPECIALIZED_MDNODE_LEAF(MDImportedEntity) diff --git a/include/llvm/Support/Dwarf.def b/include/llvm/Support/Dwarf.def index c663af94472..4b923b897e6 100644 --- a/include/llvm/Support/Dwarf.def +++ b/include/llvm/Support/Dwarf.def @@ -102,7 +102,6 @@ HANDLE_DW_TAG(0x0043, template_alias) // Mock tags we use as discriminators. HANDLE_DW_TAG(0x0100, auto_variable) // Tag for local (auto) variables. HANDLE_DW_TAG(0x0101, arg_variable) // Tag for argument variables. -HANDLE_DW_TAG(0x0102, expression) // Tag for complex address expressions. // New in DWARF v5. HANDLE_DW_TAG(0x0044, coarray_type) diff --git a/lib/IR/Verifier.cpp b/lib/IR/Verifier.cpp index b2711a439b6..219a7aa16a4 100644 --- a/lib/IR/Verifier.cpp +++ b/lib/IR/Verifier.cpp @@ -754,7 +754,6 @@ void Verifier::visitMDLocalVariable(const MDLocalVariable &N) { } void Verifier::visitMDExpression(const MDExpression &N) { - Assert(N.getTag() == dwarf::DW_TAG_expression, "invalid tag", &N); Assert(N.isValid(), "invalid expression", &N); }