/* libccp helpers. */
-static struct line_maps *line_table;
+static class line_maps *line_table;
/* The rich_location class within libcpp requires a way to expand
location_t instances, and relies on the client code
unsigned int fn;
};
-struct simplify;
+class simplify;
/* Identifier that maps to a user-defined predicate. */
/* The AST produced by parsing of the pattern definitions. */
-struct dt_operand;
-struct capture_info;
+class dt_operand;
+class capture_info;
/* The base class for operands. */
produced when the pattern applies in the leafs.
For a (match ...) the leafs are either empty if it is a simple predicate
or the single expression specifying the matched operands. */
- struct operand *result;
+ class operand *result;
/* Collected 'for' expression operators that have to be replaced
in the lowering phase. */
vec<vec<user_id *> > for_vec;
}
DEBUG_FUNCTION void
-print_matches (struct simplify *s, FILE *f = stderr)
+print_matches (class simplify *s, FILE *f = stderr)
{
fprintf (f, "for expression: ");
print_operand (s->match, f);
matching code. It represents the 'match' expression of all
simplifies and has those as its leafs. */
-struct dt_simplify;
+class dt_simplify;
/* A hash-map collecting semantically equivalent leafs in the decision
tree for splitting out to separate functions. */
public:
dt_node *root;
- void insert (struct simplify *, unsigned);
+ void insert (class simplify *, unsigned);
void gen (FILE *f, bool gimple);
void print (FILE *f = stderr);
/* Insert S into the decision tree. */
void
-decision_tree::insert (struct simplify *s, unsigned pattern_no)
+decision_tree::insert (class simplify *s, unsigned pattern_no)
{
current_id = s->id;
dt_operand **indexes = XCNEWVEC (dt_operand *, s->capture_max + 1);
/* Parse a capture.
capture = '@'<number> */
-struct operand *
+class operand *
parser::parse_capture (operand *op, bool require_existing)
{
location_t src_loc = eat_token (CPP_ATSIGN)->src_loc;
/* Parse an expression
expr = '(' <operation>[capture][flag][type] <operand>... ')' */
-struct operand *
+class operand *
parser::parse_expr ()
{
const cpp_token *token = peek ();
a standalone capture.
op = predicate | expr | c_expr | capture */
-struct operand *
+class operand *
parser::parse_op ()
{
const cpp_token *token = peek ();
- struct operand *op = NULL;
+ class operand *op = NULL;
if (token->type == CPP_OPEN_PAREN)
{
eat_token (CPP_OPEN_PAREN);
const cpp_token *loc = peek ();
parsing_match_operand = true;
- struct operand *match = parse_op ();
+ class operand *match = parse_op ();
finish_match_operand (match);
parsing_match_operand = false;
if (match->type == operand::OP_CAPTURE && !matcher)
}
}
- line_table = XCNEW (struct line_maps);
+ line_table = XCNEW (class line_maps);
linemap_init (line_table, 0);
line_table->reallocator = xrealloc;
line_table->round_alloc_size = round_alloc_size;