Skip to content

Commit df957f3

Browse files
committed
simplify isUEFI triple checks
1 parent edb715e commit df957f3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

llvm/include/llvm/TargetParser/Triple.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,10 @@ class Triple {
636636
return getOS() == Triple::Win32;
637637
}
638638

639+
bool isOSWindowsOrUEFI() const {
640+
return isOSWindows() || isUEFI();
641+
}
642+
639643
/// Checks if the environment is MSVC.
640644
bool isKnownWindowsMSVCEnvironment() const {
641645
return isOSWindows() && getEnvironment() == Triple::MSVC;

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ bool AsmPrinter::doInitialization(Module &M) {
560560

561561
if (MAI->doesSupportDebugInformation()) {
562562
bool EmitCodeView = M.getCodeViewFlag();
563-
if (EmitCodeView && (TM.getTargetTriple().isOSWindows() || TM.getTargetTriple().isUEFI()))
563+
if (EmitCodeView && TM.getTargetTriple().isOSWindowsOrUEFI())
564564
DebugHandlers.push_back(std::make_unique<CodeViewDebug>(this));
565565
if (!EmitCodeView || M.getDwarfVersion()) {
566566
if (hasDebugInfo()) {
@@ -4070,7 +4070,7 @@ const MCExpr *AsmPrinter::lowerBlockAddressConstant(const BlockAddress &BA) {
40704070

40714071
/// GetCPISymbol - Return the symbol for the specified constant pool entry.
40724072
MCSymbol *AsmPrinter::GetCPISymbol(unsigned CPID) const {
4073-
if (getSubtargetInfo().getTargetTriple().isWindowsMSVCEnvironment() || getSubtargetInfo().getTargetTriple().isUEFI()) {
4073+
if (getSubtargetInfo().getTargetTriple().isWindowsMSVCEnvironment()) {
40744074
const MachineConstantPoolEntry &CPE =
40754075
MF->getConstantPool()->getConstants()[CPID];
40764076
if (!CPE.isMachineConstantPoolEntry()) {

0 commit comments

Comments
 (0)