LLVM 22.0.0git
Namespaces | Functions | Variables
Debug.cpp File Reference
#include "llvm/Support/Debug.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/circular_raw_ostream.h"
#include "llvm/Support/raw_ostream.h"
#include <utility>
#include "DebugOptions.h"

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Functions

static std::pair< std::string, std::optional< int > > parseDebugType (StringRef DbgType)
 Parse a debug type string into a pair of the debug type and the debug level.
 
LLVM_ABI bool llvm::isCurrentDebugType (const char *Type, int Level=0)
 isCurrentDebugType - Return true if the specified string is the debug type specified on the command line, or if none was specified on the command line with the -debug-only=X option.
 
LLVM_ABI void llvm::setCurrentDebugTypes (const char **Types, unsigned Count)
 setCurrentDebugTypes - Set the current debug type, as if the -debug-only=X,Y,Z option were specified.
 
LLVM_ABI void llvm::setCurrentDebugType (const char *Type)
 setCurrentDebugType - Set the current debug type, as if the -debug-only=X option were specified.
 
static void debug_user_sig_handler (void *Cookie)
 

Variables

static ManagedStatic< std::vector< std::pair< std::string, std::optional< int > > > > llvm::CurrentDebugType
 The current debug type and an optional debug level.
 
static ManagedStatic< cl::opt< bool, true >, CreateDebug > Debug
 
static ManagedStatic< cl::opt< unsigned >, CreateDebugBufferSize > DebugBufferSize
 
static DebugOnlyOpt DebugOnlyOptLoc
 
static ManagedStatic< cl::opt< DebugOnlyOpt, true, cl::parser< std::string > >, CreateDebugOnly > DebugOnly
 

Function Documentation

◆ debug_user_sig_handler()

static void debug_user_sig_handler ( void *  Cookie)
static

Definition at line 196 of file Debug.cpp.

References llvm::dbgs(), and llvm::circular_raw_ostream::flushBufferWithBanner().

Referenced by llvm::dbgs().

◆ parseDebugType()

static std::pair< std::string, std::optional< int > > parseDebugType ( StringRef  DbgType)
static

Parse a debug type string into a pair of the debug type and the debug level.

The expected format is "type[:level]", where the level is an optional integer.

Definition at line 47 of file Debug.cpp.

References llvm::StringRef::empty(), llvm::StringRef::find(), llvm::StringRef::npos, llvm::StringRef::str(), llvm::StringRef::substr(), and llvm::StringRef::take_front().

Referenced by llvm::setCurrentDebugTypes().

Variable Documentation

◆ Debug

ManagedStatic<cl::opt<bool, true>, CreateDebug> Debug
static

◆ DebugBufferSize

ManagedStatic<cl::opt<unsigned>, CreateDebugBufferSize> DebugBufferSize
static

Definition at line 148 of file Debug.cpp.

Referenced by llvm::dbgs(), and llvm::initDebugOptions().

◆ DebugOnly

ManagedStatic<cl::opt<DebugOnlyOpt, true, cl::parser<std::string> >, CreateDebugOnly> DebugOnly
static

Definition at line 187 of file Debug.cpp.

Referenced by llvm::initDebugOptions().

◆ DebugOnlyOptLoc

DebugOnlyOpt DebugOnlyOptLoc
static

Definition at line 165 of file Debug.cpp.