diff options
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index c0819369b1..45ceb2b8e6 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -74,6 +74,12 @@ llvm::DICompileUnit CGDebugInfo::getOrCreateCompileUnit(SourceLocation Loc) { const char *DirName = FE ? FE->getDir()->getName() : "<unknown>"; const LangOptions &LO = M->getLangOptions(); + + // If this is the main file, use the user provided main file name if + // specified. + if (isMain && LO.getMainFileName()) + FileName = LO.getMainFileName(); + unsigned LangTag; if (LO.CPlusPlus) { if (LO.ObjC1) |