LLVM 22.0.0git
llvm::impl Namespace Reference

Classes

class  RAIINewLineStream
 A raw_ostream that prints a newline on destruction, useful for LDBG() More...
class  raw_ldbg_ostream
 A raw_ostream that tracks \n and print the prefix after each newline. More...

Functions

constexpr ::llvm::StringRef strip_quotes (const char *Str)
 Return the stringified macro as a StringRef.
static LLVM_ATTRIBUTE_UNUSED bool ldbgIsCurrentDebugType (StringRef Type, int Level)
 Helper to call isCurrentDebugType with a StringRef.
static LLVM_ATTRIBUTE_UNUSED bool ldbgIsCurrentDebugType (int Level, StringRef Type)
static LLVM_ATTRIBUTE_UNUSED constexpr const chargetShortFileName (const char *path)
 Remove the path prefix from the file name.
static LLVM_ATTRIBUTE_UNUSED std::string computePrefix (StringRef DebugType, const char *File, int Line, int Level)
 Compute the prefix for the debug log in the form of: "[DebugType] File:Line " Where the File is the file name without the path prefix.
static LLVM_ATTRIBUTE_UNUSED std::string computePrefix (int Level, const char *File, int Line, StringRef DebugType)
 Overload allowing to swap the order of the DebugType and Level arguments.

Function Documentation

◆ computePrefix() [1/2]

LLVM_ATTRIBUTE_UNUSED std::string llvm::impl::computePrefix ( int Level,
const char * File,
int Line,
StringRef DebugType )
static

Overload allowing to swap the order of the DebugType and Level arguments.

Definition at line 330 of file DebugLog.h.

◆ computePrefix() [2/2]

LLVM_ATTRIBUTE_UNUSED std::string llvm::impl::computePrefix ( StringRef DebugType,
const char * File,
int Line,
int Level )
static

Compute the prefix for the debug log in the form of: "[DebugType] File:Line " Where the File is the file name without the path prefix.

Definition at line 319 of file DebugLog.h.

◆ getShortFileName()

LLVM_ATTRIBUTE_UNUSED constexpr const char * llvm::impl::getShortFileName ( const char * path)
staticconstexpr

Remove the path prefix from the file name.

Definition at line 306 of file DebugLog.h.

◆ ldbgIsCurrentDebugType() [1/2]

LLVM_ATTRIBUTE_UNUSED bool llvm::impl::ldbgIsCurrentDebugType ( int Level,
StringRef Type )
static

Definition at line 228 of file DebugLog.h.

◆ ldbgIsCurrentDebugType() [2/2]

LLVM_ATTRIBUTE_UNUSED bool llvm::impl::ldbgIsCurrentDebugType ( StringRef Type,
int Level )
static

Helper to call isCurrentDebugType with a StringRef.

Definition at line 224 of file DebugLog.h.

◆ strip_quotes()

::llvm::StringRef llvm::impl::strip_quotes ( const char * Str)

Return the stringified macro as a StringRef.

Also, strip out potential surrounding quotes: this comes from an artifact of the macro stringification, if DEBUG_TYPE is undefined we get the string "DEBUG_TYPE", however if it is defined we get the string with the quotes. For example if DEBUG_TYPE is "foo", we get "\"foo\"" but we want to return "foo" here.

Definition at line 192 of file DebugLog.h.

References llvm::StringRef::size().