Skip to content

Commit 10e3ab8

Browse files
James Michael DuPontJames Michael DuPont
James Michael DuPont
authored and
James Michael DuPont
committed
example of gcc regenerator
1 parent 16d0c8a commit 10e3ab8

8 files changed

+353
-1730
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ cxxml : plugin.cpp
5757
gccxml -fxml=plugin.xml -fpermissive -I $(GCCPLUGINS_DIR) plugin.cpp
5858

5959

60-
reprocess : testoutput.c
61-
gcc testoutput.c
60+
reprocess : example_output.c gccinterface.c
61+
gcc example_output.c gccinterface.c

enum.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,23 @@ void process_enum_name_value(const char * p, int val)
1616
fprintf( code_outputfile,"ENUM : %s %d",p,val);
1717
}
1818

19-
void process_enum ( tree enumeral_type) {
20-
fprintf( code_outputfile,"BEGIN ENUM\n");
19+
void process_enum_emit ( tree enumeral_type) {
20+
fprintf( code_outputfile,"ENUM(\n");
2121
tree tv;
2222
/* Output the list of possible values for the enumeration type. */
2323
for (tv = TYPE_VALUES (enumeral_type); tv ; tv = TREE_CHAIN (tv))
2424
{
25-
fprintf( code_outputfile,"ENUM VALUE\n");
25+
2626
tree v = TREE_VALUE (tv);
2727
// GCC 4.4 switched to consts for enum values
2828
if (TREE_CODE (v) == CONST_DECL)
2929
v = DECL_INITIAL (v);
3030
int value = TREE_INT_CST_LOW (v);
31-
process_enum_name_value(IDENTIFIER_POINTER (TREE_PURPOSE (tv)),value);
31+
fprintf( code_outputfile,"ENUMVALUE(\"%s\",%d),\n",IDENTIFIER_POINTER (TREE_PURPOSE (tv)),value);
32+
//process_enum_name_value(IDENTIFIER_POINTER (TREE_PURPOSE (tv)),value);
3233

3334
}
34-
fprintf( code_outputfile,"END ENUM\n");
35+
fprintf( code_outputfile,"0),/*enum*/\n");
3536
// if we want to generate code for the enum :
3637
// process_enum_tree_code(enumeral_type);
3738
}

0 commit comments

Comments
 (0)