@@ -994,39 +994,32 @@ class InterpolatedStringLiteralExpr : public LiteralExpr {
994994
995995// / A regular expression literal e.g '(a|c)*'.
996996class RegexLiteralExpr : public LiteralExpr {
997+ ASTContext *Ctx;
997998 SourceLoc Loc;
998- StringRef RegexText;
999- unsigned Version;
1000- ArrayRef<uint8_t > SerializedCaptureStructure;
999+ StringRef ParsedRegexText;
10011000
1002- RegexLiteralExpr (SourceLoc loc, StringRef regexText, unsigned version,
1003- ArrayRef<uint8_t > serializedCaps,
1001+ RegexLiteralExpr (ASTContext *ctx, SourceLoc loc, StringRef parsedRegexText,
10041002 bool isImplicit)
1005- : LiteralExpr(ExprKind::RegexLiteral, isImplicit), Loc(loc),
1006- RegexText (regexText), Version(version),
1007- SerializedCaptureStructure(serializedCaps) {}
1003+ : LiteralExpr(ExprKind::RegexLiteral, isImplicit), Ctx(ctx), Loc(loc),
1004+ ParsedRegexText (parsedRegexText) {}
10081005
10091006public:
1010- static RegexLiteralExpr *createParsed (
1011- ASTContext &ctx, SourceLoc loc, StringRef regexText, unsigned version,
1012- ArrayRef<uint8_t > serializedCaptureStructure);
1007+ static RegexLiteralExpr *createParsed (ASTContext &ctx, SourceLoc loc,
1008+ StringRef regexText);
10131009
1014- typedef uint16_t CaptureStructureSerializationVersion;
1010+ ASTContext & getASTContext () const { return *Ctx; }
10151011
1016- static unsigned getCaptureStructureSerializationAllocationSize (
1017- unsigned regexLength) {
1018- return sizeof (CaptureStructureSerializationVersion) + regexLength + 1 ;
1019- }
1012+ // / Retrieve the raw parsed regex text.
1013+ StringRef getParsedRegexText () const { return ParsedRegexText; }
10201014
1021- // / Retrieve the raw regex text .
1022- StringRef getRegexText () const { return RegexText; }
1015+ // / Retrieve the regex pattern to emit .
1016+ StringRef getRegexToEmit () const ;
10231017
1024- // / Retrieve the version of the regex string .
1025- unsigned getVersion () const { return Version; }
1018+ // / Retrieve the computed type for the regex.
1019+ Type getRegexType () const ;
10261020
1027- ArrayRef<uint8_t > getSerializedCaptureStructure () {
1028- return SerializedCaptureStructure;
1029- }
1021+ // / Retrieve the version of the regex string.
1022+ unsigned getVersion () const ;
10301023
10311024 SourceRange getSourceRange () const { return Loc; }
10321025
@@ -6558,9 +6551,8 @@ void simple_display(llvm::raw_ostream &out, const ClosureExpr *CE);
65586551void simple_display (llvm::raw_ostream &out, const DefaultArgumentExpr *expr);
65596552void simple_display (llvm::raw_ostream &out, const Expr *expr);
65606553
6561- SourceLoc extractNearestSourceLoc (const DefaultArgumentExpr *expr);
6562- SourceLoc extractNearestSourceLoc (const MacroExpansionExpr *expr);
65636554SourceLoc extractNearestSourceLoc (const ClosureExpr *expr);
6555+ SourceLoc extractNearestSourceLoc (const Expr *expr);
65646556
65656557} // end namespace swift
65666558
0 commit comments