Skip to content

Commit ca6f533

Browse files
committed
Remove cache of already parsed cast expressions
Signed-off-by: Roberto Raggi <[email protected]>
1 parent 110e0b5 commit ca6f533

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

src/parser/cxx/parser.cc

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3245,29 +3245,16 @@ auto Parser::parse_cast_expression(ExpressionAST*& yyast,
32453245
const ExprContext& ctx) -> bool {
32463246
const auto start = currentLocation();
32473247

3248-
if (auto it = cast_expressions_.get(start)) {
3249-
auto [endLoc, ast, parsed, hit] = *it;
3250-
rewind(endLoc);
3251-
yyast = ast;
3252-
return parsed;
3253-
}
3254-
32553248
auto lookat_cast_expression = [&] {
32563249
LookaheadParser lookahead{this};
32573250
if (!parse_cast_expression_helper(yyast, ctx)) return false;
32583251
lookahead.commit();
32593252
return true;
32603253
};
32613254

3262-
auto parsed = lookat_cast_expression();
3255+
if (lookat_cast_expression()) return true;
32633256

3264-
if (!parsed) {
3265-
parsed = parse_unary_expression(yyast, ctx);
3266-
}
3267-
3268-
cast_expressions_.set(start, currentLocation(), yyast, parsed);
3269-
3270-
return parsed;
3257+
return parse_unary_expression(yyast, ctx);
32713258
}
32723259

32733260
auto Parser::parse_cast_expression_helper(ExpressionAST*& yyast,

src/parser/cxx/parser.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,6 @@ class Parser final {
972972
std::deque<const_iterator> queue_;
973973
};
974974

975-
CachedAST<ExpressionAST> cast_expressions_;
976975
CachedAST<NestedNameSpecifierAST> nested_name_specifiers_;
977976
CachedAST<ParameterDeclarationClauseAST> parameter_declaration_clauses_;
978977
CachedAST<TemplateArgumentAST> template_arguments_;

0 commit comments

Comments
 (0)