Skip to content

Commit eec6559

Browse files
committed
---
yaml --- r: 349545 b: refs/heads/master-next c: ffb338e h: refs/heads/master i: 349543: 7f2e8b3
1 parent d3896b0 commit eec6559

File tree

4 files changed

+27
-10
lines changed

4 files changed

+27
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 3574c513bbc5578dd9346b4ea9ab5995c5927bb5
3-
refs/heads/master-next: ff12d20a1d8e14fcb31605daa0a9194a84894ac0
3+
refs/heads/master-next: ffb338e8b1459b62911aca9110d294929e03b09b
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
66
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07

branches/master-next/lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,15 +1601,19 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
16011601
auto Idx = ClangDecl->getOwningModuleID();
16021602
auto SubModuleDesc = Reader.getSourceDescriptor(Idx);
16031603
auto TopLevelModuleDesc = getClangModule(*TypeDecl->getModuleContext());
1604-
if (SubModuleDesc && TopLevelModuleDesc) {
1605-
// Describe the submodule, but substitute the cached ASTFile from
1606-
// the toplevel module. The ASTFile pointer in SubModule may be
1607-
// dangling and cant be trusted.
1608-
Scope = getOrCreateModule({SubModuleDesc->getModuleName(),
1609-
SubModuleDesc->getPath(),
1610-
TopLevelModuleDesc->getASTFile(),
1611-
TopLevelModuleDesc->getSignature()},
1612-
SubModuleDesc->getModuleOrNull());
1604+
if (SubModuleDesc) {
1605+
if (TopLevelModuleDesc)
1606+
// Describe the submodule, but substitute the cached ASTFile from
1607+
// the toplevel module. The ASTFile pointer in SubModule may be
1608+
// dangling and cant be trusted.
1609+
Scope = getOrCreateModule({SubModuleDesc->getModuleName(),
1610+
SubModuleDesc->getPath(),
1611+
TopLevelModuleDesc->getASTFile(),
1612+
TopLevelModuleDesc->getSignature()},
1613+
SubModuleDesc->getModuleOrNull());
1614+
else if (SubModuleDesc->getModuleOrNull() == nullptr)
1615+
// This is (bridging header) PCH.
1616+
Scope = getOrCreateModule(*SubModuleDesc, nullptr);
16131617
}
16141618
}
16151619
if (!Scope)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: %target-swift-frontend \
2+
// RUN: -emit-pch %S/Inputs/BridgingHeader.h -o %t.pch
3+
// RUN: %target-swift-frontend \
4+
// RUN: -import-objc-header %t.pch -emit-ir -g %s -o - | %FileCheck %s
5+
6+
// CHECK: !DIModule(scope: null, name: "BridgingHeader.h",
7+
// CHECK: !DICompileUnit(language: DW_LANG_{{ObjC|C99}},{{.*}}splitDebugFilename:
8+
// CHECK-SAME: dwoId:
9+
10+
public let p = Point(x: 1, y: 2)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
struct Point {
2+
int x, y;
3+
};

0 commit comments

Comments
 (0)