Duplicate .file in debug information when clang is called with full path

When compiling a trivial main.cpp with latest clang on Windows 7,

clang -S c:\llvm\test\main.cpp -g -std=c++1y -target i686-pc-mingw32

main.cpp appears twice in the debug information in the assembly file, once with back slash and once with forward slash:

.file 1 “c:\llvm\test/main.cpp”
.file 2 “c:\llvm\test\main.cpp”
.def _main;

compiling with MingW gcc results in one file only.


Hi Yaron,

Hi Hans,

By chance I found a solution and posted a patch to cfe-commits. Would the bug report still be useful?


Nah, the patch and resulting email thread is good enough for this :slight_smile: