Skip to content

Commit 4e078e3

Browse files
committed
[MC] Replace hasAltEntry() with isMachO()
All Mach-O targets have this property, so just remove this variable, which could lure contributors to add unneeded object file format specific properties.
1 parent 274370d commit 4e078e3

File tree

3 files changed

+1
-7
lines changed

3 files changed

+1
-7
lines changed

llvm/include/llvm/MC/MCAsmInfo.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,6 @@ class MCAsmInfo {
382382
/// to false.
383383
bool HasNoDeadStrip = false;
384384

385-
/// True if this target supports the MachO .alt_entry directive. Defaults to
386-
/// false.
387-
bool HasAltEntry = false;
388-
389385
/// Used to declare a global as being a weak symbol. Defaults to ".weak".
390386
const char *WeakDirective;
391387

@@ -714,7 +710,6 @@ class MCAsmInfo {
714710
bool hasFourStringsDotFile() const { return HasFourStringsDotFile; }
715711
bool hasIdentDirective() const { return HasIdentDirective; }
716712
bool hasNoDeadStrip() const { return HasNoDeadStrip; }
717-
bool hasAltEntry() const { return HasAltEntry; }
718713
const char *getWeakDirective() const { return WeakDirective; }
719714
const char *getWeakRefDirective() const { return WeakRefDirective; }
720715

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2147,7 +2147,7 @@ void AsmPrinter::emitGlobalAlias(const Module &M, const GlobalAlias &GA) {
21472147

21482148
const MCExpr *Expr = lowerConstant(GA.getAliasee());
21492149

2150-
if (MAI->hasAltEntry() && isa<MCBinaryExpr>(Expr))
2150+
if (MAI->isMachO() && isa<MCBinaryExpr>(Expr))
21512151
OutStreamer->emitSymbolAttribute(Name, MCSA_AltEntry);
21522152

21532153
// Emit the directives as assignments aka .set:

llvm/lib/MC/MCAsmInfoDarwin.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ MCAsmInfoDarwin::MCAsmInfoDarwin() {
8181

8282
HasDotTypeDotSizeDirective = false;
8383
HasNoDeadStrip = true;
84-
HasAltEntry = true;
8584

8685
DwarfUsesRelocationsAcrossSections = false;
8786
SetDirectiveSuppressesReloc = true;

0 commit comments

Comments
 (0)