forked from OSchip/llvm-project
[FaultMaps] Make label formation a bit more explicit [NFC]
This is in advance of assembler padding directives support where we'll need to bundle the label w/the corresponding faulting instruction to avoid padding being inserted between.
This commit is contained in:
parent
7fcd9e3f70
commit
cf6aafa47c
|
@ -36,7 +36,8 @@ public:
|
|||
|
||||
static const char *faultTypeToString(FaultKind);
|
||||
|
||||
void recordFaultingOp(FaultKind FaultTy, const MCSymbol *HandlerLabel);
|
||||
void recordFaultingOp(FaultKind FaultTy, const MCSymbol *FaultingLabel,
|
||||
const MCSymbol *HandlerLabel);
|
||||
void serializeToFaultMapSection();
|
||||
void reset() {
|
||||
FunctionInfos.clear();
|
||||
|
|
|
@ -28,11 +28,9 @@ const char *FaultMaps::WFMP = "Fault Maps: ";
|
|||
FaultMaps::FaultMaps(AsmPrinter &AP) : AP(AP) {}
|
||||
|
||||
void FaultMaps::recordFaultingOp(FaultKind FaultTy,
|
||||
const MCSymbol *FaultingLabel,
|
||||
const MCSymbol *HandlerLabel) {
|
||||
MCContext &OutContext = AP.OutStreamer->getContext();
|
||||
MCSymbol *FaultingLabel = OutContext.createTempSymbol();
|
||||
|
||||
AP.OutStreamer->EmitLabel(FaultingLabel);
|
||||
|
||||
const MCExpr *FaultingOffset = MCBinaryExpr::createSub(
|
||||
MCSymbolRefExpr::create(FaultingLabel, OutContext),
|
||||
|
|
|
@ -1209,8 +1209,12 @@ void X86AsmPrinter::LowerFAULTING_OP(const MachineInstr &FaultingMI,
|
|||
unsigned Opcode = FaultingMI.getOperand(3).getImm();
|
||||
unsigned OperandsBeginIdx = 4;
|
||||
|
||||
auto &Ctx = OutStreamer->getContext();
|
||||
MCSymbol *FaultingLabel = Ctx.createTempSymbol();
|
||||
OutStreamer->EmitLabel(FaultingLabel);
|
||||
|
||||
assert(FK < FaultMaps::FaultKindMax && "Invalid Faulting Kind!");
|
||||
FM.recordFaultingOp(FK, HandlerLabel);
|
||||
FM.recordFaultingOp(FK, FaultingLabel, HandlerLabel);
|
||||
|
||||
MCInst MI;
|
||||
MI.setOpcode(Opcode);
|
||||
|
|
Loading…
Reference in New Issue