34 #undef isCurrentDebugType 35 #undef setCurrentDebugType 36 #undef setCurrentDebugTypes 52 if (CurrentDebugType->empty())
56 for (
auto &d : *CurrentDebugType) {
74 CurrentDebugType->clear();
75 for (
size_t T = 0;
T < Count; ++
T)
76 CurrentDebugType->push_back(Types[
T]);
93 cl::desc(
"Buffer the last N characters of debug output " 94 "until program termination. " 95 "[default 0 -- immediate print-out]"),
101 struct DebugOnlyOpt {
102 void operator=(
const std::string &Val)
const {
108 for (
auto dbgType : dbgTypes)
118 DebugOnly(
"debug-only",
cl::desc(
"Enable a specific type of debug output (comma separated list of types)"),
135 static struct dbgstream {
139 strm(
errs(),
"*** Debug Log Output ***\n",
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
This class represents lattice values for constants.
circular_raw_ostream - A raw_ostream which can save its data to a circular buffer, or can pass it through directly to an underlying stream if specified with a buffer of zero.
static DebugOnlyOpt DebugOnlyOptLoc
void setCurrentDebugType(const char *Type)
setCurrentDebugType - Set the current debug type, as if the -debug-only=X option were specified...
initializer< Ty > init(const Ty &Val)
The instances of the Type class are immutable: once they are created, they are never changed...
static cl::opt< unsigned > DebugBufferSize("debug-buffer-size", cl::desc("Buffer the last N characters of debug output " "until program termination. " "[default 0 -- immediate print-out]"), cl::Hidden, cl::init(0))
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
LLVM_NODISCARD std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
void flushBufferWithBanner()
flushBufferWithBanner - Force output of the buffer along with a small header.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
static ManagedStatic< std::vector< std::string > > CurrentDebugType
static cl::opt< DebugOnlyOpt, true, cl::parser< std::string > > DebugOnly("debug-only", cl::desc("Enable a specific type of debug output (comma separated list of types)"), cl::Hidden, cl::ZeroOrMore, cl::value_desc("debug string"), cl::location(DebugOnlyOptLoc), cl::ValueRequired)
void AddSignalHandler(SignalHandlerCallback FnPtr, void *Cookie)
Add a function to be called when an abort/kill signal is delivered to the process.
bool EnableDebugBuffering
EnableDebugBuffering - This defaults to false.
static cl::opt< bool, true > Debug("debug", cl::desc("Enable debug output"), cl::Hidden, cl::location(DebugFlag))
This class implements an extremely fast bulk output stream that can only output to a stream...
static void debug_user_sig_handler(void *Cookie)
StringRef - Represent a constant reference to a string, i.e.
ManagedStatic - This transparently changes the behavior of global statics to be lazily constructed on...
LocationClass< Ty > location(Ty &L)
bool DebugFlag
This boolean is set to true if the '-debug' command line option is specified.
bool isCurrentDebugType(const char *Type)
isCurrentDebugType - Return true if the specified string is the debug type specified on the command l...
void setCurrentDebugTypes(const char **Types, unsigned Count)
setCurrentDebugTypes - Set the current debug type, as if the -debug-only=X,Y,Z option were specified...