diff options
author | Adrian Prantl <aprantl@apple.com> | 2017-07-18 23:58:34 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2017-07-18 23:58:34 +0000 |
commit | 567034c3127eade5ba521dbe549a5e46365d6502 (patch) | |
tree | 4ea3a3399e9d1d8ab84edd47573882dd77498dbb /lib/CodeGen | |
parent | e3d7c4c2aa532933c6d5ae473548a434a02a06a2 (diff) |
Debug Info: Set the MainFileName when generating -gmodules debug info for PCM.
Previously it was uninitialized and thus always defaulted to "<stdin>".
This is mostly a cosmetic change that helps making the debug info more readable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308397 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/ObjectFilePCHContainerOperations.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/ObjectFilePCHContainerOperations.cpp b/lib/CodeGen/ObjectFilePCHContainerOperations.cpp index 37ecc05aa1..d0760b9cc2 100644 --- a/lib/CodeGen/ObjectFilePCHContainerOperations.cpp +++ b/lib/CodeGen/ObjectFilePCHContainerOperations.cpp @@ -152,6 +152,9 @@ public: CodeGenOpts.CodeModel = "default"; CodeGenOpts.ThreadModel = "single"; CodeGenOpts.DebugTypeExtRefs = true; + // When building a module MainFileName is the name of the modulemap file. + CodeGenOpts.MainFileName = + LangOpts.CurrentModule.empty() ? MainFileName : LangOpts.CurrentModule; CodeGenOpts.setDebugInfo(codegenoptions::FullDebugInfo); CodeGenOpts.setDebuggerTuning(CI.getCodeGenOpts().getDebuggerTuning()); } |