-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[NFC][llvm] Drop isOsWindowsOrUEFI API #138733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The Triple and SubTarget API functions isOsWindowsOrUEFI is not preferred. Dropping them.
@llvm/pr-subscribers-llvm-ir @llvm/pr-subscribers-backend-x86 Author: Prabhu Rajasekaran (Prabhuk) ChangesThe Triple and SubTarget API functions isOsWindowsOrUEFI is not Full diff: https://github.com/llvm/llvm-project/pull/138733.diff 7 Files Affected:
diff --git a/llvm/include/llvm/TargetParser/Triple.h b/llvm/include/llvm/TargetParser/Triple.h
index fb6bbc0163701..dae6cdab0d964 100644
--- a/llvm/include/llvm/TargetParser/Triple.h
+++ b/llvm/include/llvm/TargetParser/Triple.h
@@ -659,9 +659,6 @@ class Triple {
return getOS() == Triple::Win32;
}
- /// Tests whether the OS is Windows or UEFI.
- bool isOSWindowsOrUEFI() const { return isOSWindows() || isUEFI(); }
-
/// Checks if the environment is MSVC.
bool isKnownWindowsMSVCEnvironment() const {
return isOSWindows() && getEnvironment() == Triple::MSVC;
diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp
index 0cf0bfc9702d3..95a5e5989ad00 100644
--- a/llvm/lib/IR/DataLayout.cpp
+++ b/llvm/lib/IR/DataLayout.cpp
@@ -178,7 +178,7 @@ const char *DataLayout::getManglingComponent(const Triple &T) {
return "-m:l";
if (T.isOSBinFormatMachO())
return "-m:o";
- if (T.isOSWindowsOrUEFI() && T.isOSBinFormatCOFF())
+ if ((T.isOSWindows() || T.isUEFI()) && T.isOSBinFormatCOFF())
return T.getArch() == Triple::x86 ? "-m:x" : "-m:w";
if (T.isOSBinFormatXCOFF())
return "-m:a";
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index d35b14735e5b3..f70087e14f702 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/lib/MC/MCContext.cpp
@@ -85,7 +85,7 @@ MCContext::MCContext(const Triple &TheTriple, const MCAsmInfo *mai,
Env = IsMachO;
break;
case Triple::COFF:
- if (!TheTriple.isOSWindowsOrUEFI())
+ if (!TheTriple.isOSWindows() && !TheTriple.isUEFI())
report_fatal_error(
"Cannot initialize MC for non-Windows COFF object files.");
diff --git a/llvm/lib/MC/TargetRegistry.cpp b/llvm/lib/MC/TargetRegistry.cpp
index dde3612b9d184..9263dda65a8b0 100644
--- a/llvm/lib/MC/TargetRegistry.cpp
+++ b/llvm/lib/MC/TargetRegistry.cpp
@@ -32,7 +32,8 @@ MCStreamer *Target::createMCObjectStreamer(
case Triple::UnknownObjectFormat:
llvm_unreachable("Unknown object format");
case Triple::COFF:
- assert(T.isOSWindowsOrUEFI() && "only Windows and UEFI COFF are supported");
+ assert((T.isOSWindows() || T.isUEFI()) &&
+ "only Windows and UEFI COFF are supported");
S = COFFStreamerCtorFn(Ctx, std::move(TAB), std::move(OW),
std::move(Emitter));
break;
diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp
index 7858475d9ac71..8702638564bcb 100644
--- a/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp
+++ b/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp
@@ -185,7 +185,7 @@ X86MCAsmInfoMicrosoftMASM::X86MCAsmInfoMicrosoftMASM(const Triple &Triple)
void X86MCAsmInfoGNUCOFF::anchor() { }
X86MCAsmInfoGNUCOFF::X86MCAsmInfoGNUCOFF(const Triple &Triple) {
- assert(Triple.isOSWindowsOrUEFI() &&
+ assert((Triple.isOSWindows() || Triple.isUEFI()) &&
"Windows and UEFI are the only supported COFF targets");
if (Triple.getArch() == Triple::x86_64) {
PrivateGlobalPrefix = ".L";
diff --git a/llvm/lib/Target/X86/X86MCInstLower.cpp b/llvm/lib/Target/X86/X86MCInstLower.cpp
index d9945bdf2db60..f50d3fa527742 100644
--- a/llvm/lib/Target/X86/X86MCInstLower.cpp
+++ b/llvm/lib/Target/X86/X86MCInstLower.cpp
@@ -1709,7 +1709,7 @@ static void printZeroExtend(const MachineInstr *MI, MCStreamer &OutStreamer,
void X86AsmPrinter::EmitSEHInstruction(const MachineInstr *MI) {
assert(MF->hasWinCFI() && "SEH_ instruction in function without WinCFI?");
- assert(getSubtarget().isOSWindowsOrUEFI() &&
+ assert((getSubtarget().isOSWindows() || getSubtarget().isUEFI()) &&
"SEH_ instruction Windows and UEFI only");
// Use the .cv_fpo directives if we're emitting CodeView on 32-bit x86.
diff --git a/llvm/lib/Target/X86/X86Subtarget.h b/llvm/lib/Target/X86/X86Subtarget.h
index a0b182d3f4c9b..f813fc3485efb 100644
--- a/llvm/lib/Target/X86/X86Subtarget.h
+++ b/llvm/lib/Target/X86/X86Subtarget.h
@@ -331,8 +331,6 @@ class X86Subtarget final : public X86GenSubtargetInfo {
bool isOSWindows() const { return TargetTriple.isOSWindows(); }
- bool isOSWindowsOrUEFI() const { return TargetTriple.isOSWindowsOrUEFI(); }
-
bool isTargetUEFI64() const { return Is64Bit && isUEFI(); }
bool isTargetWin64() const { return Is64Bit && isOSWindows(); }
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/174/builds/17343 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/19573 Here is the relevant piece of the build log for the reference
|
The Triple and SubTarget API functions isOsWindowsOrUEFI is not preferred. Dropping them.
The Triple and SubTarget API functions isOsWindowsOrUEFI is not
preferred. Dropping them.