Skip to content

Commit dbcfc43

Browse files
authored
[llvm][AsmPrinter] CodeView for UEFI (#138359)
1 parent ce69a60 commit dbcfc43

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,8 @@ bool AsmPrinter::doInitialization(Module &M) {
561561

562562
if (MAI->doesSupportDebugInformation()) {
563563
bool EmitCodeView = M.getCodeViewFlag();
564-
if (EmitCodeView && TM.getTargetTriple().isOSWindows())
564+
if (EmitCodeView &&
565+
(TM.getTargetTriple().isOSWindows() || TM.getTargetTriple().isUEFI()))
565566
Handlers.push_back(std::make_unique<CodeViewDebug>(this));
566567
if (!EmitCodeView || M.getDwarfVersion()) {
567568
if (hasDebugInfo()) {

llvm/test/DebugInfo/COFF/asm.ll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -o - -O0 < %s | llvm-mc -triple=i686-pc-win32 -filetype=obj | llvm-readobj -S --sr --codeview - | FileCheck --check-prefix=OBJ32 %s
33
; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32 -O0 < %s | FileCheck --check-prefix=X64 %s
44
; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32 -o - -O0 < %s | llvm-mc -triple=x86_64-pc-win32 -filetype=obj | llvm-readobj -S --sr --codeview - | FileCheck --check-prefix=OBJ64 %s
5+
; RUN: llc -mcpu=core2 -mtriple=x86_64-uefi -O0 < %s | FileCheck --check-prefix=X64 %s
6+
; RUN: llc -mcpu=core2 -mtriple=x86_64-uefi -o - -O0 < %s | llvm-mc -triple=x86_64-pc-win32 -filetype=obj | llvm-readobj -S --sr --codeview - | FileCheck --check-prefix=OBJ64 %s
57

68
; This LL file was generated by running clang on the following code:
79
; D:\asm.c:

0 commit comments

Comments
 (0)