Skip to content

Commit c19326c

Browse files
committed
[MC] Replace HasAggressiveSymbolFolding with SetDirectiveSuppressesReloc. NFC
The variable and its comment could lead to confusion (AMDGPU unnecessarily set it).
1 parent 6ec169d commit c19326c

File tree

4 files changed

+2
-22
lines changed

4 files changed

+2
-22
lines changed

llvm/include/llvm/MC/MCAsmInfo.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -348,21 +348,6 @@ class MCAsmInfo {
348348
/// .long a
349349
bool SetDirectiveSuppressesReloc = false;
350350

351-
/// False if the assembler requires that we use
352-
/// \code
353-
/// Lc = a - b
354-
/// .long Lc
355-
/// \endcode
356-
//
357-
/// instead of
358-
//
359-
/// \code
360-
/// .long a - b
361-
/// \endcode
362-
///
363-
/// Defaults to true.
364-
bool HasAggressiveSymbolFolding = true;
365-
366351
/// True is .comm's and .lcomms optional alignment is to be specified in bytes
367352
/// instead of log2(n). Defaults to true.
368353
bool COMMDirectiveAlignmentIsInBytes = true;
@@ -722,8 +707,6 @@ class MCAsmInfo {
722707
return SetDirectiveSuppressesReloc;
723708
}
724709

725-
bool hasAggressiveSymbolFolding() const { return HasAggressiveSymbolFolding; }
726-
727710
bool getCOMMDirectiveAlignmentIsInBytes() const {
728711
return COMMDirectiveAlignmentIsInBytes;
729712
}

llvm/lib/MC/MCAsmInfoDarwin.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ MCAsmInfoDarwin::MCAsmInfoDarwin() {
7676
HasMachoZeroFillDirective = true; // Uses .zerofill
7777
HasMachoTBSSDirective = true; // Uses .tbss
7878

79-
// FIXME: Change this once MC is the system assembler.
80-
HasAggressiveSymbolFolding = false;
81-
8279
HiddenVisibilityAttr = MCSA_PrivateExtern;
8380
HiddenDeclarationVisibilityAttr = MCSA_Invalid;
8481

llvm/lib/MC/MCDwarf.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,10 @@ MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params,
320320
static const MCExpr *forceExpAbs(MCStreamer &OS, const MCExpr* Expr) {
321321
MCContext &Context = OS.getContext();
322322
assert(!isa<MCSymbolRefExpr>(Expr));
323-
if (Context.getAsmInfo()->hasAggressiveSymbolFolding())
323+
if (!Context.getAsmInfo()->doesSetDirectiveSuppressReloc())
324324
return Expr;
325325

326+
// On Mach-O, try to avoid a relocation by using a set directive.
326327
MCSymbol *ABS = Context.createTempSymbol();
327328
OS.emitAssignment(ABS, Expr);
328329
return MCSymbolRefExpr::create(ABS, Context);

llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCAsmInfo.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ AMDGPUMCAsmInfo::AMDGPUMCAsmInfo(const Triple &TT,
3434
UsesELFSectionDirectiveForBSS = true;
3535

3636
//===--- Global Variable Emission Directives --------------------------===//
37-
HasAggressiveSymbolFolding = true;
3837
COMMDirectiveAlignmentIsInBytes = false;
3938
HasNoDeadStrip = true;
4039
//===--- Dwarf Emission Directives -----------------------------------===//

0 commit comments

Comments
 (0)