Commit dd599a01 authored by Sergio Costas's avatar Sergio Costas

Removed deftype field

Now doesn't copy the function name in the first parameter
parent 30fdec92
...@@ -30,8 +30,6 @@ struct AST * new_leaf(int type, struct AST *template) { ...@@ -30,8 +30,6 @@ struct AST * new_leaf(int type, struct AST *template) {
ast->line = -1; ast->line = -1;
} }
ast->deftype = NULL;
ast->data = NULL; ast->data = NULL;
ast->right = NULL; ast->right = NULL;
...@@ -142,9 +140,6 @@ void mix_ast_leaves(struct AST *base, struct AST *origin_leaf) { ...@@ -142,9 +140,6 @@ void mix_ast_leaves(struct AST *base, struct AST *origin_leaf) {
if (base->return_value == NULL) { if (base->return_value == NULL) {
base->return_value = copy_leaf(origin_leaf->return_value,false); base->return_value = copy_leaf(origin_leaf->return_value,false);
} }
if (base->deftype == NULL) {
base->deftype = mystrdup(origin_leaf->deftype);
}
//base->t_ |= origin_leaf->t_; //base->t_ |= origin_leaf->t_;
} }
...@@ -252,7 +247,6 @@ struct AST *copy_leaf(struct AST *leaf, bool deep) { ...@@ -252,7 +247,6 @@ struct AST *copy_leaf(struct AST *leaf, bool deep) {
COPY_STRING(data) COPY_STRING(data)
COPY_STRING(name) COPY_STRING(name)
COPY_STRING(filename) COPY_STRING(filename)
COPY_STRING(deftype)
if (deep) { if (deep) {
COPY_ELEMENT(next,true); COPY_ELEMENT(next,true);
} else { } else {
...@@ -369,7 +363,6 @@ void free_tree(struct AST *tree) { ...@@ -369,7 +363,6 @@ void free_tree(struct AST *tree) {
free(tree->filename); free(tree->filename);
free(tree->data); free(tree->data);
free(tree->name); free(tree->name);
free(tree->deftype);
free_tree(tree->child1); free_tree(tree->child1);
free_tree(tree->child2); free_tree(tree->child2);
free_tree(tree->child3); free_tree(tree->child3);
......
...@@ -7,7 +7,6 @@ struct AST { ...@@ -7,7 +7,6 @@ struct AST {
char *filename; char *filename;
char *data; char *data;
char *name; char *name;
char *deftype;
int pointer; int pointer;
bool t_const; bool t_const;
......
...@@ -321,8 +321,6 @@ declaration ...@@ -321,8 +321,6 @@ declaration
} else { } else {
tmpleaf->return_value = copy_leaf($1,false); tmpleaf->return_value = copy_leaf($1,false);
tmpleaf->t_typedef = $1->t_typedef; tmpleaf->t_typedef = $1->t_typedef;
free(tmpleaf->return_value->name);
tmpleaf->return_value->name = mystrdup($2->name);
tmpleaf->return_value->pointer += $2->pointer; tmpleaf->return_value->pointer += $2->pointer;
} }
if (tmpleaf->t_typedef) { if (tmpleaf->t_typedef) {
...@@ -388,7 +386,7 @@ type_specifier ...@@ -388,7 +386,7 @@ type_specifier
| IMAGINARY { $$ = $1; $$->type = TYPE_SPECIFIER; } | IMAGINARY { $$ = $1; $$->type = TYPE_SPECIFIER; }
| struct_or_union_specifier { $$ = $1; $$->type = TYPE_SPECIFIER; } | struct_or_union_specifier { $$ = $1; $$->type = TYPE_SPECIFIER; }
| enum_specifier { $$ = $1; $$->type = TYPE_SPECIFIER; } | enum_specifier { $$ = $1; $$->type = TYPE_SPECIFIER; }
| TYPE_NAME { $$ = $1; $$->type = TYPE_SPECIFIER; $$->deftype = mystrdup($$->data); } | TYPE_NAME { $$ = $1; $$->type = TYPE_SPECIFIER; }
; ;
struct_or_union_specifier struct_or_union_specifier
......
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