Skip to content

Commit 3586389

Browse files
committed
Use a custom diagnostic when parsing SIL DIExpressions
1 parent eb2b7ba commit 3586389

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

include/swift/AST/DiagnosticsParse.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,8 @@ ERROR(sil_invalid_column_in_sil_location,none,
522522
"column number must be a positive integer", ())
523523
ERROR(sil_invalid_scope_slot,none,
524524
"scope number must be a positive integer ", ())
525+
ERROR(sil_invalid_constant,none,
526+
"constant operand must be an integer literal ", ())
525527
ERROR(sil_scope_undeclared,none,
526528
"scope number %0 needs to be declared before first use", (unsigned))
527529
ERROR(sil_scope_redefined,none,

lib/SIL/Parser/ParseSIL.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,8 +1701,7 @@ bool SILParser::parseSILDebugInfoExpression(SILDebugInfoExpression &DIExpr) {
17011701
IsNegative = true;
17021702
}
17031703
int64_t Val;
1704-
// FIXME: Use the correct diagnostic
1705-
if (parseInteger(Val, diag::sil_invalid_scope_slot))
1704+
if (parseInteger(Val, diag::sil_invalid_constant))
17061705
return true;
17071706
if (IsNegative)
17081707
Val = -Val;

0 commit comments

Comments
 (0)