[PATCH] D121299: [NVPTX] Disable DWARF .file directory for PTX
Andrew Savonichev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 9 08:30:56 PST 2022
asavonic created this revision.
asavonic added reviewers: tra, MaskRay.
Herald added subscribers: hiraditya, jholewinski.
Herald added a project: All.
asavonic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Default behavior for .file directory was changed in D105856 <https://reviews.llvm.org/D105856>, but ptxas
refuses to parse it:
.file 1 "/source/dir" "foo.h"
fatal: Parsing error near '"foo.h"': syntax error
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D121299
Files:
llvm/lib/MC/MCAsmStreamer.cpp
llvm/test/DebugInfo/NVPTX/dbg-declare-alloca.ll
llvm/test/DebugInfo/NVPTX/debug-file-loc-only.ll
llvm/test/DebugInfo/NVPTX/debug-file-loc.ll
llvm/test/DebugInfo/NVPTX/debug-loc-offset.ll
Index: llvm/test/DebugInfo/NVPTX/debug-loc-offset.ll
===================================================================
--- llvm/test/DebugInfo/NVPTX/debug-loc-offset.ll
+++ llvm/test/DebugInfo/NVPTX/debug-loc-offset.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=nvptx64-nvidia-cuda -dwarf-directory=0 < %s | FileCheck %s
+; RUN: llc -mtriple=nvptx64-nvidia-cuda < %s | FileCheck %s
; CHECK: .target sm_{{[0-9]+}}, debug
Index: llvm/test/DebugInfo/NVPTX/debug-file-loc.ll
===================================================================
--- llvm/test/DebugInfo/NVPTX/debug-file-loc.ll
+++ llvm/test/DebugInfo/NVPTX/debug-file-loc.ll
@@ -27,8 +27,8 @@
ret void, !dbg !11
}
-; CHECK-DAG: .file [[FOO]] "{{.*}}foo.h"
-; CHECK-DAG: .file [[BAR]] "{{.*}}bar.cu"
+; CHECK-DAG: .file [[FOO]] "/source/dir/foo.h"
+; CHECK-DAG: .file [[BAR]] "/source/dir/bar.cu"
; CHECK: .section .debug_abbrev
; CHECK-NEXT: {
; CHECK-NEXT: .b8 1 // Abbreviation Code
Index: llvm/test/DebugInfo/NVPTX/debug-file-loc-only.ll
===================================================================
--- llvm/test/DebugInfo/NVPTX/debug-file-loc-only.ll
+++ llvm/test/DebugInfo/NVPTX/debug-file-loc-only.ll
@@ -27,8 +27,8 @@
ret void, !dbg !11
}
-; CHECK-DAG: .file [[FOO]] "{{.*}}foo.h"
-; CHECK-DAG: .file [[BAR]] "{{.*}}bar.cu"
+; CHECK-DAG: .file [[FOO]] "/source/dir/foo.h"
+; CHECK-DAG: .file [[BAR]] "/source/dir/bar.cu"
; CHECK-NOT: .section .debug{{.*}}
Index: llvm/test/DebugInfo/NVPTX/dbg-declare-alloca.ll
===================================================================
--- llvm/test/DebugInfo/NVPTX/dbg-declare-alloca.ll
+++ llvm/test/DebugInfo/NVPTX/dbg-declare-alloca.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=nvptx64-nvidia-cuda -dwarf-directory=0 | FileCheck %s
+; RUN: llc < %s -mtriple=nvptx64-nvidia-cuda | FileCheck %s
; CHECK: .target sm_20, debug
Index: llvm/lib/MC/MCAsmStreamer.cpp
===================================================================
--- llvm/lib/MC/MCAsmStreamer.cpp
+++ llvm/lib/MC/MCAsmStreamer.cpp
@@ -1546,8 +1546,12 @@
SmallString<128> Str;
raw_svector_ostream OS1(Str);
+ bool UseDwarfDir = UseDwarfDirectory;
+ if (getContext().getDwarfVersion() < 5 && !MAI->useIntegratedAssembler())
+ UseDwarfDir = false;
+
printDwarfFileDirective(FileNo, Directory, Filename, Checksum, Source,
- UseDwarfDirectory, OS1);
+ UseDwarfDir, OS1);
if (MCTargetStreamer *TS = getTargetStreamer())
TS->emitDwarfFileDirective(OS1.str());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121299.414108.patch
Type: text/x-patch
Size: 2573 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220309/38f85846/attachment.bin>
More information about the llvm-commits
mailing list