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 | 9a1a1aa2adf1f385adf8b15689808d8a73fc44ec (patch) | |
tree | 7bddec6a564c4807ba65383b1bf887f91f69e76f | |
parent | ef54b49d165b22add5c0366725642acc6b81e753 (diff) | |
download | bcm5719-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
-rw-r--r-- | clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp | 3 | ||||
-rw-r--r-- | clang/test/Modules/ModuleDebugInfo.m | 6 |
2 files changed, 7 insertions, 2 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()); } diff --git a/clang/test/Modules/ModuleDebugInfo.m b/clang/test/Modules/ModuleDebugInfo.m index d1a0e8d5e80..9289abe0808 100644 --- a/clang/test/Modules/ModuleDebugInfo.m +++ b/clang/test/Modules/ModuleDebugInfo.m @@ -23,8 +23,10 @@ @import DebugObjC; #endif -// CHECK: distinct !DICompileUnit(language: DW_LANG_ObjC -// CHECK-SAME: isOptimized: false, +// CHECK: distinct !DICompileUnit(language: DW_LANG_ObjC, file: ![[FILE:[0-9]+]], +// CHECK-SAME: isOptimized: false + +// CHECK: ![[FILE]] = !DIFile(filename: "{{DebugObjC|.*DebugObjC.h}}" // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, // CHECK-SAME: scope: ![[MODULE:[0-9]+]], |