Skip to content

Commit bc2bb5b

Browse files
authored
Merge pull request #62771 from eeckstein/debug-info
Some small debug-info fixes
2 parents d3c3d87 + 0c6f0bb commit bc2bb5b

21 files changed

+79
-60
lines changed

include/swift/AST/Expr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ class IntegerLiteralExpr : public NumberLiteralExpr {
741741
/// \p value The integer value.
742742
/// \return An implicit integer literal expression which evaluates to the value.
743743
static IntegerLiteralExpr *
744-
createFromUnsigned(ASTContext &C, unsigned value);
744+
createFromUnsigned(ASTContext &C, unsigned value, SourceLoc loc);
745745

746746
/// Returns the value of the literal, appropriately constructed in the
747747
/// target type.

include/swift/SIL/SILBuilder.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,10 @@ class SILBuilder {
263263
bool hasValidInsertionPoint() const { return BB != nullptr; }
264264
SILBasicBlock *getInsertionBB() const { return BB; }
265265
SILBasicBlock::iterator getInsertionPoint() const { return InsertPt; }
266-
SILLocation getInsertionPointLoc() const { return InsertPt->getLoc(); }
266+
SILLocation getInsertionPointLoc() const {
267+
assert(!insertingAtEndOfBlock());
268+
return InsertPt->getLoc();
269+
}
267270

268271
/// insertingAtEndOfBlock - Return true if the insertion point is at the end
269272
/// of the current basic block. False if we're inserting before an existing

lib/AST/Expr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,11 +1039,11 @@ StringRef LiteralExpr::getLiteralKindDescription() const {
10391039
llvm_unreachable("Unhandled literal");
10401040
}
10411041

1042-
IntegerLiteralExpr * IntegerLiteralExpr::createFromUnsigned(ASTContext &C, unsigned value) {
1042+
IntegerLiteralExpr * IntegerLiteralExpr::createFromUnsigned(ASTContext &C, unsigned value, SourceLoc loc) {
10431043
llvm::SmallString<8> Scratch;
10441044
llvm::APInt(sizeof(unsigned)*8, value).toString(Scratch, 10, /*signed*/ false);
10451045
auto Text = C.AllocateCopy(StringRef(Scratch));
1046-
return new (C) IntegerLiteralExpr(Text, SourceLoc(), /*implicit*/ true);
1046+
return new (C) IntegerLiteralExpr(Text, loc, /*implicit*/ true);
10471047
}
10481048

10491049
APInt IntegerLiteralExpr::getRawValue() const {

lib/SIL/IR/SILPrinter.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,10 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
10121012
if (!DL.filename.empty()) {
10131013
if (PrintComma)
10141014
*this << ", ";
1015-
*this << "loc " << QuotedString(DL.filename) << ':' << DL.line << ':'
1015+
*this << "loc ";
1016+
if (Loc.isAutoGenerated())
1017+
*this << "* ";
1018+
*this << QuotedString(DL.filename) << ':' << DL.line << ':'
10161019
<< (unsigned)DL.column;
10171020
}
10181021
}
@@ -3012,7 +3015,14 @@ void SILFunction::print(SILPrintContext &PrintCtx) const {
30123015
}
30133016
}
30143017

3015-
OS << "// " << demangleSymbol(getName()) << '\n';
3018+
OS << "// " << demangleSymbol(getName());
3019+
if (PrintCtx.printDebugInfo()) {
3020+
auto &SM = getModule().getASTContext().SourceMgr;
3021+
SILPrinter P(PrintCtx);
3022+
P.printDebugLocRef(getLocation(), SM);
3023+
P.printDebugScopeRef(getDebugScope(), SM);
3024+
}
3025+
OS << '\n';
30163026
printClangQualifiedNameCommentIfPresent(OS, getClangDecl());
30173027

30183028
OS << "sil ";

lib/SIL/Parser/ParseSIL.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2117,6 +2117,12 @@ bool SILParser::parseSILLocation(SILLocation &Loc) {
21172117
if (parseVerbatim("loc"))
21182118
return true;
21192119

2120+
bool isAutoGenerated = false;
2121+
if (P.Tok.isAnyOperator() && P.Tok.getText().startswith("*")) {
2122+
isAutoGenerated = true;
2123+
P.consumeStartingCharacterOfCurrentToken();
2124+
}
2125+
21202126
if (P.Tok.getKind() != tok::string_literal) {
21212127
P.diagnose(P.Tok, diag::expected_tok_in_sil_instr, "string");
21222128
return true;
@@ -2140,7 +2146,7 @@ bool SILParser::parseSILLocation(SILLocation &Loc) {
21402146

21412147
Loc = RegularLocation(fnl);
21422148

2143-
if (*fnl == *SILLocation::getCompilerGeneratedLoc())
2149+
if (isAutoGenerated)
21442150
Loc.markAutoGenerated();
21452151

21462152
return false;

lib/SILOptimizer/Transforms/ARCCodeMotion.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class CodeMotionContext {
161161
RCIdentityFunctionInfo *RCFI;
162162

163163
/// All the unique refcount roots retained or released in the function.
164-
llvm::SetVector<SILValue> RCRootVault;
164+
llvm::SmallVector<SILValue, 16> RCRootVault;
165165

166166
/// Contains a map between RC roots to their index in the RCRootVault.
167167
/// used to facilitate fast RC roots to index lookup.
@@ -413,7 +413,7 @@ void RetainCodeMotionContext::initializeCodeMotionDataFlow() {
413413
if (RCRootIndex.find(Root) != RCRootIndex.end())
414414
continue;
415415
RCRootIndex[Root] = RCRootVault.size();
416-
RCRootVault.insert(Root);
416+
RCRootVault.push_back(Root);
417417
LLVM_DEBUG(llvm::dbgs()
418418
<< "Retain Root #" << RCRootVault.size() << " " << Root);
419419
}
@@ -801,7 +801,7 @@ void ReleaseCodeMotionContext::initializeCodeMotionDataFlow() {
801801
if (RCRootIndex.find(Root) != RCRootIndex.end())
802802
continue;
803803
RCRootIndex[Root] = RCRootVault.size();
804-
RCRootVault.insert(Root);
804+
RCRootVault.push_back(Root);
805805
LLVM_DEBUG(llvm::dbgs()
806806
<< "Release Root #" << RCRootVault.size() << " " << Root);
807807
}

lib/SILOptimizer/Transforms/StringOptimization.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ SILValue StringOptimization::copyValue(SILValue value, SILInstruction *before) {
681681
/// Creates a call to a string initializer.
682682
ApplyInst *StringOptimization::createStringInit(StringRef str,
683683
SILInstruction *beforeInst) {
684-
SILBuilder builder(beforeInst);
684+
SILBuilderWithScope builder(beforeInst);
685685
SILLocation loc = beforeInst->getLoc();
686686
SILModule &module = beforeInst->getFunction()->getModule();
687687
ASTContext &ctxt = module.getASTContext();

lib/SILOptimizer/Utils/SILInliner.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ class SILInlineCloner
285285
/// This location wraps the call site AST node that is being inlined.
286286
/// Alternatively, it can be the SIL file location of the call site (in case
287287
/// of SIL-to-SIL transformations).
288-
Optional<SILLocation> Loc;
288+
SILLocation Loc;
289289
const SILDebugScope *CallSiteScope = nullptr;
290290
llvm::SmallDenseMap<const SILDebugScope *, const SILDebugScope *, 8>
291291
InlinedScopeCache;
@@ -338,9 +338,7 @@ class SILInlineCloner
338338
return InLoc;
339339
// Inlined location wraps the call site that is being inlined, regardless
340340
// of the input location.
341-
return Loc.has_value()
342-
? Loc.value()
343-
: MandatoryInlinedLocation();
341+
return Loc;
344342
}
345343

346344
const SILDebugScope *remapScope(const SILDebugScope *DS) {
@@ -387,6 +385,16 @@ SILInliner::inlineFullApply(FullApplySite apply,
387385
appliedArgs);
388386
}
389387

388+
static SILLocation selectLoc(bool mandatory, SILLocation orig) {
389+
// Compute the SILLocation which should be used by all the inlined
390+
// instructions.
391+
if (mandatory)
392+
return MandatoryInlinedLocation(orig);
393+
else {
394+
return InlinedLocation(orig);
395+
}
396+
}
397+
390398
SILInlineCloner::SILInlineCloner(
391399
SILFunction *calleeFunction, FullApplySite apply,
392400
SILOptFunctionBuilder &funcBuilder, InlineKind inlineKind,
@@ -395,7 +403,8 @@ SILInlineCloner::SILInlineCloner(
395403
: SuperTy(*apply.getFunction(), *calleeFunction, applySubs,
396404
/*DT=*/nullptr, /*Inlining=*/true),
397405
FuncBuilder(funcBuilder), IKind(inlineKind), Apply(apply),
398-
deleter(deleter) {
406+
deleter(deleter),
407+
Loc(selectLoc(inlineKind == InlineKind::MandatoryInline, apply.getLoc())) {
399408

400409
SILFunction &F = getBuilder().getFunction();
401410
assert(apply.getFunction() && apply.getFunction() == &F
@@ -408,15 +417,6 @@ SILInlineCloner::SILInlineCloner(
408417
&& "Cannot inline Objective-C methods or C functions in mandatory "
409418
"inlining");
410419

411-
// Compute the SILLocation which should be used by all the inlined
412-
// instructions.
413-
if (IKind == InlineKind::PerformanceInline)
414-
Loc = InlinedLocation(apply.getLoc());
415-
else {
416-
assert(IKind == InlineKind::MandatoryInline && "Unknown InlineKind.");
417-
Loc = MandatoryInlinedLocation(apply.getLoc());
418-
}
419-
420420
auto applyScope = apply.getDebugScope();
421421
// FIXME: Turn this into an assertion instead.
422422
if (!applyScope)
@@ -436,7 +436,7 @@ SILInlineCloner::SILInlineCloner(
436436
assert(CallSiteScope->getParentFunction() == &F);
437437

438438
// Set up the coroutine-specific inliner if applicable.
439-
BeginApply = BeginApplySite::get(apply, Loc.value(), &getBuilder());
439+
BeginApply = BeginApplySite::get(apply, Loc, &getBuilder());
440440
}
441441

442442
// Clone the entire callee function into the caller function at the apply site.

lib/Sema/CSApply.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2939,7 +2939,7 @@ namespace {
29392939

29402940
// Make the integer literals for the parameters.
29412941
auto buildExprFromUnsigned = [&](unsigned value) {
2942-
LiteralExpr *expr = IntegerLiteralExpr::createFromUnsigned(ctx, value);
2942+
LiteralExpr *expr = IntegerLiteralExpr::createFromUnsigned(ctx, value, loc);
29432943
cs.setType(expr, ctx.getIntType());
29442944
return handleIntegerLiteralExpr(expr);
29452945
};

lib/Sema/DerivedConformanceEquatableHashable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ deriveBodyHashable_enum_hasAssociatedValues_hashInto(
716716

717717
{
718718
// Generate: hasher.combine(<ordinal>)
719-
auto ordinalExpr = IntegerLiteralExpr::createFromUnsigned(C, index++);
719+
auto ordinalExpr = IntegerLiteralExpr::createFromUnsigned(C, index++, SourceLoc());
720720
auto combineExpr = createHasherCombineCall(C, hasherParam, ordinalExpr);
721721
statements.emplace_back(ASTNode(combineExpr));
722722
}

lib/Sema/DerivedConformanceRawRepresentable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ deriveBodyRawRepresentable_init(AbstractFunctionDecl *initDecl, void *) {
321321
// In case of a string enum we are calling the _findStringSwitchCase
322322
// function from the library and switching on the returned Int value.
323323
stringExprs.push_back(litExpr);
324-
litExpr = IntegerLiteralExpr::createFromUnsigned(C, Idx);
324+
litExpr = IntegerLiteralExpr::createFromUnsigned(C, Idx, SourceLoc());
325325
}
326326
auto litPat = new (C) ExprPattern(litExpr, /*isResolved*/ true,
327327
nullptr, nullptr);

lib/Sema/DerivedConformances.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ GuardStmt *DerivedConformance::returnComparisonIfNotEqualGuard(ASTContext &C,
692692
static IntegerLiteralExpr *buildIntegerLiteral(ASTContext &C, unsigned index) {
693693
Type intType = C.getIntType();
694694

695-
auto literal = IntegerLiteralExpr::createFromUnsigned(C, index);
695+
auto literal = IntegerLiteralExpr::createFromUnsigned(C, index, SourceLoc());
696696
literal->setType(intType);
697697
literal->setBuiltinInitializer(C.getIntBuiltinInitDecl(C.getIntDecl()));
698698

lib/Sema/InstrumenterSupport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ bool InstrumenterBase::doTypeCheckImpl(ASTContext &Ctx, DeclContext *DC,
132132
Expr *InstrumenterBase::buildIDArgumentExpr(Optional<DeclNameRef> name,
133133
SourceRange SR) {
134134
if (!name)
135-
return IntegerLiteralExpr::createFromUnsigned(Context, 0);
135+
return IntegerLiteralExpr::createFromUnsigned(Context, 0, SR.End);
136136

137137
return new (Context) UnresolvedDeclRefExpr(*name, DeclRefKind::Ordinary,
138138
DeclNameLoc(SR.End));

lib/Sema/PCMacro.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -552,10 +552,10 @@ class Instrumenter : InstrumenterBase {
552552
Context.SourceMgr.getPresumedLineAndColumnForLoc(
553553
Lexer::getLocForEndOfToken(Context.SourceMgr, SR.End));
554554

555-
Expr *StartLine = IntegerLiteralExpr::createFromUnsigned(Context, StartLC.first);
556-
Expr *EndLine = IntegerLiteralExpr::createFromUnsigned(Context, EndLC.first);
557-
Expr *StartColumn = IntegerLiteralExpr::createFromUnsigned(Context, StartLC.second);
558-
Expr *EndColumn = IntegerLiteralExpr::createFromUnsigned(Context, EndLC.second);
555+
Expr *StartLine = IntegerLiteralExpr::createFromUnsigned(Context, StartLC.first, SR.Start);
556+
Expr *EndLine = IntegerLiteralExpr::createFromUnsigned(Context, EndLC.first, SR.End);
557+
Expr *StartColumn = IntegerLiteralExpr::createFromUnsigned(Context, StartLC.second, SR.Start);
558+
Expr *EndColumn = IntegerLiteralExpr::createFromUnsigned(Context, EndLC.second, SR.End);
559559

560560
Expr *ModuleExpr = buildIDArgumentExpr(ModuleIdentifier, SR);
561561
Expr *FileExpr = buildIDArgumentExpr(FileIdentifier, SR);
@@ -623,10 +623,10 @@ class Instrumenter : InstrumenterBase {
623623
Context.SourceMgr.getPresumedLineAndColumnForLoc(
624624
Lexer::getLocForEndOfToken(Context.SourceMgr, SR.End));
625625

626-
Expr *StartLine = IntegerLiteralExpr::createFromUnsigned(Context, StartLC.first);
627-
Expr *EndLine = IntegerLiteralExpr::createFromUnsigned(Context, EndLC.first);
628-
Expr *StartColumn = IntegerLiteralExpr::createFromUnsigned(Context, StartLC.second);
629-
Expr *EndColumn = IntegerLiteralExpr::createFromUnsigned(Context, EndLC.second);
626+
Expr *StartLine = IntegerLiteralExpr::createFromUnsigned(Context, StartLC.first, SR.Start);
627+
Expr *EndLine = IntegerLiteralExpr::createFromUnsigned(Context, EndLC.first, SR.End);
628+
Expr *StartColumn = IntegerLiteralExpr::createFromUnsigned(Context, StartLC.second, SR.Start);
629+
Expr *EndColumn = IntegerLiteralExpr::createFromUnsigned(Context, EndLC.second, SR.End);
630630

631631
Expr *ModuleExpr = buildIDArgumentExpr(ModuleIdentifier, SR);
632632
Expr *FileExpr = buildIDArgumentExpr(FileIdentifier, SR);

lib/Sema/PlaygroundTransform.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ class Instrumenter : InstrumenterBase {
750750

751751
std::uniform_int_distribution<unsigned> Distribution(0, 0x7fffffffu);
752752
const unsigned id_num = Distribution(RNG);
753-
Expr *IDExpr = IntegerLiteralExpr::createFromUnsigned(Context, id_num);
753+
Expr *IDExpr = IntegerLiteralExpr::createFromUnsigned(Context, id_num, SourceLoc());
754754

755755
return buildLoggerCallWithArgs(LogWithIDName, { *E, NameExpr, IDExpr }, SR);
756756
}
@@ -779,10 +779,10 @@ class Instrumenter : InstrumenterBase {
779779
Context.SourceMgr.getPresumedLineAndColumnForLoc(
780780
Lexer::getLocForEndOfToken(Context.SourceMgr, SR.End));
781781

782-
Expr *StartLine = IntegerLiteralExpr::createFromUnsigned(Context, StartLC.first);
783-
Expr *EndLine = IntegerLiteralExpr::createFromUnsigned(Context, EndLC.first);
784-
Expr *StartColumn = IntegerLiteralExpr::createFromUnsigned(Context, StartLC.second);
785-
Expr *EndColumn = IntegerLiteralExpr::createFromUnsigned(Context, EndLC.second);
782+
Expr *StartLine = IntegerLiteralExpr::createFromUnsigned(Context, StartLC.first, SR.Start);
783+
Expr *EndLine = IntegerLiteralExpr::createFromUnsigned(Context, EndLC.first, SR.End);
784+
Expr *StartColumn = IntegerLiteralExpr::createFromUnsigned(Context, StartLC.second, SR.Start);
785+
Expr *EndColumn = IntegerLiteralExpr::createFromUnsigned(Context, EndLC.second, SR.End);
786786

787787
Expr *ModuleExpr = buildIDArgumentExpr(ModuleIdentifier, SR);
788788
Expr *FileExpr = buildIDArgumentExpr(FileIdentifier, SR);

test/DebugInfo/linetable-assign.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
public func g<T>(_ t: T) {}
55
public func f(_ i: Int32) {
66
// CHECK: function_ref @$s4main1fyys5Int32VFyycfU_
7-
// CHECK-SAME: loc "{{.*}}":13:3,
7+
// CHECK-SAME: loc * "{{.*}}":13:3,
88
// CHECK: %[[CLOSURE:.*]] = partial_apply
9-
// CHECK-SAME: loc "{{.*}}":13:3,{{.*}}auto_gen
9+
// CHECK-SAME: loc * "{{.*}}":13:3,{{.*}}auto_gen
1010
// CHECK: store %[[CLOSURE]]
1111
// CHECK-SAME: loc "{{.*}}":12:3,
1212
var closure = // line 12

test/DebugInfo/sroa_mem2reg.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ bb0(%0 : $Int64, %1 : $Int64):
3636
// CHECK-SROA: alloc_stack $Int64, var
3737
// CHECK-SROA-SAME: (name "my_struct", loc "sroa.swift":8:9
3838
// CHECK-SROA-SAME: type $*MyStruct, expr op_fragment:#MyStruct.x
39-
// CHECK-SROA-SAME: loc "<compiler-generated>":0:0
39+
// CHECK-SROA-SAME: loc * "<compiler-generated>":0:0
4040
// CHECK-SROA: alloc_stack $Int64, var
4141
// CHECK-SROA-SAME: (name "my_struct", loc "sroa.swift":8:9
4242
// CHECK-SROA-SAME: type $*MyStruct, expr op_fragment:#MyStruct.y
43-
// CHECK-SROA-SAME: loc "<compiler-generated>":0:0
43+
// CHECK-SROA-SAME: loc * "<compiler-generated>":0:0
4444
%5 = metatype $@thin MyStruct.Type, loc "sroa.swift":8:21, scope 2
4545
%6 = integer_literal $Builtin.Int64, 0, loc "sroa.swift":8:33, scope 2
4646
%7 = struct $Int64 (%6 : $Builtin.Int64), loc "sroa.swift":8:33, scope 2

test/SILGen/concurrent_prologue.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
@MainActor func f() async -> Int {
88
// CHECK: {{^sil .*}}@$s1a1fSiyYaF
9-
// CHECK: %0 = metatype {{.*}}loc "{{.*}}.swift":[[@LINE-2]]:17,{{.*}}:auto_gen
10-
// CHECK: %1 = function_ref {{.*}}loc "{{.*}}.swift":[[@LINE-3]]:17,{{.*}}:auto_gen
11-
// CHECK: %2 = apply %1(%0) {{.*}}loc "{{.*}}.swift":[[@LINE-4]]:17,{{.*}}:auto_gen
12-
// CHECK: begin_borrow {{.*}}loc "{{.*}}.swift":[[@LINE-5]]:17,{{.*}}:auto_gen
13-
// CHECK: hop_to_executor {{.*}}loc "{{.*}}.swift":[[@LINE-6]]:17,{{.*}}
9+
// CHECK: %0 = metatype {{.*}}loc * "{{.*}}.swift":[[@LINE-2]]:17,{{.*}}:auto_gen
10+
// CHECK: %1 = function_ref {{.*}}loc * "{{.*}}.swift":[[@LINE-3]]:17,{{.*}}:auto_gen
11+
// CHECK: %2 = apply %1(%0) {{.*}}loc * "{{.*}}.swift":[[@LINE-4]]:17,{{.*}}:auto_gen
12+
// CHECK: begin_borrow {{.*}}loc * "{{.*}}.swift":[[@LINE-5]]:17,{{.*}}:auto_gen
13+
// CHECK: hop_to_executor {{.*}}loc * "{{.*}}.swift":[[@LINE-6]]:17,{{.*}}
1414
// CHECK: // end sil function '$s1a1fSiyYaF'
1515
return 23
1616
}

test/SILGen/sil_locations.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ func captures_tuple<T, U>(x: (T, U)) -> () -> (T, U) {
213213
// CHECK-LABEL: sil hidden [ossa] @$s13sil_locations14captures_tuple{{[_0-9a-zA-Z]*}}F
214214
// CHECK: tuple_element_addr {{.*}}, loc "{{.*}}":[[@LINE-3]]:27
215215
// CHECK: copy_addr {{.*}}, loc "{{.*}}":[[@LINE-4]]:27
216-
// CHECK: function_ref {{.*}}, loc "{{.*}}":[[@LINE-4]]:10
216+
// CHECK: function_ref {{.*}}, loc * "{{.*}}":[[@LINE-4]]:10
217217

218218
// CHECK-LABEL: sil private [ossa] @$s13sil_locations14captures_tuple{{.*}}fU_
219219
// CHECK: copy_addr {{.*}}, loc "{{.*}}":[[@LINE-7]]:11
@@ -438,8 +438,8 @@ func testKeyPathGetterSetterAutogen() -> Struct.InnerStruct {
438438
return s[keyPath: kp]
439439
// Autogenerated keypath getter
440440
// CHECK-LABEL: sil shared [thunk] [ossa] @$s13sil_locations6StructV14structProperty{{[_0-9a-zA-Z]*}}TK
441-
// CHECK: load {{.*}} loc "<compiler-generated>":0:0{{.*}}<invalid loc>:auto_gen
441+
// CHECK: load {{.*}} loc * "<compiler-generated>":0:0{{.*}}<invalid loc>:auto_gen
442442
// Autogenerated keypath setter
443443
// CHECK-LABEL: sil shared [thunk] [ossa] @$s13sil_locations6StructV14structProperty{{[_0-9a-zA-Z]*}}Tk
444-
// CHECK: load {{.*}} loc "<compiler-generated>":0:0{{.*}}<invalid loc>:auto_gen
444+
// CHECK: load {{.*}} loc * "<compiler-generated>":0:0{{.*}}<invalid loc>:auto_gen
445445
}

unittests/Sema/BindingInferenceTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ TEST_F(SemaTest, TestIntLiteralBindingInference) {
2727

2828
ConstraintSystem cs(DC, options);
2929

30-
auto *intLiteral = IntegerLiteralExpr::createFromUnsigned(Context, 42);
30+
auto *intLiteral = IntegerLiteralExpr::createFromUnsigned(Context, 42, SourceLoc());
3131

3232
auto *literalTy = cs.createTypeVariable(cs.getConstraintLocator(intLiteral),
3333
/*options=*/0);

unittests/Sema/ConstraintGenerationTests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static Type getTypeOfCoercedExpr(ExplicitCastExpr *castExpr) {
3333
TEST_F(SemaTest, TestImplicitForceCastConstraintGeneration) {
3434
ConstraintSystem cs(DC, ConstraintSystemOptions());
3535

36-
auto *literal = IntegerLiteralExpr::createFromUnsigned(Context, 42);
36+
auto *literal = IntegerLiteralExpr::createFromUnsigned(Context, 42, SourceLoc());
3737

3838
auto *castExpr = ForcedCheckedCastExpr::createImplicit(Context, literal,
3939
Context.TheAnyType);
@@ -61,7 +61,7 @@ TEST_F(SemaTest, TestImplicitForceCastConstraintGeneration) {
6161
TEST_F(SemaTest, TestImplicitCoercionConstraintGeneration) {
6262
ConstraintSystem cs(DC, ConstraintSystemOptions());
6363

64-
auto *literal = IntegerLiteralExpr::createFromUnsigned(Context, 42);
64+
auto *literal = IntegerLiteralExpr::createFromUnsigned(Context, 42, SourceLoc());
6565

6666
auto *castExpr = CoerceExpr::createImplicit(Context, literal,
6767
getStdlibType("Double"));
@@ -90,7 +90,7 @@ TEST_F(SemaTest, TestImplicitCoercionConstraintGeneration) {
9090
TEST_F(SemaTest, TestImplicitConditionalCastConstraintGeneration) {
9191
ConstraintSystem cs(DC, ConstraintSystemOptions());
9292

93-
auto *literal = IntegerLiteralExpr::createFromUnsigned(Context, 42);
93+
auto *literal = IntegerLiteralExpr::createFromUnsigned(Context, 42, SourceLoc());
9494

9595
auto *castExpr = ConditionalCheckedCastExpr::createImplicit(
9696
Context, literal, getStdlibType("Double"));

0 commit comments

Comments
 (0)