21#define DEBUG_TYPE "faultmaps" 
   24const char *FaultMaps::WFMP = 
"Fault Maps: ";
 
   31  MCContext &OutContext = AP.OutStreamer->getContext();
 
   41  FunctionInfos[AP.CurrentFnSym].emplace_back(FaultTy, FaultingOffset,
 
 
   46  if (FunctionInfos.empty())
 
   49  MCContext &OutContext = AP.OutStreamer->getContext();
 
   67  LLVM_DEBUG(
dbgs() << WFMP << 
"#functions = " << FunctionInfos.size() << 
"\n");
 
   72  for (
const auto &FFI : FunctionInfos)
 
   73    emitFunctionInfo(FFI.first, FFI.second);
 
 
   76void FaultMaps::emitFunctionInfo(
const MCSymbol *FnLabel,
 
   77                                 const FunctionFaultInfos &FFI) {
 
   80  LLVM_DEBUG(
dbgs() << WFMP << 
"  function addr: " << *FnLabel << 
"\n");
 
   83  LLVM_DEBUG(
dbgs() << WFMP << 
"  #faulting PCs: " << FFI.size() << 
"\n");
 
   88  for (
const auto &
Fault : FFI) {
 
  100    return "FaultingLoad";
 
  102    return "FaultingLoadStore";
 
  104    return "FaultingStore";
 
 
static const int FaultMapVersion
 
This class is intended to be used as a driving class for all asm writers.
 
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
 
void recordFaultingOp(FaultKind FaultTy, const MCSymbol *FaultingLabel, const MCSymbol *HandlerLabel)
 
void serializeToFaultMapSection()
 
FaultMaps(AsmPrinter &AP)
 
static const char * faultTypeToString(FaultKind)
 
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
 
Context object for machine code objects.
 
const MCObjectFileInfo * getObjectFileInfo() const
 
LLVM_ABI MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
 
Base class for the full range of assembler expressions which are needed for parsing.
 
MCSection * getFaultMapSection() const
 
Instances of this class represent a uniqued identifier for a section in the current translation unit.
 
Streaming machine code generation interface.
 
void emitValue(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc())
 
void emitSymbolValue(const MCSymbol *Sym, unsigned Size, bool IsSectionRelative=false)
Special case of EmitValue that avoids the client having to pass in a MCExpr for MCSymbols.
 
virtual void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc())
Emit a label for Symbol into the current section.
 
virtual void emitIntValue(uint64_t Value, unsigned Size)
Special case of EmitValue that avoids the client having to pass in a MCExpr for constant integers.
 
void emitInt16(uint64_t Value)
 
virtual void switchSection(MCSection *Section, uint32_t Subsec=0)
Set the current section where code is being emitted to Section.
 
void emitInt32(uint64_t Value)
 
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx, SMLoc Loc=SMLoc())
 
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
 
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
 
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
 
This is an optimization pass for GlobalISel generic memory operations.
 
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.