|
LLVM 23.0.0git
|
Helper to represent an instrumentation location, which is composed of an instrumentation opportunity type and a position. More...
#include "llvm/Transforms/IPO/Instrumentor.h"
Public Types | |
| enum | KindTy { MODULE_PRE , MODULE_POST , GLOBAL_PRE , GLOBAL_POST , FUNCTION_PRE , FUNCTION_POST , BASIC_BLOCK_PRE , BASIC_BLOCK_POST , INSTRUCTION_PRE , INSTRUCTION_POST , Last = INSTRUCTION_POST } |
| The supported location kinds, which are composed of a opportunity type and position. More... | |
Public Member Functions | |
| InstrumentationLocation (KindTy Kind) | |
| Construct an instrumentation location that is not instrumenting an instruction. | |
| InstrumentationLocation (unsigned Opcode, bool IsPRE) | |
| Construct an instrumentation location belonging to the instrumentation of an instruction. | |
| KindTy | getKind () const |
| Return the type and position. | |
| bool | isPRE () const |
| Return whether the instrumentation location is before the event occurs. | |
| unsigned | getOpcode () const |
| Get the opcode of the instruction instrumentation location. | |
Static Public Member Functions | |
| static StringRef | getKindStr (KindTy Kind) |
| Return the string representation given a location kind. | |
| static KindTy | getKindFromStr (StringRef S) |
| Return the location kind described by a string. | |
| static bool | isPRE (KindTy Kind) |
| Return whether a location kind is positioned before the event occurs. | |
Helper to represent an instrumentation location, which is composed of an instrumentation opportunity type and a position.
Definition at line 149 of file Instrumentor.h.
The supported location kinds, which are composed of a opportunity type and position.
The PRE position indicates the instrumentation function call is inserted before the instrumented event occurs. The POST position indicates the instrumentation call is inserted after the event occurs. Some opportunity types may only support one position.
| Enumerator | |
|---|---|
| MODULE_PRE | |
| MODULE_POST | |
| GLOBAL_PRE | |
| GLOBAL_POST | |
| FUNCTION_PRE | |
| FUNCTION_POST | |
| BASIC_BLOCK_PRE | |
| BASIC_BLOCK_POST | |
| INSTRUCTION_PRE | |
| INSTRUCTION_POST | |
| Last | |
Definition at line 155 of file Instrumentor.h.
|
inline |
Construct an instrumentation location that is not instrumenting an instruction.
Definition at line 171 of file Instrumentor.h.
References assert(), INSTRUCTION_POST, and INSTRUCTION_PRE.
|
inline |
Construct an instrumentation location belonging to the instrumentation of an instruction.
Definition at line 178 of file Instrumentor.h.
References INSTRUCTION_POST, and INSTRUCTION_PRE.
|
inline |
Return the type and position.
Definition at line 182 of file Instrumentor.h.
Return the location kind described by a string.
Definition at line 213 of file Instrumentor.h.
References BASIC_BLOCK_POST, BASIC_BLOCK_PRE, llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Default(), FUNCTION_POST, FUNCTION_PRE, GLOBAL_POST, GLOBAL_PRE, INSTRUCTION_POST, INSTRUCTION_PRE, Last, MODULE_POST, and MODULE_PRE.
Referenced by llvm::instrumentor::readConfigFromJSON().
Return the string representation given a location kind.
This is the string used in the configuration file.
Definition at line 186 of file Instrumentor.h.
References BASIC_BLOCK_POST, BASIC_BLOCK_PRE, FUNCTION_POST, FUNCTION_PRE, GLOBAL_POST, GLOBAL_PRE, INSTRUCTION_POST, INSTRUCTION_PRE, llvm_unreachable, MODULE_POST, and MODULE_PRE.
Referenced by llvm::instrumentor::writeConfigToJSON().
|
inline |
Get the opcode of the instruction instrumentation location.
This function may not be called by a non-instruction instrumentation location.
Definition at line 252 of file Instrumentor.h.
References assert(), INSTRUCTION_POST, and INSTRUCTION_PRE.
|
inline |
Return whether the instrumentation location is before the event occurs.
Definition at line 248 of file Instrumentor.h.
References isPRE().
Referenced by isPRE().
Return whether a location kind is positioned before the event occurs.
Definition at line 229 of file Instrumentor.h.
References BASIC_BLOCK_POST, BASIC_BLOCK_PRE, FUNCTION_POST, FUNCTION_PRE, GLOBAL_POST, GLOBAL_PRE, INSTRUCTION_POST, INSTRUCTION_PRE, llvm_unreachable, MODULE_POST, and MODULE_PRE.