File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -2380,6 +2380,10 @@ bool SILParser::parseSILInstruction(SILBuilder &B) {
2380
2380
// Drop the double quotes.
2381
2381
StringRef rawString = P.Tok .getText ().drop_front ().drop_back ();
2382
2382
2383
+ P.consumeToken (tok::string_literal);
2384
+ if (parseSILDebugLocation (InstLoc, B))
2385
+ return true ;
2386
+
2383
2387
// Ask the lexer to interpret the entire string as a literal segment.
2384
2388
SmallVector<char , 128 > stringBuffer;
2385
2389
@@ -2407,9 +2411,6 @@ bool SILParser::parseSILInstruction(SILBuilder &B) {
2407
2411
}
2408
2412
2409
2413
StringRef string = P.L ->getEncodedStringSegment (rawString, stringBuffer);
2410
- P.consumeToken (tok::string_literal);
2411
- if (parseSILDebugLocation (InstLoc, B))
2412
- return true ;
2413
2414
ResultVal = B.createStringLiteral (InstLoc, string, encoding);
2414
2415
break ;
2415
2416
}
Original file line number Diff line number Diff line change 14
14
%2 = const_string_literal utf8 "\u{0B}"
15
15
// CHECK: const_string_literal utf16 "\u{0B}"
16
16
%3 = const_string_literal utf16 "\u{0B}"
17
+ // CHECK: string_literal bytes "ABCD"
18
+ %4 = string_literal bytes "ABCD"
17
19
%6 = tuple ()
18
20
return %6 : $()
19
21
}
You can’t perform that action at this time.
0 commit comments