summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2017-07-18 23:58:34 +0000
committerAdrian Prantl <aprantl@apple.com>2017-07-18 23:58:34 +0000
commit9a1a1aa2adf1f385adf8b15689808d8a73fc44ec (patch)
tree7bddec6a564c4807ba65383b1bf887f91f69e76f /clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
parentef54b49d165b22add5c0366725642acc6b81e753 (diff)
downloadbcm5719-llvm-9a1a1aa2adf1f385adf8b15689808d8a73fc44ec.tar.gz
bcm5719-llvm-9a1a1aa2adf1f385adf8b15689808d8a73fc44ec.zip
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. llvm-svn: 308397
Diffstat (limited to 'clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp')
-rw-r--r--clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
index 37ecc05aa1e..d0760b9cc2a 100644
--- a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
+++ b/clang/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());
}
OpenPOWER on IntegriCloud