LLVM 22.0.0git
GCOVProfiling.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "insert-gcov-profiling"
#define COVINIT_FUNC(Type, LLVMType, Name, Init)
#define INSTR_PROF_VISIBILITY
#define INSTR_PROF_DATA(Type, LLVMType, Name, Initializer)
#define INSTR_PROF_VTABLE_DATA(Type, LLVMType, Name, Initializer)
#define INSTR_PROF_VALUE_NODE(Type, LLVMType, Name, Initializer)
#define INSTR_PROF_RAW_HEADER(Type, Name, Initializer)
#define VALUE_PROF_FUNC_PARAM(ArgType, ArgName, ArgLLVMType)
#define INSTR_PROF_COMMA
#define VALUE_PROF_KIND(Enumerator, Value, Descr)
#define COVMAP_FUNC_RECORD(Type, LLVMType, Name, Initializer)
#define COVMAP_HEADER(Type, LLVMType, Name, Initializer)
#define INSTR_PROF_DATA_DEFINED
#define COVINIT_FUNC(Type, LLVMType, Name, Init)
#define INSTR_PROF_DATA(Type, LLVMType, Name, Initializer)
#define INSTR_PROF_VTABLE_DATA(Type, LLVMType, Name, Initializer)
#define INSTR_PROF_VALUE_NODE(Type, LLVMType, Name, Initializer)
#define INSTR_PROF_RAW_HEADER(Type, Name, Initializer)
#define VALUE_PROF_FUNC_PARAM(ArgType, ArgName, ArgLLVMType)
#define INSTR_PROF_COMMA
#define VALUE_PROF_KIND(Enumerator, Value, Descr)
#define COVMAP_FUNC_RECORD(Type, LLVMType, Name, Initializer)
#define COVMAP_HEADER(Type, LLVMType, Name, Initializer)
#define INSTR_PROF_DATA_DEFINED

Enumerations

enum  : uint32_t {
  GCOV_ARC_ON_TREE = 1 << 0 , GCOV_TAG_FUNCTION = 0x01000000 , GCOV_TAG_BLOCKS = 0x01410000 , GCOV_TAG_ARCS = 0x01430000 ,
  GCOV_TAG_LINES = 0x01450000
}

Functions

static unsigned wordsOfString (StringRef s)
static StringRef getFunctionName (const DISubprogram *SP)
static SmallString< 128 > getFilename (const DIScope *SP)
 Extract a filename for a DIScope.
static bool functionHasLines (const Function &F, unsigned &EndLine)
static bool isUsingScopeBasedEH (Function &F)
static BasicBlockgetInstrBB (CFGMST< Edge, BBInfo > &MST, Edge &E, const DenseSet< const BasicBlock * > &ExecBlocks)
static void dumpEdges (CFGMST< Edge, BBInfo > &MST, GCOVFunction &GF)

Variables

static cl::opt< std::stringDefaultGCOVVersion ("default-gcov-version", cl::init("0000"), cl::Hidden, cl::ValueRequired)
static cl::opt< boolAtomicCounter ("gcov-atomic-counter", cl::Hidden, cl::desc("Make counter updates atomic"))

Macro Definition Documentation

◆ COVINIT_FUNC [1/2]

#define COVINIT_FUNC ( Type,
LLVMType,
Name,
Init )
Value:
LLVMType,

◆ COVINIT_FUNC [2/2]

#define COVINIT_FUNC ( Type,
LLVMType,
Name,
Init )
Value:

◆ COVMAP_FUNC_RECORD [1/2]

#define COVMAP_FUNC_RECORD ( Type,
LLVMType,
Name,
Initializer )

◆ COVMAP_FUNC_RECORD [2/2]

#define COVMAP_FUNC_RECORD ( Type,
LLVMType,
Name,
Initializer )

◆ COVMAP_HEADER [1/2]

#define COVMAP_HEADER ( Type,
LLVMType,
Name,
Initializer )

◆ COVMAP_HEADER [2/2]

#define COVMAP_HEADER ( Type,
LLVMType,
Name,
Initializer )

◆ DEBUG_TYPE

#define DEBUG_TYPE   "insert-gcov-profiling"

Definition at line 51 of file GCOVProfiling.cpp.

◆ INSTR_PROF_COMMA [1/2]

#define INSTR_PROF_COMMA

◆ INSTR_PROF_COMMA [2/2]

#define INSTR_PROF_COMMA

◆ INSTR_PROF_DATA [1/2]

#define INSTR_PROF_DATA ( Type,
LLVMType,
Name,
Initializer )

◆ INSTR_PROF_DATA [2/2]

#define INSTR_PROF_DATA ( Type,
LLVMType,
Name,
Initializer )

◆ INSTR_PROF_DATA_DEFINED [1/2]

#define INSTR_PROF_DATA_DEFINED

◆ INSTR_PROF_DATA_DEFINED [2/2]

#define INSTR_PROF_DATA_DEFINED

◆ INSTR_PROF_RAW_HEADER [1/2]

#define INSTR_PROF_RAW_HEADER ( Type,
Name,
Initializer )

◆ INSTR_PROF_RAW_HEADER [2/2]

#define INSTR_PROF_RAW_HEADER ( Type,
Name,
Initializer )

◆ INSTR_PROF_VALUE_NODE [1/2]

#define INSTR_PROF_VALUE_NODE ( Type,
LLVMType,
Name,
Initializer )

◆ INSTR_PROF_VALUE_NODE [2/2]

#define INSTR_PROF_VALUE_NODE ( Type,
LLVMType,
Name,
Initializer )

◆ INSTR_PROF_VISIBILITY

#define INSTR_PROF_VISIBILITY

◆ INSTR_PROF_VTABLE_DATA [1/2]

#define INSTR_PROF_VTABLE_DATA ( Type,
LLVMType,
Name,
Initializer )

◆ INSTR_PROF_VTABLE_DATA [2/2]

#define INSTR_PROF_VTABLE_DATA ( Type,
LLVMType,
Name,
Initializer )

◆ VALUE_PROF_FUNC_PARAM [1/2]

#define VALUE_PROF_FUNC_PARAM ( ArgType,
ArgName,
ArgLLVMType )

◆ VALUE_PROF_FUNC_PARAM [2/2]

#define VALUE_PROF_FUNC_PARAM ( ArgType,
ArgName,
ArgLLVMType )

◆ VALUE_PROF_KIND [1/2]

#define VALUE_PROF_KIND ( Enumerator,
Value,
Descr )

◆ VALUE_PROF_KIND [2/2]

#define VALUE_PROF_KIND ( Enumerator,
Value,
Descr )

Enumeration Type Documentation

◆ anonymous enum

anonymous enum : uint32_t
Enumerator
GCOV_ARC_ON_TREE 
GCOV_TAG_FUNCTION 
GCOV_TAG_BLOCKS 
GCOV_TAG_ARCS 
GCOV_TAG_LINES 

Definition at line 53 of file GCOVProfiling.cpp.

Function Documentation

◆ dumpEdges()

void dumpEdges ( CFGMST< Edge, BBInfo > & MST,
GCOVFunction & GF )
static

◆ functionHasLines()

bool functionHasLines ( const Function & F,
unsigned & EndLine )
static

Definition at line 577 of file GCOVProfiling.cpp.

References F, and I.

◆ getFilename()

SmallString< 128 > getFilename ( const DIScope * SP)
static

Extract a filename for a DIScope.

Prefer relative paths in the coverage notes. Clang also may split up absolute paths into a directory and filename component. When the relative path doesn't exist, reconstruct the absolute path.

Definition at line 217 of file GCOVProfiling.cpp.

References llvm::sys::path::append(), and llvm::sys::fs::exists().

Referenced by llvm::checkDebugInfoMetadata(), and llvm::logicalview::LVReader::createScopes().

◆ getFunctionName()

StringRef getFunctionName ( const DISubprogram * SP)
static

Definition at line 206 of file GCOVProfiling.cpp.

◆ getInstrBB()

◆ isUsingScopeBasedEH()

bool isUsingScopeBasedEH ( Function & F)
static

◆ wordsOfString()

unsigned wordsOfString ( StringRef s)
static

Definition at line 70 of file GCOVProfiling.cpp.

References llvm::StringRef::size().

Variable Documentation

◆ AtomicCounter

cl::opt< bool > AtomicCounter("gcov-atomic-counter", cl::Hidden, cl::desc("Make counter updates atomic")) ( "gcov-atomic-counter" ,
cl::Hidden ,
cl::desc("Make counter updates atomic")  )
static

◆ DefaultGCOVVersion

cl::opt< std::string > DefaultGCOVVersion("default-gcov-version", cl::init("0000"), cl::Hidden, cl::ValueRequired) ( "default-gcov-version" ,
cl::init("0000") ,
cl::Hidden ,
cl::ValueRequired  )
static