llvm.org GIT mirror llvm / d6d9c0e
The --debug-only option now takes a comma separated list of debug types. This means that the DEBUG_TYPE cannot take a comma anymore. All existing passes conform to this rule. Differential Revision: http://reviews.llvm.org/D15645 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257466 91177308-0d34-0410-b5e6-96231b3b80d8 Christof Douma 3 years ago
2 changed file(s) with 10 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
407407 'foo' debug type
408408 $ opt < a.bc > /dev/null -mypass -debug-only=bar
409409 'bar' debug type
410 $ opt < a.bc > /dev/null -mypass -debug-only=foo,bar
411 'foo' debug type
412 'bar' debug type
410413
411414 Of course, in practice, you should only set ``DEBUG_TYPE`` at the top of a file,
412415 to specify the debug type for the entire module. Be careful that you only do
416419 use the same string, they will all be turned on when the name is specified.
417420 This allows, for example, all debug information for instruction scheduling to be
418421 enabled with ``-debug-only=InstrSched``, even if the source lives in multiple
419 files.
422 files. The name must not include a comma (,) as that is used to seperate the
423 arguments of the ``-debug-only`` option.
420424
421425 For performance reasons, -debug-only is not available in optimized build
422426 (``--enable-optimized``) of LLVM.
9494 if (Val.empty())
9595 return;
9696 DebugFlag = true;
97 CurrentDebugType->push_back(Val);
97 SmallVector dbgTypes;
98 StringRef(Val).split(dbgTypes, ',', -1, false);
99 for (auto dbgType : dbgTypes)
100 CurrentDebugType->push_back(dbgType);
98101 }
99102 };
100103
103106 static DebugOnlyOpt DebugOnlyOptLoc;
104107
105108 static cl::opt >
106 DebugOnly("debug-only", cl::desc("Enable a specific type of debug output"),
109 DebugOnly("debug-only", cl::desc("Enable a specific type of debug output (comma separated list of types)"),
107110 cl::Hidden, cl::ZeroOrMore, cl::value_desc("debug string"),
108111 cl::location(DebugOnlyOptLoc), cl::ValueRequired);
109
110112 // Signal handlers - dump debug output on termination.
111113 static void debug_user_sig_handler(void *Cookie) {
112114 // This is a bit sneaky. Since this is under #ifndef NDEBUG, we