ports/devel/clang-tools-extra/patches/patch-include_llvm_CodeGen_AsmPrinter_h

30 lines
1.3 KiB
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
Use int3 trap padding between functions instead of trapsleds with a leading jump.
Index: include/llvm/CodeGen/AsmPrinter.h
--- include/llvm/CodeGen/AsmPrinter.h.orig
+++ include/llvm/CodeGen/AsmPrinter.h
@@ -434,6 +434,11 @@ class AsmPrinter : public MachineFunctionPass { (publi
/// correctness.
void emitAlignment(Align Alignment, const GlobalObject *GV = nullptr) const;
+ /// Emit an alignment directive to the specified power of two boundary,
+ /// like emitAlignment, but call emitTrapToAlignment to fill with
+ /// trap instructions instead of NOPs.
+ void emitTrapAlignment(Align Alignment, const GlobalObject *GO = nullptr) const;
+
/// Lower the specified LLVM Constant to an MCExpr.
virtual const MCExpr *lowerConstant(const Constant *CV);
@@ -499,6 +504,11 @@ class AsmPrinter : public MachineFunctionPass { (publi
virtual void emitInstruction(const MachineInstr *) {
llvm_unreachable("EmitInstruction not implemented");
}
+
+ /// Emit an alignment directive to the specified power
+ /// of two boundary, but use Trap instructions for alignment
+ /// sections that should never be executed.
+ virtual void emitTrapToAlignment(Align Alignment) const;
/// Return the symbol for the specified constant pool entry.
virtual MCSymbol *GetCPISymbol(unsigned CPID) const;