Author: hans Date: Tue Jan 16 06:55:42 2018 New Revision: 322557 URL: http://llvm.org/viewvc/llvm-project?rev=322557&view=rev Log: Merging r321754: ------------------------------------------------------------------------ r321754 | adrian | 2018-01-03 11:10:21 -0800 (Wed, 03 Jan 2018) | 9 lines
-gmodules: Emit debug info for implicit module imports via #include. When a type is only used as a template parameter and that type is the only type imported from another #include'd module, no skeleton CU for that module is generated, so a consumer doesn't know where to find the type definition. By emitting an import declaration, we can force a skeleton CU to be generated for each imported module. rdar://problem/36266156 ------------------------------------------------------------------------ Modified: cfe/branches/release_60/ (props changed) cfe/branches/release_60/lib/CodeGen/ObjectFilePCHContainerOperations.cpp cfe/branches/release_60/test/Modules/ExtDebugInfo.cpp cfe/branches/release_60/test/Modules/Inputs/DebugCXX.h cfe/branches/release_60/test/Modules/ModuleDebugInfo.cpp Propchange: cfe/branches/release_60/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Jan 16 06:55:42 2018 @@ -1,4 +1,4 @@ /cfe/branches/type-system-rewrite:134693-134817 -/cfe/trunk:321771,321933,322518 +/cfe/trunk:321754,321771,321933,322518 /cfe/trunk/test:170344 /cfe/trunk/test/SemaTemplate:126920 Modified: cfe/branches/release_60/lib/CodeGen/ObjectFilePCHContainerOperations.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_60/lib/CodeGen/ObjectFilePCHContainerOperations.cpp?rev=322557&r1=322556&r2=322557&view=diff ============================================================================== --- cfe/branches/release_60/lib/CodeGen/ObjectFilePCHContainerOperations.cpp (original) +++ cfe/branches/release_60/lib/CodeGen/ObjectFilePCHContainerOperations.cpp Tue Jan 16 06:55:42 2018 @@ -229,6 +229,11 @@ public: Builder->getModuleDebugInfo()->completeRequiredType(RD); } + void HandleImplicitImportDecl(ImportDecl *D) override { + if (!D->getImportedOwningModule()) + Builder->getModuleDebugInfo()->EmitImportDecl(*D); + } + /// Emit a container holding the serialized AST. void HandleTranslationUnit(ASTContext &Ctx) override { assert(M && VMContext && Builder); Modified: cfe/branches/release_60/test/Modules/ExtDebugInfo.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_60/test/Modules/ExtDebugInfo.cpp?rev=322557&r1=322556&r2=322557&view=diff ============================================================================== --- cfe/branches/release_60/test/Modules/ExtDebugInfo.cpp (original) +++ cfe/branches/release_60/test/Modules/ExtDebugInfo.cpp Tue Jan 16 06:55:42 2018 @@ -187,7 +187,7 @@ void foo() { // CHECK: !DIGlobalVariable(name: "anon_enum", {{.*}}, type: ![[ANON_ENUM:[0-9]+]] // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, scope: ![[NS]], -// CHECK-SAME: line: 16 +// CHECK-SAME: line: 19 // CHECK: !DIGlobalVariable(name: "GlobalUnion", // CHECK-SAME: type: ![[GLOBAL_UNION:[0-9]+]] Modified: cfe/branches/release_60/test/Modules/Inputs/DebugCXX.h URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_60/test/Modules/Inputs/DebugCXX.h?rev=322557&r1=322556&r2=322557&view=diff ============================================================================== --- cfe/branches/release_60/test/Modules/Inputs/DebugCXX.h (original) +++ cfe/branches/release_60/test/Modules/Inputs/DebugCXX.h Tue Jan 16 06:55:42 2018 @@ -1,4 +1,7 @@ /* -*- C++ -*- */ + +#include "dummy.h" + namespace DebugCXX { // Records. struct Struct { Modified: cfe/branches/release_60/test/Modules/ModuleDebugInfo.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_60/test/Modules/ModuleDebugInfo.cpp?rev=322557&r1=322556&r2=322557&view=diff ============================================================================== --- cfe/branches/release_60/test/Modules/ModuleDebugInfo.cpp (original) +++ cfe/branches/release_60/test/Modules/ModuleDebugInfo.cpp Tue Jan 16 06:55:42 2018 @@ -5,12 +5,13 @@ // Modules: // RUN: rm -rf %t -// RUN: %clang_cc1 -triple %itanium_abi_triple -x objective-c++ -std=c++11 -debug-info-kind=limited -fmodules -fmodule-format=obj -fimplicit-module-maps -DMODULES -fmodules-cache-path=%t %s -I %S/Inputs -I %t -emit-llvm -o %t.ll -mllvm -debug-only=pchcontainer &>%t-mod.ll +// RUN: %clang_cc1 -triple %itanium_abi_triple -x objective-c++ -std=c++11 -debugger-tuning=lldb -debug-info-kind=limited -fmodules -fmodule-format=obj -fimplicit-module-maps -DMODULES -fmodules-cache-path=%t %s -I %S/Inputs -I %t -emit-llvm -o %t.ll -mllvm -debug-only=pchcontainer &>%t-mod.ll // RUN: cat %t-mod.ll | FileCheck %s // RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-NEG %s +// RUN: cat %t-mod.ll | FileCheck --check-prefix=CHECK-MOD %s // PCH: -// RUN: %clang_cc1 -triple %itanium_abi_triple -x c++ -std=c++11 -emit-pch -fmodule-format=obj -I %S/Inputs -o %t.pch %S/Inputs/DebugCXX.h -mllvm -debug-only=pchcontainer &>%t-pch.ll +// RUN: %clang_cc1 -triple %itanium_abi_triple -x c++ -std=c++11 -debugger-tuning=lldb -emit-pch -fmodule-format=obj -I %S/Inputs -o %t.pch %S/Inputs/DebugCXX.h -mllvm -debug-only=pchcontainer &>%t-pch.ll // RUN: cat %t-pch.ll | FileCheck %s // RUN: cat %t-pch.ll | FileCheck --check-prefix=CHECK-NEG %s @@ -18,6 +19,9 @@ @import DebugCXX; #endif +// CHECK-MOD: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus, +// CHECK-MOD: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus, + // CHECK: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus, // CHECK-SAME: isOptimized: false, // CHECK-NOT: splitDebugFilename: @@ -27,6 +31,8 @@ // CHECK-SAME: identifier: "_ZTSN8DebugCXX4EnumE") // CHECK: !DINamespace(name: "DebugCXX" +// CHECK-MOD: ![[DEBUGCXX:.*]] = !DIModule(scope: null, name: "DebugCXX + // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, // CHECK-NOT: name: // CHECK-SAME: ) @@ -150,4 +156,11 @@ // CHECK-SAME: name: "WithSpecializedBase<float>", // CHECK-SAME: flags: DIFlagFwdDecl, +// CHECK-MOD: !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: ![[DEBUGCXX]], +// CHECK-MOD-SAME: entity: ![[DUMMY:[0-9]+]], +// CHECK-MOD-SAME: line: 3) +// CHECK-MOD: ![[DUMMY]] = !DIModule(scope: null, name: "dummy", +// CHECK-MOD: distinct !DICompileUnit(language: DW_LANG_ObjC_plus_plus, +// CHECK-MOD-SAME: splitDebugFilename: "{{.*}}dummy{{.*}}.pcm", + // CHECK-NEG-NOT: !DICompositeType(tag: DW_TAG_structure_type, name: "PureForwardDecl" _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits