diff --git a/llvm/include/llvm/MC/MCAsmInfo.h b/llvm/include/llvm/MC/MCAsmInfo.h --- a/llvm/include/llvm/MC/MCAsmInfo.h +++ b/llvm/include/llvm/MC/MCAsmInfo.h @@ -316,6 +316,10 @@ /// result of a alignment directive. Defaults to 0 unsigned TextAlignFillValue = 0; + /// If non-zero, this is used to fill the executable space with instructions + /// that will trap. Defaults to 0 + unsigned TrapFillValue = 0; + //===--- Global Variable Emission Directives --------------------------===// /// This is the directive used to declare a global entity. Defaults to @@ -669,6 +673,7 @@ } bool getAlignmentIsInBytes() const { return AlignmentIsInBytes; } unsigned getTextAlignFillValue() const { return TextAlignFillValue; } + unsigned getTrapFillValue() const { return TrapFillValue; } const char *getGlobalDirective() const { return GlobalDirective; } bool doesSetDirectiveSuppressReloc() const { diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp --- a/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp +++ b/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp @@ -45,6 +45,8 @@ TextAlignFillValue = 0x90; + TrapFillValue = 0xCC; + if (!is64Bit) Data64bitsDirective = nullptr; // we can't emit a 64-bit unit @@ -95,6 +97,8 @@ TextAlignFillValue = 0x90; + TrapFillValue = 0xCC; + // Debug Information SupportsDebugInformation = true; @@ -134,6 +138,8 @@ TextAlignFillValue = 0x90; + TrapFillValue = 0xCC; + AllowAtInName = true; } @@ -167,5 +173,7 @@ TextAlignFillValue = 0x90; + TrapFillValue = 0xCC; + AllowAtInName = true; }