Commit 6a108054 authored by Olly Betts's avatar Olly Betts
Browse files

Factor out x_return into common header

parent 05f43e54
......@@ -12,12 +12,6 @@
static void generate(struct generator * g, struct node * p);
enum special_labels {
x_return = -1
};
static int new_label(struct generator * g) {
return g->next_label++;
}
......
......@@ -10,13 +10,7 @@ static void generate(struct generator * g, struct node * p);
static void w(struct generator * g, const char * s);
static void writef(struct generator * g, const char * s, struct node * p);
enum special_labels {
x_return = -1
};
static int new_label(struct generator * g) {
return g->next_label++;
}
......
......@@ -10,13 +10,7 @@ static void generate(struct generator * g, struct node * p);
static void w(struct generator * g, const char * s);
static void writef(struct generator * g, const char * s, struct node * p);
enum special_labels {
x_return = -1
};
static int new_label(struct generator * g) {
return g->next_label++;
}
......
......@@ -10,13 +10,7 @@ static void generate(struct generator * g, struct node * p);
static void w(struct generator * g, const char * s);
static void writef(struct generator * g, const char * s, struct node * p);
enum special_labels {
x_return = -1
};
static int new_label(struct generator * g) {
return g->next_label++;
}
......
......@@ -10,13 +10,7 @@ static void generate(struct generator * g, struct node * p);
static void w(struct generator * g, const char * s);
static void writef(struct generator * g, const char * s, struct node * p);
enum special_labels {
x_return = -1
};
static int new_label(struct generator * g) {
return g->next_label++;
}
......
......@@ -12,13 +12,6 @@ static void generate(struct generator * g, struct node * p);
static void w(struct generator * g, const char * s);
static void writef(struct generator * g, const char * s, struct node * p);
/* New labels' and variables' names generation */
enum special_labels {
x_return = -1
};
static int new_label(struct generator * g) {
return g->next_label++;
}
......
......@@ -10,13 +10,7 @@ static void generate(struct generator * g, struct node * p);
static void w(struct generator * g, const char * s);
static void writef(struct generator * g, const char * s, struct node * p);
enum special_labels {
x_return = -1
};
static int new_label(struct generator * g) {
int next_label = g->next_label++;
g->max_label = (next_label > g->max_label) ? next_label : g->max_label;
return next_label;
......
......@@ -10,13 +10,7 @@ static void generate(struct generator * g, struct node * p);
static void w(struct generator * g, const char * s);
static void writef(struct generator * g, const char * s, struct node * p);
enum special_labels {
x_return = -1
};
static int new_label(struct generator * g) {
return g->next_label++;
}
......
......@@ -323,6 +323,11 @@ struct generator {
about shadowed variables */
};
/* Special values for failure_label in struct generator. */
enum special_labels {
x_return = -1
};
struct options {
/* for the command line: */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment