Fix a bit of confusion about .set and produce more readable assembly.

Every target we support has support for assembly that looks like

a = b - c
.long a

What is special about MachO is that the above combination suppresses the
production of a relocation.

With this change we avoid producing the intermediary labels when they don't
add any value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220256 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-10-21 01:17:30 +00:00
parent f8c9d3d3c2
commit 45968c54e9
15 changed files with 63 additions and 91 deletions

View File

@@ -223,8 +223,12 @@ protected:
/// 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
@@ -442,7 +446,9 @@ public:
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;