From 7e7b6700743285c0af506ac6299ddf82ebd434b9 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Fri, 6 Jan 2017 20:13:21 +0000 Subject: Vendor import of llvm trunk r291274: https://llvm.org/svn/llvm-project/llvm/trunk@291274 --- include/llvm/CodeGen/DIE.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include/llvm/CodeGen/DIE.h') diff --git a/include/llvm/CodeGen/DIE.h b/include/llvm/CodeGen/DIE.h index 1e3476cd8395..09c3bf6a1b56 100644 --- a/include/llvm/CodeGen/DIE.h +++ b/include/llvm/CodeGen/DIE.h @@ -651,6 +651,9 @@ class DIE : IntrusiveBackListNode, public DIEValueList { unsigned AbbrevNumber = ~0u; /// Dwarf tag code. dwarf::Tag Tag = (dwarf::Tag)0; + /// Set to true to force a DIE to emit an abbreviation that says it has + /// children even when it doesn't. This is used for unit testing purposes. + bool ForceChildren; /// Children DIEs. IntrusiveBackList Children; @@ -659,7 +662,8 @@ class DIE : IntrusiveBackListNode, public DIEValueList { PointerUnion Owner; DIE() = delete; - explicit DIE(dwarf::Tag Tag) : Offset(0), Size(0), Tag(Tag) {} + explicit DIE(dwarf::Tag Tag) : Offset(0), Size(0), Tag(Tag), + ForceChildren(false) {} public: static DIE *get(BumpPtrAllocator &Alloc, dwarf::Tag Tag) { @@ -677,7 +681,8 @@ public: /// Get the compile/type unit relative offset of this DIE. unsigned getOffset() const { return Offset; } unsigned getSize() const { return Size; } - bool hasChildren() const { return !Children.empty(); } + bool hasChildren() const { return ForceChildren || !Children.empty(); } + void setForceChildren(bool B) { ForceChildren = B; } typedef IntrusiveBackList::iterator child_iterator; typedef IntrusiveBackList::const_iterator const_child_iterator; -- cgit v1.2.3