diff --git a/include/llvm/MC/MCAsmBackend.h b/include/llvm/MC/MCAsmBackend.h index a7d7db834b5..279c2300565 100644 --- a/include/llvm/MC/MCAsmBackend.h +++ b/include/llvm/MC/MCAsmBackend.h @@ -46,6 +46,9 @@ public: const support::endianness Endian; + /// 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) {} diff --git a/include/llvm/MC/MCFragment.h b/include/llvm/MC/MCFragment.h index 5e3d5b78336..892b65c43cf 100644 --- a/include/llvm/MC/MCFragment.h +++ b/include/llvm/MC/MCFragment.h @@ -565,15 +565,18 @@ public: } }; +/// Represents required padding such that a particular other set of fragments +/// does not cross a particular power-of-two boundary. The other fragments must +/// follow this one within the same section. class MCBoundaryAlignFragment : public MCFragment { private: - /// The size of the MCBoundaryAlignFragment. - /// Note: The size is lazily set during relaxation, and is not meaningful - /// before that. + /// The size of the fragment. The size is lazily set during relaxation, and + /// is not meaningful before that. uint64_t Size = 0; /// The alignment requirement of the branch to be aligned. Align AlignBoundary; - /// Flag to indicate whether the branch is fused. + /// Flag to indicate whether the branch is fused. Use in determining the + /// region of fragments being aligned. bool Fused : 1; /// Flag to indicate whether NOPs should be emitted. bool EmitNops : 1; @@ -586,21 +589,16 @@ public: /// \name Accessors /// @{ - - Align getAlignment() const { return AlignBoundary; } - uint64_t getSize() const { return Size; } - - bool canEmitNops() const { return EmitNops; } - - bool isFused() const { return Fused; } - - void setFused(bool Value) { Fused = Value; } - - void setEmitNops(bool Value) { EmitNops = Value; } - void setSize(uint64_t Value) { Size = Value; } + Align getAlignment() const { return AlignBoundary; } + + bool isFused() const { return Fused; } + void setFused(bool Value) { Fused = Value; } + + bool canEmitNops() const { return EmitNops; } + void setEmitNops(bool Value) { EmitNops = Value; } /// @} //