@@ -993,39 +993,32 @@ class InterpolatedStringLiteralExpr : public LiteralExpr {
993993
994994// / A regular expression literal e.g '(a|c)*'.
995995class RegexLiteralExpr : public LiteralExpr {
996+ ASTContext *Ctx;
996997 SourceLoc Loc;
997- StringRef RegexText;
998- unsigned Version;
999- ArrayRef<uint8_t > SerializedCaptureStructure;
998+ StringRef ParsedRegexText;
1000999
1001- RegexLiteralExpr (SourceLoc loc, StringRef regexText, unsigned version,
1002- ArrayRef<uint8_t > serializedCaps,
1000+ RegexLiteralExpr (ASTContext *ctx, SourceLoc loc, StringRef parsedRegexText,
10031001 bool isImplicit)
1004- : LiteralExpr(ExprKind::RegexLiteral, isImplicit), Loc(loc),
1005- RegexText (regexText), Version(version),
1006- SerializedCaptureStructure(serializedCaps) {}
1002+ : LiteralExpr(ExprKind::RegexLiteral, isImplicit), Ctx(ctx), Loc(loc),
1003+ ParsedRegexText (parsedRegexText) {}
10071004
10081005public:
1009- static RegexLiteralExpr *createParsed (
1010- ASTContext &ctx, SourceLoc loc, StringRef regexText, unsigned version,
1011- ArrayRef<uint8_t > serializedCaptureStructure);
1006+ static RegexLiteralExpr *createParsed (ASTContext &ctx, SourceLoc loc,
1007+ StringRef regexText);
10121008
1013- typedef uint16_t CaptureStructureSerializationVersion;
1009+ ASTContext & getASTContext () const { return *Ctx; }
10141010
1015- static unsigned getCaptureStructureSerializationAllocationSize (
1016- unsigned regexLength) {
1017- return sizeof (CaptureStructureSerializationVersion) + regexLength + 1 ;
1018- }
1011+ // / Retrieve the raw parsed regex text.
1012+ StringRef getParsedRegexText () const { return ParsedRegexText; }
10191013
1020- // / Retrieve the raw regex text .
1021- StringRef getRegexText () const { return RegexText; }
1014+ // / Retrieve the regex pattern to emit .
1015+ StringRef getRegexToEmit () const ;
10221016
1023- // / Retrieve the version of the regex string .
1024- unsigned getVersion () const { return Version; }
1017+ // / Retrieve the computed type for the regex.
1018+ Type getRegexType () const ;
10251019
1026- ArrayRef<uint8_t > getSerializedCaptureStructure () {
1027- return SerializedCaptureStructure;
1028- }
1020+ // / Retrieve the version of the regex string.
1021+ unsigned getVersion () const ;
10291022
10301023 SourceRange getSourceRange () const { return Loc; }
10311024
@@ -6545,9 +6538,8 @@ void simple_display(llvm::raw_ostream &out, const ClosureExpr *CE);
65456538void simple_display (llvm::raw_ostream &out, const DefaultArgumentExpr *expr);
65466539void simple_display (llvm::raw_ostream &out, const Expr *expr);
65476540
6548- SourceLoc extractNearestSourceLoc (const DefaultArgumentExpr *expr);
6549- SourceLoc extractNearestSourceLoc (const MacroExpansionExpr *expr);
65506541SourceLoc extractNearestSourceLoc (const ClosureExpr *expr);
6542+ SourceLoc extractNearestSourceLoc (const Expr *expr);
65516543
65526544} // end namespace swift
65536545
0 commit comments