@@ -16,22 +16,23 @@ void process_enum_name_value(const char * p, int val)
16
16
fprintf ( code_outputfile ,"ENUM : %s %d" ,p ,val );
17
17
}
18
18
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" );
21
21
tree tv ;
22
22
/* Output the list of possible values for the enumeration type. */
23
23
for (tv = TYPE_VALUES (enumeral_type ); tv ; tv = TREE_CHAIN (tv ))
24
24
{
25
- fprintf ( code_outputfile , "ENUM VALUE\n" );
25
+
26
26
tree v = TREE_VALUE (tv );
27
27
// GCC 4.4 switched to consts for enum values
28
28
if (TREE_CODE (v ) == CONST_DECL )
29
29
v = DECL_INITIAL (v );
30
30
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);
32
33
33
34
}
34
- fprintf ( code_outputfile ,"END ENUM \n" );
35
+ fprintf ( code_outputfile ,"0),/*enum*/ \n" );
35
36
// if we want to generate code for the enum :
36
37
// process_enum_tree_code(enumeral_type);
37
38
}
0 commit comments