summaryrefslogtreecommitdiff
path: root/include/llvm/MC/MCAsmInfo.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/MC/MCAsmInfo.h')
-rw-r--r--include/llvm/MC/MCAsmInfo.h45
1 files changed, 40 insertions, 5 deletions
diff --git a/include/llvm/MC/MCAsmInfo.h b/include/llvm/MC/MCAsmInfo.h
index 384584ef4ef0e..e6ed5688d18d5 100644
--- a/include/llvm/MC/MCAsmInfo.h
+++ b/include/llvm/MC/MCAsmInfo.h
@@ -53,6 +53,12 @@ namespace LCOMM {
enum LCOMMType { NoAlignment, ByteAlignment, Log2Alignment };
}
+enum class DebugCompressionType {
+ DCT_None, // no compression
+ DCT_Zlib, // zlib style complession
+ DCT_ZlibGnu // zlib-gnu style compression
+};
+
/// This class is intended to be used as a base class for asm
/// properties and features specific to the target.
class MCAsmInfo {
@@ -280,6 +286,10 @@ protected:
/// to false.
bool HasNoDeadStrip;
+ /// True if this target supports the MachO .alt_entry directive. Defaults to
+ /// false.
+ bool HasAltEntry;
+
/// Used to declare a global as being a weak symbol. Defaults to ".weak".
const char *WeakDirective;
@@ -352,13 +362,20 @@ protected:
/// construction (see LLVMTargetMachine::initAsmInfo()).
bool UseIntegratedAssembler;
- /// Compress DWARF debug sections. Defaults to false.
- bool CompressDebugSections;
+ /// Preserve Comments in assembly
+ bool PreserveAsmComments;
+
+ /// Compress DWARF debug sections. Defaults to no compression.
+ DebugCompressionType CompressDebugSections;
/// True if the integrated assembler should interpret 'a >> b' constant
/// expressions as logical rather than arithmetic.
bool UseLogicalShr;
+ // If true, emit GOTPCRELX/REX_GOTPCRELX instead of GOTPCREL, on
+ // X86_64 ELF.
+ bool RelaxELFRelocations = true;
+
public:
explicit MCAsmInfo();
virtual ~MCAsmInfo();
@@ -483,7 +500,7 @@ public:
bool getAlignmentIsInBytes() const { return AlignmentIsInBytes; }
unsigned getTextAlignFillValue() const { return TextAlignFillValue; }
const char *getGlobalDirective() const { return GlobalDirective; }
- bool doesSetDirectiveSuppressesReloc() const {
+ bool doesSetDirectiveSuppressReloc() const {
return SetDirectiveSuppressesReloc;
}
bool hasAggressiveSymbolFolding() const { return HasAggressiveSymbolFolding; }
@@ -498,6 +515,7 @@ public:
bool hasSingleParameterDotFile() const { return HasSingleParameterDotFile; }
bool hasIdentDirective() const { return HasIdentDirective; }
bool hasNoDeadStrip() const { return HasNoDeadStrip; }
+ bool hasAltEntry() const { return HasAltEntry; }
const char *getWeakDirective() const { return WeakDirective; }
const char *getWeakRefDirective() const { return WeakRefDirective; }
bool hasWeakDefDirective() const { return HasWeakDefDirective; }
@@ -520,6 +538,10 @@ public:
ExceptionHandling getExceptionHandlingType() const { return ExceptionsType; }
WinEH::EncodingType getWinEHEncodingType() const { return WinEHEncodingType; }
+ void setExceptionsType(ExceptionHandling EH) {
+ ExceptionsType = EH;
+ }
+
/// Returns true if the exception handling method for the platform uses call
/// frame information to unwind.
bool usesCFIForEH() const {
@@ -556,13 +578,26 @@ public:
UseIntegratedAssembler = Value;
}
- bool compressDebugSections() const { return CompressDebugSections; }
+ /// Return true if assembly (inline or otherwise) should be parsed.
+ bool preserveAsmComments() const { return PreserveAsmComments; }
+
+ /// Set whether assembly (inline or otherwise) should be parsed.
+ virtual void setPreserveAsmComments(bool Value) {
+ PreserveAsmComments = Value;
+ }
- void setCompressDebugSections(bool CompressDebugSections) {
+ DebugCompressionType compressDebugSections() const {
+ return CompressDebugSections;
+ }
+
+ void setCompressDebugSections(DebugCompressionType CompressDebugSections) {
this->CompressDebugSections = CompressDebugSections;
}
bool shouldUseLogicalShr() const { return UseLogicalShr; }
+
+ bool canRelaxRelocations() const { return RelaxELFRelocations; }
+ void setRelaxELFRelocations(bool V) { RelaxELFRelocations = V; }
};
}