Skip to content

Commit aa77f7a

Browse files
authored
[NFC][llvm] Drop isOsWindowsOrUEFI API (#138733)
The Triple and SubTarget API functions isOsWindowsOrUEFI is not preferred. Dropping them.
1 parent 097fef2 commit aa77f7a

File tree

7 files changed

+6
-10
lines changed

7 files changed

+6
-10
lines changed

llvm/include/llvm/TargetParser/Triple.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -659,9 +659,6 @@ class Triple {
659659
return getOS() == Triple::Win32;
660660
}
661661

662-
/// Tests whether the OS is Windows or UEFI.
663-
bool isOSWindowsOrUEFI() const { return isOSWindows() || isUEFI(); }
664-
665662
/// Checks if the environment is MSVC.
666663
bool isKnownWindowsMSVCEnvironment() const {
667664
return isOSWindows() && getEnvironment() == Triple::MSVC;

llvm/lib/IR/DataLayout.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ const char *DataLayout::getManglingComponent(const Triple &T) {
178178
return "-m:l";
179179
if (T.isOSBinFormatMachO())
180180
return "-m:o";
181-
if (T.isOSWindowsOrUEFI() && T.isOSBinFormatCOFF())
181+
if ((T.isOSWindows() || T.isUEFI()) && T.isOSBinFormatCOFF())
182182
return T.getArch() == Triple::x86 ? "-m:x" : "-m:w";
183183
if (T.isOSBinFormatXCOFF())
184184
return "-m:a";

llvm/lib/MC/MCContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ MCContext::MCContext(const Triple &TheTriple, const MCAsmInfo *mai,
8585
Env = IsMachO;
8686
break;
8787
case Triple::COFF:
88-
if (!TheTriple.isOSWindowsOrUEFI())
88+
if (!TheTriple.isOSWindows() && !TheTriple.isUEFI())
8989
report_fatal_error(
9090
"Cannot initialize MC for non-Windows COFF object files.");
9191

llvm/lib/MC/TargetRegistry.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ MCStreamer *Target::createMCObjectStreamer(
3232
case Triple::UnknownObjectFormat:
3333
llvm_unreachable("Unknown object format");
3434
case Triple::COFF:
35-
assert(T.isOSWindowsOrUEFI() && "only Windows and UEFI COFF are supported");
35+
assert((T.isOSWindows() || T.isUEFI()) &&
36+
"only Windows and UEFI COFF are supported");
3637
S = COFFStreamerCtorFn(Ctx, std::move(TAB), std::move(OW),
3738
std::move(Emitter));
3839
break;

llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ X86MCAsmInfoMicrosoftMASM::X86MCAsmInfoMicrosoftMASM(const Triple &Triple)
185185
void X86MCAsmInfoGNUCOFF::anchor() { }
186186

187187
X86MCAsmInfoGNUCOFF::X86MCAsmInfoGNUCOFF(const Triple &Triple) {
188-
assert(Triple.isOSWindowsOrUEFI() &&
188+
assert((Triple.isOSWindows() || Triple.isUEFI()) &&
189189
"Windows and UEFI are the only supported COFF targets");
190190
if (Triple.getArch() == Triple::x86_64) {
191191
PrivateGlobalPrefix = ".L";

llvm/lib/Target/X86/X86MCInstLower.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1709,7 +1709,7 @@ static void printZeroExtend(const MachineInstr *MI, MCStreamer &OutStreamer,
17091709

17101710
void X86AsmPrinter::EmitSEHInstruction(const MachineInstr *MI) {
17111711
assert(MF->hasWinCFI() && "SEH_ instruction in function without WinCFI?");
1712-
assert(getSubtarget().isOSWindowsOrUEFI() &&
1712+
assert((getSubtarget().isOSWindows() || getSubtarget().isUEFI()) &&
17131713
"SEH_ instruction Windows and UEFI only");
17141714

17151715
// Use the .cv_fpo directives if we're emitting CodeView on 32-bit x86.

llvm/lib/Target/X86/X86Subtarget.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,6 @@ class X86Subtarget final : public X86GenSubtargetInfo {
331331

332332
bool isOSWindows() const { return TargetTriple.isOSWindows(); }
333333

334-
bool isOSWindowsOrUEFI() const { return TargetTriple.isOSWindowsOrUEFI(); }
335-
336334
bool isTargetUEFI64() const { return Is64Bit && isUEFI(); }
337335

338336
bool isTargetWin64() const { return Is64Bit && isOSWindows(); }

0 commit comments

Comments
 (0)