Skip to content

Commit bfdc8d6

Browse files
committed
Add hidden switch for testing purposes
1 parent 0609233 commit bfdc8d6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

llvm/lib/MC/MCContext.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959

6060
using namespace llvm;
6161

62+
cl::opt<bool> ForceDWARFWindowsPathSeps ("force-dwarf-windows-path-seps",
63+
cl::desc("Use Windows path separators when building DWARF linetables"),
64+
cl::Hidden);
65+
6266
static void defaultDiagHandler(const SMDiagnostic &SMD, bool, const SourceMgr &,
6367
std::vector<const MDNode *> &) {
6468
SMD.print(nullptr, errs());
@@ -77,7 +81,7 @@ MCContext::MCContext(const Triple &TheTriple, const MCAsmInfo *mai,
7781
SaveTempLabels = TargetOptions && TargetOptions->MCSaveTempLabels;
7882
SecureLogFile = TargetOptions ? TargetOptions->AsSecureLogFile : "";
7983

80-
if (TheTriple.isPS())
84+
if (ForceDWARFWindowsPathSeps || TheTriple.isPS())
8185
PathStyle = llvm::sys::path::Style::windows;
8286

8387
if (SrcMgr && SrcMgr->getNumBuffers())

llvm/test/DebugInfo/dir-table-path-separators.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
; RUN: llc %s -o - -filetype=obj -mtriple x86_64-pc-linux-gnu | llvm-dwarfdump - --debug-line | FileCheck %s --check-prefix=LINUX
2+
; RUN: llc %s -o - -filetype=obj -mtriple x86_64-pc-linux-gnu -force-dwarf-windows-path-seps=true | llvm-dwarfdump - --debug-line | FileCheck %s --check-prefix=PS5
23
; RUN: llc %s -o - -filetype=obj -mtriple x86_64-sie-ps5 | llvm-dwarfdump - --debug-line | FileCheck %s --check-prefix=PS5
34
;
45
; UNSUPPORTED: system-windows

0 commit comments

Comments
 (0)