Skip to content

Commit a231474

Browse files
Merge pull request swiftlang#74623 from adrian-prantl/126688061-6.0
Fix a regression that caused the compiler to drop the path names of g…
2 parents 296af88 + 07138e4 commit a231474

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
324324
}
325325
}
326326
Cached.File = getOrCreateFile(
327-
SM.getDisplayNameForLoc(SL, !ForceGeneratedSourceToDisk), Source);
327+
SM.getDisplayNameForLoc(SL, ForceGeneratedSourceToDisk), Source);
328328
std::tie(Cached.Line, Cached.Column) =
329329
SM.getPresumedLineAndColumnForLoc(SL);
330330
// When WinDbg finds two locations with the same line but different

lib/SILGen/SILGenFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ const SILDebugScope *SILGenFunction::getMacroScope(SourceLoc SLoc) {
372372
TopLevelScope = It->second;
373373
else {
374374
// Recursively create one inlined function + scope per layer of generated
375-
// sources. Chains of Macro expansions are representad as flat
375+
// sources. Chains of Macro expansions are represented as flat
376376
// function-level scopes.
377377
SILGenFunctionBuilder B(SGM);
378378
auto &ASTContext = SGM.M.getASTContext();

test/Macros/macro_expand.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
// RUN: %target-swift-frontend -swift-version 5 -emit-sil -load-plugin-library %t/%target-library-name(MacroDefinition) %s -module-name MacroUser -o - -g | %FileCheck --check-prefix CHECK-SIL %s
2525

2626
// Debug info IR testing
27+
// RUN: %target-swift-frontend -swift-version 5 -dwarf-version=4 -emit-ir -load-plugin-library %t/%target-library-name(MacroDefinition) %s -module-name MacroUser -o - -g | %FileCheck --check-prefix CHECK-IR-DWARF4 %s
2728
// RUN: %target-swift-frontend -swift-version 5 -dwarf-version=5 -emit-ir -load-plugin-library %t/%target-library-name(MacroDefinition) %s -module-name MacroUser -o - -g | %FileCheck --check-prefix CHECK-IR %s
2829

2930
// Execution testing
@@ -71,7 +72,7 @@ struct MemberNotCovered {
7172
// expected-note@-1 {{in expansion of macro 'NotCovered' here}}
7273

7374
// CHECK-DIAGS: error: declaration name 'value' is not covered by macro 'NotCovered'
74-
// CHECK-DIAGS: CONTENTS OF FILE @__swiftmacro_9MacroUser0023macro_expandswift_elFCffMX69_2_33_4361AD9339943F52AE6186DD51E04E91Ll10NotCoveredfMf_.swift
75+
// CHECK-DIAGS: CONTENTS OF FILE @__swiftmacro_9MacroUser0023macro_expandswift_elFCffMX70_2_33_4361AD9339943F52AE6186DD51E04E91Ll10NotCoveredfMf_.swift
7576
// CHECK-DIAGS: var value: Int
7677
// CHECK-DIAGS: END CONTENTS OF FILE
7778
}
@@ -163,9 +164,10 @@ func testFileID(a: Int, b: Int) {
163164
// CHECK-AST: macro_expansion_expr type='String'{{.*}}name=line
164165
print("Builtin result is \(#fileID)")
165166
print(
166-
// CHECK-IR-DAG: ![[L1:[0-9]+]] = distinct !DILocation(line: [[@LINE+3]], column: 5
167+
// CHECK-IR-DAG: ![[L1:[0-9]+]] = distinct !DILocation(line: [[@LINE+4]], column: 5
167168
// CHECK-IR-DAG: ![[L2:[0-9]+]] = distinct !DILocation({{.*}}inlinedAt: ![[L1]])
168169
// CHECK-IR-DAG: !DIFile(filename: "{{.*}}@__swiftmacro_9MacroUser0023macro_expandswift_elFCffMX{{.*}}_12customFileIDfMf_.swift", {{.*}}source: "{{.*}}MacroUser/macro_expand.swift{{.*}}// original-source-range: {{.*}}")
170+
// CHECK-IR-DWARF4: {{(target triple = .*-unknown-windows-msvc)|(!DIFile\(filename: ".*generated-.*@__swiftmacro_9MacroUser0023macro_expandswift_elFCffMX.*_12customFileIDfMf_.swift", directory: ""\))}}
169171
#addBlocker(
170172
#stringify(a - b)
171173
)

0 commit comments

Comments
 (0)