diff --git a/llvm/include/llvm/MC/MCAsmBackend.h b/llvm/include/llvm/MC/MCAsmBackend.h index bf41420f2a5a..f859d0c418a3 100644 --- a/llvm/include/llvm/MC/MCAsmBackend.h +++ b/llvm/include/llvm/MC/MCAsmBackend.h @@ -51,10 +51,10 @@ public: virtual bool allowAutoPadding() const { return false; } /// Give the target a chance to manipulate state related to instruction - /// alignment (e.g. padding for optimization) before and after actually - /// emitting the instruction. - virtual void alignBranchesBegin(MCObjectStreamer &OS, const MCInst &Inst) {} - virtual void alignBranchesEnd(MCObjectStreamer &OS, const MCInst &Inst) {} + /// alignment (e.g. padding for optimization), instruction relaxablility, etc. + /// before and after actually emitting the instruction. + virtual void emitInstructionBegin(MCObjectStreamer &OS, const MCInst &Inst) {} + virtual void emitInstructionEnd(MCObjectStreamer &OS, const MCInst &Inst) {} /// lifetime management virtual void reset() {} diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp index a36cdc4c1abb..70c9201e8a17 100644 --- a/llvm/lib/MC/MCObjectStreamer.cpp +++ b/llvm/lib/MC/MCObjectStreamer.cpp @@ -367,9 +367,9 @@ bool MCObjectStreamer::mayHaveInstructions(MCSection &Sec) const { void MCObjectStreamer::emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) { - getAssembler().getBackend().alignBranchesBegin(*this, Inst); + getAssembler().getBackend().emitInstructionBegin(*this, Inst); emitInstructionImpl(Inst, STI); - getAssembler().getBackend().alignBranchesEnd(*this, Inst); + getAssembler().getBackend().emitInstructionEnd(*this, Inst); } void MCObjectStreamer::emitInstructionImpl(const MCInst &Inst, diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp index af915b12c8d0..141fcf89555f 100644 --- a/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp +++ b/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp @@ -161,8 +161,8 @@ public: } bool allowAutoPadding() const override; - void alignBranchesBegin(MCObjectStreamer &OS, const MCInst &Inst) override; - void alignBranchesEnd(MCObjectStreamer &OS, const MCInst &Inst) override; + void emitInstructionBegin(MCObjectStreamer &OS, const MCInst &Inst) override; + void emitInstructionEnd(MCObjectStreamer &OS, const MCInst &Inst) override; unsigned getNumFixupKinds() const override { return X86::NumTargetFixupKinds; @@ -171,7 +171,7 @@ public: Optional getFixupKind(StringRef Name) const override; const MCFixupKindInfo &getFixupKindInfo(MCFixupKind Kind) const override; - + bool shouldForceRelocation(const MCAssembler &Asm, const MCFixup &Fixup, const MCValue &Target) override; @@ -512,7 +512,7 @@ bool X86AsmBackend::needAlignInst(const MCInst &Inst) const { } /// Insert BoundaryAlignFragment before instructions to align branches. -void X86AsmBackend::alignBranchesBegin(MCObjectStreamer &OS, +void X86AsmBackend::emitInstructionBegin(MCObjectStreamer &OS, const MCInst &Inst) { if (!needAlign(OS)) return; @@ -538,7 +538,7 @@ void X86AsmBackend::alignBranchesBegin(MCObjectStreamer &OS, // // Do nothing here since we already inserted a BoudaryAlign fragment when // we met the first instruction in the fused pair and we'll tie them - // together in alignBranchesEnd. + // together in emitInstructionEnd. // // Note: When there is at least one fragment, such as MCAlignFragment, // inserted after the previous instruction, e.g. @@ -564,7 +564,7 @@ void X86AsmBackend::alignBranchesBegin(MCObjectStreamer &OS, } /// Set the last fragment to be aligned for the BoundaryAlignFragment. -void X86AsmBackend::alignBranchesEnd(MCObjectStreamer &OS, const MCInst &Inst) { +void X86AsmBackend::emitInstructionEnd(MCObjectStreamer &OS, const MCInst &Inst) { if (!needAlign(OS)) return;