namespace WinEH {
enum class EncodingType {
- ET_Invalid, /// Invalid
- ET_Alpha, /// Windows Alpha
- ET_Alpha64, /// Windows AXP64
- ET_ARM, /// Windows NT (Windows on ARM)
- ET_CE, /// Windows CE ARM, PowerPC, SH3, SH4
- ET_Itanium, /// Windows x64, Windows Itanium (IA-64)
- ET_MIPS = ET_Alpha,
+ Invalid, /// Invalid
+ Alpha, /// Windows Alpha
+ Alpha64, /// Windows AXP64
+ ARM, /// Windows NT (Windows on ARM)
+ CE, /// Windows CE ARM, PowerPC, SH3, SH4
+ Itanium, /// Windows x64, Windows Itanium (IA-64)
+ MIPS = Alpha,
};
}
-namespace ExceptionHandling {
-enum ExceptionsType { None, DwarfCFI, SjLj, ARM, Win64 };
-}
+enum class ExceptionHandling {
+ None, /// No exception support
+ DwarfCFI, /// DWARF-like instruction based exceptions
+ SjLj, /// setjmp/longjmp based exceptions
+ ARM, /// ARM EHABI
+ ItaniumWinEH, /// Itanium EH built on Windows unwind info (.pdata and .xdata)
+};
namespace LCOMM {
enum LCOMMType { NoAlignment, ByteAlignment, Log2Alignment };
bool HasMachoTBSSDirective;
/// True if the compiler should emit a ".reference .constructors_used" or
- /// ".reference .destructors_used" directive after the a static ctor/dtor
+ /// ".reference .destructors_used" directive after the static ctor/dtor
/// list. This directive is only emitted in Static relocation model. Default
/// is false.
bool HasStaticCtorDtorReferenceInStaticMode;
- /// True if the linker has a bug and requires that the debug_line section be
- /// of a minimum size. In practice such a linker requires a non-empty line
- /// sequence if a file is present. Default to false.
- bool LinkerRequiresNonEmptyDwarfLines;
-
/// This is the maximum possible length of an instruction, which is needed to
/// compute the size of an inline asm. Defaults to 4.
unsigned MaxInstLength;
/// This is the directive used to declare a global entity. Defaults to NULL.
const char *GlobalDirective;
- /// True if the assembler supports the .set directive. Defaults to true.
- bool HasSetDirective;
+ /// True if the expression
+ /// .long f - g
+ /// uses an relocation but it can be supressed by writting
+ /// a = f - g
+ /// .long a
+ bool SetDirectiveSuppressesReloc;
/// False if the assembler requires that we use
/// \code
//===--- Dwarf Emission Directives -----------------------------------===//
- /// True if target asm supports leb128 directives. Defaults to false.
- bool HasLEB128;
-
/// True if target supports emission of debugging information. Defaults to
/// false.
bool SupportsDebugInformation;
/// Exception handling format for the target. Defaults to None.
- ExceptionHandling::ExceptionsType ExceptionsType;
+ ExceptionHandling ExceptionsType;
/// Windows exception handling data (.pdata) encoding. Defaults to Invalid.
WinEH::EncodingType WinEHEncodingType;
bool hasStaticCtorDtorReferenceInStaticMode() const {
return HasStaticCtorDtorReferenceInStaticMode;
}
- bool getLinkerRequiresNonEmptyDwarfLines() const {
- return LinkerRequiresNonEmptyDwarfLines;
- }
unsigned getMaxInstLength() const { return MaxInstLength; }
unsigned getMinInstAlignment() const { return MinInstAlignment; }
bool getDollarIsPC() const { return DollarIsPC; }
bool getAlignmentIsInBytes() const { return AlignmentIsInBytes; }
unsigned getTextAlignFillValue() const { return TextAlignFillValue; }
const char *getGlobalDirective() const { return GlobalDirective; }
- bool hasSetDirective() const { return HasSetDirective; }
+ bool doesSetDirectiveSuppressesReloc() const {
+ return SetDirectiveSuppressesReloc;
+ }
bool hasAggressiveSymbolFolding() const { return HasAggressiveSymbolFolding; }
bool getCOMMDirectiveAlignmentIsInBytes() const {
return COMMDirectiveAlignmentIsInBytes;
MCSymbolAttr getProtectedVisibilityAttr() const {
return ProtectedVisibilityAttr;
}
- bool hasLEB128() const { return HasLEB128; }
bool doesSupportDebugInformation() const { return SupportsDebugInformation; }
bool doesSupportExceptionHandling() const {
return ExceptionsType != ExceptionHandling::None;
}
- ExceptionHandling::ExceptionsType getExceptionHandlingType() const {
- return ExceptionsType;
- }
- WinEH::EncodingType getWinEHEncodingType() const {
- return WinEHEncodingType;
- }
- bool isExceptionHandlingDwarf() const {
+ ExceptionHandling getExceptionHandlingType() const { return ExceptionsType; }
+ WinEH::EncodingType getWinEHEncodingType() const { return WinEHEncodingType; }
+
+ /// Return true if the exception handling type uses the language-specific data
+ /// area (LSDA) format specified by the Itanium C++ ABI.
+ bool usesItaniumLSDAForExceptions() const {
return (ExceptionsType == ExceptionHandling::DwarfCFI ||
ExceptionsType == ExceptionHandling::ARM ||
- ExceptionsType == ExceptionHandling::Win64);
+ // This Windows EH type uses the Itanium LSDA encoding.
+ ExceptionsType == ExceptionHandling::ItaniumWinEH);
}
+
bool doesDwarfUseRelocationsAcrossSections() const {
return DwarfUsesRelocationsAcrossSections;
}