diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 29f597112c1c7b71ca21f394c164a84fcf386971..a98df93a042dc902af05800b17030de08f0e4bc4 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -3505,6 +3505,8 @@ void CGDebugInfo::EmitUsingDecl(const UsingDecl &UD) { } void CGDebugInfo::EmitImportDecl(const ImportDecl &ID) { + if (CGM.getCodeGenOpts().getDebuggerTuning() != llvm::DebuggerKind::LLDB) + return; if (Module *M = ID.getImportedModule()) { auto Info = ExternalASTSource::ASTSourceDescriptor(*M); DBuilder.createImportedDeclaration( diff --git a/lib/CodeGen/ObjectFilePCHContainerOperations.cpp b/lib/CodeGen/ObjectFilePCHContainerOperations.cpp index d609cf2648ae1d8f19fbee2ac3c0aaafaccbda86..2fa390279a22616fff46e4216a2147e86485826e 100644 --- a/lib/CodeGen/ObjectFilePCHContainerOperations.cpp +++ b/lib/CodeGen/ObjectFilePCHContainerOperations.cpp @@ -152,6 +152,7 @@ public: CodeGenOpts.ThreadModel = "single"; CodeGenOpts.DebugTypeExtRefs = true; CodeGenOpts.setDebugInfo(codegenoptions::FullDebugInfo); + CodeGenOpts.setDebuggerTuning(CI.getCodeGenOpts().getDebuggerTuning()); } ~PCHContainerGenerator() override = default; diff --git a/test/Modules/DebugInfoSubmoduleImport.c b/test/Modules/DebugInfoSubmoduleImport.c index 9fb5d9c6d5c95a8178f1a1ea55fc2aa245f7b523..1b31aada9c6a205bd6a81da25f5d5b961dcd7034 100644 --- a/test/Modules/DebugInfoSubmoduleImport.c +++ b/test/Modules/DebugInfoSubmoduleImport.c @@ -1,7 +1,7 @@ // RUN: rm -rf %t // RUN: %clang_cc1 -fmodules -fmodule-format=obj -debug-info-kind=limited -dwarf-ext-refs \ // RUN: -fimplicit-module-maps -x c -fmodules-cache-path=%t -I %S/Inputs \ -// RUN: %s -emit-llvm -o - | FileCheck %s +// RUN: %s -emit-llvm -debugger-tuning=lldb -o - | FileCheck %s #include "DebugSubmoduleA.h" #include "DebugSubmoduleB.h" diff --git a/test/Modules/DebugInfoTransitiveImport.m b/test/Modules/DebugInfoTransitiveImport.m index 206be2e42e92c572b19ef29c8047f6a336bf6e4e..034a909333cd87d86ef4942af357583cc45d043c 100644 --- a/test/Modules/DebugInfoTransitiveImport.m +++ b/test/Modules/DebugInfoTransitiveImport.m @@ -1,7 +1,7 @@ // RUN: rm -rf %t // RUN: %clang_cc1 -fmodules -fmodule-format=obj -debug-info-kind=limited -dwarf-ext-refs \ // RUN: -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs \ -// RUN: %s -mllvm -debug-only=pchcontainer 2>&1 | FileCheck %s +// RUN: %s -mllvm -debug-only=pchcontainer -debugger-tuning=lldb 2>&1 | FileCheck %s // REQUIRES: asserts @import diamond_left; @@ -20,3 +20,9 @@ // Skeleton for top: // CHECK: !DICompileUnit({{.*}}splitDebugFilename: {{.*}}diamond_top{{.*}}dwoId: +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodules -fmodule-format=obj -debug-info-kind=limited -dwarf-ext-refs \ +// RUN: -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs \ +// RUN: %s -mllvm -debug-only=pchcontainer 2>&1 | FileCheck %s --check-prefix=NOIMPORT + +// NOIMPORT-NOT: !DIImportedEntity diff --git a/test/Modules/debug-info-moduleimport.m b/test/Modules/debug-info-moduleimport.m index bb0ea3149efbc1f5421bca8465fa454c878a3ed9..bf60690be40bd507e034bbf0c6d40a95b2bcae77 100644 --- a/test/Modules/debug-info-moduleimport.m +++ b/test/Modules/debug-info-moduleimport.m @@ -1,10 +1,16 @@ // RUN: rm -rf %t -// RUN: %clang_cc1 -debug-info-kind=limited -fmodules -DGREETING="Hello World" -UNDEBUG -fimplicit-module-maps -fmodules-cache-path=%t %s -I %S/Inputs -isysroot /tmp/.. -I %t -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -debug-info-kind=limited -fmodules -DGREETING="Hello World" -UNDEBUG -fimplicit-module-maps -fmodules-cache-path=%t %s -I %S/Inputs -isysroot /tmp/.. -I %t -emit-llvm -o - | FileCheck %s --check-prefix=NOIMPORT + +// NOIMPORT-NOT: !DIImportedEntity +// NOIMPORT-NOT: !DIModule + +// RUN: rm -rf %t +// RUN: %clang_cc1 -debug-info-kind=limited -fmodules -DGREETING="Hello World" -UNDEBUG -fimplicit-module-maps -fmodules-cache-path=%t %s -I %S/Inputs -isysroot /tmp/.. -I %t -emit-llvm -debugger-tuning=lldb -o - | FileCheck %s // CHECK: ![[CU:.*]] = distinct !DICompileUnit @import DebugObjC; // CHECK: !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: ![[CU]], -// CHECK-SAME: entity: ![[MODULE:.*]], line: 5) +// CHECK-SAME: entity: ![[MODULE:.*]], line: [[@LINE-2]]) // CHECK: ![[MODULE]] = !DIModule(scope: null, name: "DebugObjC", // CHECK-SAME: configMacros: "\22-DGREETING=Hello World\22 \22-UNDEBUG\22", // CHECK-SAME: includePath: "{{.*}}test{{.*}}Modules{{.*}}Inputs", diff --git a/test/Modules/getSourceDescriptor-crash.cpp b/test/Modules/getSourceDescriptor-crash.cpp index ebc25c0b1256bb988442019173b86fcb63d24e26..84e527aef91b5fe45f366d35e3d044851ee92aee 100644 --- a/test/Modules/getSourceDescriptor-crash.cpp +++ b/test/Modules/getSourceDescriptor-crash.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -I %S/Inputs/getSourceDescriptor-crash -S -emit-llvm -debug-info-kind=limited -fimplicit-module-maps %s -o - | FileCheck %s +// RUN: %clang_cc1 -I %S/Inputs/getSourceDescriptor-crash -S -emit-llvm -debug-info-kind=limited -debugger-tuning=lldb -fimplicit-module-maps %s -o - | FileCheck %s #include "h1.h" #include "h1.h"