summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm/DebugInfo/DIContext.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include/llvm/DebugInfo/DIContext.h')
-rw-r--r--llvm/include/llvm/DebugInfo/DIContext.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/include/llvm/DebugInfo/DIContext.h b/llvm/include/llvm/DebugInfo/DIContext.h
index 12093fed12f..881b997df05 100644
--- a/llvm/include/llvm/DebugInfo/DIContext.h
+++ b/llvm/include/llvm/DebugInfo/DIContext.h
@@ -138,10 +138,26 @@ enum DIDumpType : unsigned {
/// dumped.
struct DIDumpOptions {
unsigned DumpType = DIDT_All;
+ unsigned RecurseDepth = -1U;
bool ShowChildren = false;
bool ShowParents = false;
bool SummarizeTypes = false;
bool Verbose = false;
+
+ /// Return default option set for printing a single DIE without children.
+ static DIDumpOptions getForSingleDIE() {
+ DIDumpOptions Opts;
+ Opts.RecurseDepth = 0;
+ return Opts;
+ }
+
+ /// Return the options with RecurseDepth set to 0 unless explicitly required.
+ DIDumpOptions noImplicitRecursion() const {
+ DIDumpOptions Opts = *this;
+ if (RecurseDepth == -1U && !ShowChildren)
+ Opts.RecurseDepth = 0;
+ return Opts;
+ }
};
class DIContext {
OpenPOWER on IntegriCloud