15 #ifndef LLVM_XRAY_INSTRUMENTATION_MAP_H
16 #define LLVM_XRAY_INSTRUMENTATION_MAP_H
23 #include <unordered_map>
31 class InstrumentationMap;
122 static constexpr
bool flow =
true;
131 #endif // LLVM_XRAY_INSTRUMENTATION_MAP_H
void mapOptional(const char *Key, T &Val)
FunctionKinds
Each entry here represents the kinds of supported instrumentation map entries.
const FunctionAddressMap & getFunctionAddresses()
Provides a raw accessor to the unordered map of function addresses.
static void mapping(IO &IO, xray::YAMLXRaySledEntry &Entry)
bool AlwaysInstrument
Whether the sled was annotated to always be instrumented.
#define LLVM_YAML_IS_SEQUENCE_VECTOR(type)
Utility for declaring that a std::vector of a particular type should be considered a YAML sequence...
std::unordered_map< uint64_t, int32_t > FunctionAddressReverseMap
FunctionKinds Kind
The kind of sled.
std::vector< SledEntry > SledContainer
Tagged union holding either a T or a Error.
Expected< InstrumentationMap > loadInstrumentationMap(StringRef Filename)
Loads the instrumentation map from |Filename|.
This class should be specialized by any type that needs to be converted to/from a YAML mapping...
Represents an XRay instrumentation sled entry from an object file.
void enumCase(T &Val, const char *Str, const T ConstVal)
const SledContainer & sleds() const
Provide read-only access to the entries of the instrumentation map.
Optional< int32_t > getFunctionId(uint64_t Addr) const
Returns an XRay computed function id, provided a function address.
This class should be specialized by any integral type that converts to/from a YAML scalar where there...
SledEntry::FunctionKinds Kind
Optional< uint64_t > getFunctionAddr(int32_t FuncId) const
Returns the function address for a function id.
uint64_t Address
The address of the sled.
static void enumeration(IO &IO, xray::SledEntry::FunctionKinds &Kind)
friend Expected< InstrumentationMap > loadInstrumentationMap(StringRef)
Loads the instrumentation map from |Filename|.
std::unordered_map< int32_t, uint64_t > FunctionAddressMap
The InstrumentationMap represents the computed function id's and indicated function addresses from an...
uint64_t Function
The address of the function.
StringRef - Represent a constant reference to a string, i.e.
void mapRequired(const char *Key, T &Val)