[llvm] 4e078e3 - [MC] Replace hasAltEntry() with isMachO()
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 15 14:01:14 PDT 2024
Author: Fangrui Song
Date: 2024-08-15T14:01:09-07:00
New Revision: 4e078e3797098daa40d254447c499bcf61415308
URL: https://github.com/llvm/llvm-project/commit/4e078e3797098daa40d254447c499bcf61415308
DIFF: https://github.com/llvm/llvm-project/commit/4e078e3797098daa40d254447c499bcf61415308.diff
LOG: [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.
Added:
Modified:
llvm/include/llvm/MC/MCAsmInfo.h
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/lib/MC/MCAsmInfoDarwin.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/MC/MCAsmInfo.h b/llvm/include/llvm/MC/MCAsmInfo.h
index dba5d97465af2..278f16d685eed 100644
--- a/llvm/include/llvm/MC/MCAsmInfo.h
+++ b/llvm/include/llvm/MC/MCAsmInfo.h
@@ -382,10 +382,6 @@ class MCAsmInfo {
/// to false.
bool HasNoDeadStrip = false;
- /// True if this target supports the MachO .alt_entry directive. Defaults to
- /// false.
- bool HasAltEntry = false;
-
/// Used to declare a global as being a weak symbol. Defaults to ".weak".
const char *WeakDirective;
@@ -714,7 +710,6 @@ class MCAsmInfo {
bool hasFourStringsDotFile() const { return HasFourStringsDotFile; }
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; }
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 3c792fc89c9b6..60cb26973ead4 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -2147,7 +2147,7 @@ void AsmPrinter::emitGlobalAlias(const Module &M, const GlobalAlias &GA) {
const MCExpr *Expr = lowerConstant(GA.getAliasee());
- if (MAI->hasAltEntry() && isa<MCBinaryExpr>(Expr))
+ if (MAI->isMachO() && isa<MCBinaryExpr>(Expr))
OutStreamer->emitSymbolAttribute(Name, MCSA_AltEntry);
// Emit the directives as assignments aka .set:
diff --git a/llvm/lib/MC/MCAsmInfoDarwin.cpp b/llvm/lib/MC/MCAsmInfoDarwin.cpp
index 8d883e45a91cc..9cba775e9168b 100644
--- a/llvm/lib/MC/MCAsmInfoDarwin.cpp
+++ b/llvm/lib/MC/MCAsmInfoDarwin.cpp
@@ -81,7 +81,6 @@ MCAsmInfoDarwin::MCAsmInfoDarwin() {
HasDotTypeDotSizeDirective = false;
HasNoDeadStrip = true;
- HasAltEntry = true;
DwarfUsesRelocationsAcrossSections = false;
SetDirectiveSuppressesReloc = true;
More information about the llvm-commits
mailing list