Skip to content

Commit edb715e

Browse files
committed
ASMPrinter and Mangler fixes.
1 parent f295cec commit edb715e

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

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())
563+
if (EmitCodeView && (TM.getTargetTriple().isOSWindows() || TM.getTargetTriple().isUEFI()))
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()) {
4073+
if (getSubtargetInfo().getTargetTriple().isWindowsMSVCEnvironment() || getSubtargetInfo().getTargetTriple().isUEFI()) {
40744074
const MachineConstantPoolEntry &CPE =
40754075
MF->getConstantPool()->getConstants()[CPID];
40764076
if (!CPE.isMachineConstantPoolEntry()) {

llvm/lib/IR/Mangler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ void llvm::emitLinkerFlagsForGlobalCOFF(raw_ostream &OS, const GlobalValue *GV,
223223
bool NeedQuotes = GV->hasName() && !canBeUnquotedInDirective(GV->getName());
224224
if (NeedQuotes)
225225
OS << "\"";
226-
if (TT.isWindowsGNUEnvironment() || TT.isWindowsCygwinEnvironment()) {
226+
if (TT.isWindowsGNUEnvironment() || TT.isWindowsCygwinEnvironment() || TT.isUEFI()) {
227227
std::string Flag;
228228
raw_string_ostream FlagOS(Flag);
229229
Mangler.getNameWithPrefix(FlagOS, GV, false);
@@ -249,7 +249,7 @@ void llvm::emitLinkerFlagsForGlobalCOFF(raw_ostream &OS, const GlobalValue *GV,
249249
OS << "\"";
250250

251251
if (!GV->getValueType()->isFunctionTy()) {
252-
if (TT.isWindowsMSVCEnvironment())
252+
if (TT.isWindowsMSVCEnvironment() || TT.isUEFI())
253253
OS << ",DATA";
254254
else
255255
OS << ",data";

llvm/lib/Target/X86/X86AsmPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ static void emitNonLazyStubs(MachineModuleInfo *MMI, MCStreamer &OutStreamer) {
985985
/// selected floating-point instructions.
986986
static bool usesMSVCFloatingPoint(const Triple &TT, const Module &M) {
987987
// Only needed for MSVC
988-
if (!TT.isWindowsMSVCEnvironment())
988+
if (!TT.isWindowsMSVCEnvironment() || !TT.isUEFI())
989989
return false;
990990

991991
for (const Function &F : M) {

llvm/lib/Target/X86/X86Subtarget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ class X86Subtarget final : public X86GenSubtargetInfo {
325325

326326
bool isTargetUEFI64() const { return Is64Bit && isUEFI(); }
327327

328-
bool isTargetWin64() const { return Is64Bit && (isOSWindows() || isUEFI()); }
328+
bool isTargetWin64() const { return Is64Bit && isOSWindows(); }
329329

330330
bool isTargetWin32() const { return !Is64Bit && isOSWindows(); }
331331

0 commit comments

Comments
 (0)