@@ -568,7 +568,8 @@ ParserResult<AvailableAttr> Parser::parseExtendedAvailabilitySpecList(
568
568
}
569
569
570
570
auto Value = getStringLiteralIfNotInterpolated (
571
- AttrLoc, (" '" + ArgumentKindStr + " '" ).str ());
571
+ AttrLoc, (" '" + ArgumentKindStr + " '" ).str (),
572
+ /* AllowMultiline=*/ true );
572
573
consumeToken ();
573
574
if (!Value) {
574
575
AnyArgumentInvalid = true ;
@@ -1453,7 +1454,8 @@ bool Parser::parseExternAttribute(DeclAttributes &Attributes,
1453
1454
return std::nullopt;
1454
1455
}
1455
1456
llvm::Optional<StringRef> importModuleName =
1456
- getStringLiteralIfNotInterpolated (Loc, (" '" + AttrName + " '" ).str ());
1457
+ getStringLiteralIfNotInterpolated (Loc, (" '" + AttrName + " '" ).str (),
1458
+ /* AllowMultiline=*/ false );
1457
1459
consumeToken (tok::string_literal);
1458
1460
1459
1461
if (!importModuleName.has_value ()) {
@@ -3233,8 +3235,8 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
3233
3235
return makeParserSuccess ();
3234
3236
}
3235
3237
3236
- AsmName =
3237
- getStringLiteralIfNotInterpolated ( Loc, (" '" + AttrName + " '" ).str ());
3238
+ AsmName = getStringLiteralIfNotInterpolated (
3239
+ Loc, (" '" + AttrName + " '" ).str (), /* AllowMultiline= */ false );
3238
3240
3239
3241
consumeToken (tok::string_literal);
3240
3242
@@ -3305,7 +3307,7 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
3305
3307
}
3306
3308
3307
3309
auto Name = getStringLiteralIfNotInterpolated (
3308
- Loc, (" '" + AttrName + " '" ).str ());
3310
+ Loc, (" '" + AttrName + " '" ).str (), /* AllowMultiline= */ false );
3309
3311
3310
3312
consumeToken (tok::string_literal);
3311
3313
@@ -3392,7 +3394,7 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
3392
3394
}
3393
3395
3394
3396
auto Value = getStringLiteralIfNotInterpolated (
3395
- Loc, (" '" + AttrName + " '" ).str ());
3397
+ Loc, (" '" + AttrName + " '" ).str (), /* AllowMultiline= */ false );
3396
3398
3397
3399
consumeToken (tok::string_literal);
3398
3400
@@ -3455,8 +3457,8 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
3455
3457
// Parse the next string literal as the original module name.
3456
3458
auto ModuleNameLoc = Tok.getLoc ();
3457
3459
if (Tok.is (tok::string_literal)) {
3458
- auto NameOp = getStringLiteralIfNotInterpolated (Tok. getLoc (),
3459
- " original module name" );
3460
+ auto NameOp = getStringLiteralIfNotInterpolated (
3461
+ Tok. getLoc (), " original module name" , /* AllowMultiline= */ false );
3460
3462
if (NameOp.has_value ())
3461
3463
OriginalModuleName = *NameOp;
3462
3464
consumeToken ();
@@ -3545,7 +3547,8 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
3545
3547
diagnose (ColonLoc, diag::attr_private_import_expected_sourcefile_name);
3546
3548
return makeParserSuccess ();
3547
3549
}
3548
- filename = getStringLiteralIfNotInterpolated (Loc, " _private" );
3550
+ filename = getStringLiteralIfNotInterpolated (Loc, " _private" ,
3551
+ /* AllowMultiline=*/ false );
3549
3552
if (!filename.has_value ()) {
3550
3553
diagnose (ColonLoc, diag::attr_private_import_expected_sourcefile_name);
3551
3554
return makeParserSuccess ();
@@ -3818,8 +3821,8 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
3818
3821
return makeParserSuccess ();
3819
3822
}
3820
3823
3821
- llvm::Optional<StringRef> value =
3822
- getStringLiteralIfNotInterpolated ( Tok.getLoc (), flag);
3824
+ llvm::Optional<StringRef> value = getStringLiteralIfNotInterpolated (
3825
+ Tok.getLoc (), flag, /* AllowMultiline= */ false );
3823
3826
if (!value)
3824
3827
return makeParserSuccess ();
3825
3828
Token stringTok = Tok;
@@ -4533,7 +4536,8 @@ bool Parser::parseConventionAttributeInternal(SourceLoc atLoc, SourceLoc attrLoc
4533
4536
diagnose (Tok, diag::convention_attribute_ctype_expected_string);
4534
4537
return true ;
4535
4538
}
4536
- if (auto ty = getStringLiteralIfNotInterpolated (Tok.getLoc (), " (C type)" )) {
4539
+ if (auto ty = getStringLiteralIfNotInterpolated (Tok.getLoc (), " (C type)" ,
4540
+ /* AllowMultiline=*/ false )) {
4537
4541
cType = Located<StringRef>(ty.value (), Tok.getLoc ());
4538
4542
}
4539
4543
consumeToken (tok::string_literal);
@@ -7167,8 +7171,8 @@ ParserStatus Parser::parseLineDirective(bool isLine) {
7167
7171
return makeParserError ();
7168
7172
}
7169
7173
7170
- Filename =
7171
- getStringLiteralIfNotInterpolated (Loc, " '#sourceLocation' " );
7174
+ Filename = getStringLiteralIfNotInterpolated (Loc, " '#sourceLocation' " ,
7175
+ /* AllowMultiline= */ false );
7172
7176
if (!Filename.has_value ())
7173
7177
return makeParserError ();
7174
7178
SourceLoc filenameLoc = consumeToken (tok::string_literal);
@@ -7238,8 +7242,9 @@ ParserStatus Parser::parseLineDirective(bool isLine) {
7238
7242
diagnose (Tok, diag::expected_line_directive_name);
7239
7243
return makeParserError ();
7240
7244
}
7241
-
7242
- Filename = getStringLiteralIfNotInterpolated (Loc, " '#line'" );
7245
+
7246
+ Filename = getStringLiteralIfNotInterpolated (Loc, " '#line'" ,
7247
+ /* AllowMultiline=*/ false );
7243
7248
if (!Filename.has_value ())
7244
7249
return makeParserError ();
7245
7250
}
0 commit comments