From 9a1a1aa2adf1f385adf8b15689808d8a73fc44ec Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Tue, 18 Jul 2017 23:58:34 +0000 Subject: Debug Info: Set the MainFileName when generating -gmodules debug info for PCM. Previously it was uninitialized and thus always defaulted to "". This is mostly a cosmetic change that helps making the debug info more readable. llvm-svn: 308397 --- clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib/CodeGen') 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()); } -- cgit v1.2.3