mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST/SILGen support for constant string literals
rdar://30545013
This commit is contained in:
@@ -157,7 +157,7 @@ class alignas(8) Expr {
|
||||
friend class StringLiteralExpr;
|
||||
unsigned : NumLiteralExprBits;
|
||||
|
||||
unsigned Encoding : 2;
|
||||
unsigned Encoding : 3;
|
||||
unsigned IsSingleUnicodeScalar : 1;
|
||||
unsigned IsSingleExtendedGraphemeCluster : 1;
|
||||
};
|
||||
@@ -940,6 +940,12 @@ public:
|
||||
/// A UTF-16 string.
|
||||
UTF16,
|
||||
|
||||
/// A UTF-8 constant string.
|
||||
UTF8ConstString,
|
||||
|
||||
/// A UTF-16 constant string.
|
||||
UTF16ConstString,
|
||||
|
||||
/// A single UnicodeScalar, passed as an integer.
|
||||
OneUnicodeScalar
|
||||
};
|
||||
|
||||
@@ -123,6 +123,8 @@ IDENTIFIER(unicodeScalarLiteral)
|
||||
IDENTIFIER(stringLiteral)
|
||||
IDENTIFIER_(builtinUTF16StringLiteral)
|
||||
IDENTIFIER_(builtinStringLiteral)
|
||||
IDENTIFIER_(builtinConstUTF16StringLiteral)
|
||||
IDENTIFIER_(builtinConstStringLiteral)
|
||||
IDENTIFIER(StringLiteralType)
|
||||
IDENTIFIER(stringInterpolation)
|
||||
IDENTIFIER(stringInterpolationSegment)
|
||||
|
||||
@@ -87,6 +87,8 @@ BUILTIN_EXPRESSIBLE_BY_LITERAL_PROTOCOL_(ExpressibleByBuiltinIntegerLiteral)
|
||||
BUILTIN_EXPRESSIBLE_BY_LITERAL_PROTOCOL_(ExpressibleByBuiltinStringLiteral)
|
||||
BUILTIN_EXPRESSIBLE_BY_LITERAL_PROTOCOL_(ExpressibleByBuiltinUTF16StringLiteral)
|
||||
BUILTIN_EXPRESSIBLE_BY_LITERAL_PROTOCOL_(ExpressibleByBuiltinUnicodeScalarLiteral)
|
||||
BUILTIN_EXPRESSIBLE_BY_LITERAL_PROTOCOL_(ExpressibleByBuiltinConstStringLiteral)
|
||||
BUILTIN_EXPRESSIBLE_BY_LITERAL_PROTOCOL_(ExpressibleByBuiltinConstUTF16StringLiteral)
|
||||
|
||||
#undef EXPRESSIBLE_BY_LITERAL_PROTOCOL
|
||||
#undef EXPRESSIBLE_BY_LITERAL_PROTOCOL_
|
||||
|
||||
@@ -54,7 +54,7 @@ const uint16_t VERSION_MAJOR = 0;
|
||||
/// in source control, you should also update the comment to briefly
|
||||
/// describe what change you made. The content of this comment isn't important;
|
||||
/// it just ensures a conflict if two people change the module format.
|
||||
const uint16_t VERSION_MINOR = 332; // Last change: constant_string_literal
|
||||
const uint16_t VERSION_MINOR = 333; // Last change: AST constant_string_literal
|
||||
|
||||
using DeclID = PointerEmbeddedInt<unsigned, 31>;
|
||||
using DeclIDField = BCFixed<31>;
|
||||
|
||||
Reference in New Issue
Block a user