Skip to content

[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

Merged
merged 1 commit into from
May 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions llvm/include/llvm/TargetParser/Triple.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/IR/DataLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/MC/MCContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.");

Expand Down
3 changes: 2 additions & 1 deletion llvm/lib/MC/TargetRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/X86/X86MCInstLower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions llvm/lib/Target/X86/X86Subtarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
Expand Down