[llvm] r232550 - DebugInfo: Drop fake DW_TAG_expression
Duncan P. N. Exon Smith
dexonsmith at apple.com
Tue Mar 17 14:32:46 PDT 2015
Author: dexonsmith
Date: Tue Mar 17 16:32:46 2015
New Revision: 232550
URL: http://llvm.org/viewvc/llvm-project?rev=232550&view=rev
Log:
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.
Modified:
llvm/trunk/include/llvm/IR/DebugInfoMetadata.h
llvm/trunk/include/llvm/IR/Metadata.def
llvm/trunk/include/llvm/Support/Dwarf.def
llvm/trunk/lib/IR/Verifier.cpp
Modified: llvm/trunk/include/llvm/IR/DebugInfoMetadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugInfoMetadata.h?rev=232550&r1=232549&r2=232550&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DebugInfoMetadata.h (original)
+++ llvm/trunk/include/llvm/IR/DebugInfoMetadata.h Tue Mar 17 16:32:46 2015
@@ -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<uint64_t> Elements;
MDExpression(LLVMContext &C, StorageType Storage, ArrayRef<uint64_t> Elements)
- : DebugNode(C, MDExpressionKind, Storage, dwarf::DW_TAG_expression, None),
+ : MDNode(C, MDExpressionKind, Storage, None),
Elements(Elements.begin(), Elements.end()) {}
~MDExpression() {}
Modified: llvm/trunk/include/llvm/IR/Metadata.def
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Metadata.def?rev=232550&r1=232549&r2=232550&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Metadata.def (original)
+++ llvm/trunk/include/llvm/IR/Metadata.def Tue Mar 17 16:32:46 2015
@@ -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(MDTemplat
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)
Modified: llvm/trunk/include/llvm/Support/Dwarf.def
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Dwarf.def?rev=232550&r1=232549&r2=232550&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Dwarf.def (original)
+++ llvm/trunk/include/llvm/Support/Dwarf.def Tue Mar 17 16:32:46 2015
@@ -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)
Modified: llvm/trunk/lib/IR/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Verifier.cpp?rev=232550&r1=232549&r2=232550&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Verifier.cpp (original)
+++ llvm/trunk/lib/IR/Verifier.cpp Tue Mar 17 16:32:46 2015
@@ -754,7 +754,6 @@ void Verifier::visitMDLocalVariable(cons
}
void Verifier::visitMDExpression(const MDExpression &N) {
- Assert(N.getTag() == dwarf::DW_TAG_expression, "invalid tag", &N);
Assert(N.isValid(), "invalid expression", &N);
}
More information about the llvm-commits
mailing list