Index: lib/CodeGen/CGDebugInfo.cpp =================================================================== --- lib/CodeGen/CGDebugInfo.cpp +++ lib/CodeGen/CGDebugInfo.cpp @@ -606,8 +606,7 @@ // file was specified with an absolute path. if (CSKind) CSInfo.emplace(*CSKind, Checksum); - llvm::DIFile *CUFile = DBuilder.createFile( - remapDIPath(MainFileName), remapDIPath(getCurrentDirname()), CSInfo, + llvm::DIFile *CUFile = createFile(MainFileName, CSInfo, getSource(SM, SM.getMainFileID())); // Create new compile unit. Index: test/CodeGenCXX/difile_entry.cpp =================================================================== --- test/CodeGenCXX/difile_entry.cpp +++ test/CodeGenCXX/difile_entry.cpp @@ -0,0 +1,13 @@ +// RUN: %clang -g %s -std=c++11 -S -emit-llvm -o - | FileCheck %s +class pr47391 +{ + public : + pr47391(void); + ~pr47391(); + +}; +static pr47391 pp; +// CHECK: !3 = !DIFile(filename: "{{.*}}", +// CHECK: !4 = !{} +// CHECK: !5 = !{!0} +// CHECK-NOT: !6 = !DIFile(filename: "{{.*}}",