Rename EXPR_REFERENCE_ENUM_VALUE to EXPR_ENUM_CONSTANT.
authorChristoph Mallon <christoph.mallon@gmx.de>
Tue, 17 Apr 2012 11:00:04 +0000 (13:00 +0200)
committerChristoph Mallon <christoph.mallon@gmx.de>
Tue, 24 Apr 2012 12:51:36 +0000 (14:51 +0200)
This is closer to what the C standard calls it (enumeration constant).

ast.c
ast2firm.c
ast_t.h
parser.c
walk.c
wrappergen/write_jna.c

diff --git a/ast.c b/ast.c
index 586ce2b..ad7bab9 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -103,7 +103,7 @@ static unsigned get_expression_precedence(expression_kind_t kind)
        static const unsigned prec[] = {
                [EXPR_ERROR]                             = PREC_PRIMARY,
                [EXPR_REFERENCE]                         = PREC_PRIMARY,
-               [EXPR_REFERENCE_ENUM_VALUE]              = PREC_PRIMARY,
+               [EXPR_ENUM_CONSTANT]                     = PREC_PRIMARY,
                [EXPR_LITERAL_INTEGER]                   = PREC_PRIMARY,
                [EXPR_LITERAL_INTEGER_OCTAL]             = PREC_PRIMARY,
                [EXPR_LITERAL_INTEGER_HEXADECIMAL]       = PREC_PRIMARY,
@@ -693,7 +693,7 @@ static void print_expression_prec(expression_t const *expr, unsigned const top_p
        case EXPR_LITERAL_CASES:              print_literal(                 &expr->literal);                  break;
        case EXPR_OFFSETOF:                   print_offsetof_expression(     &expr->offsetofe);                break;
        case EXPR_REFERENCE:
-       case EXPR_REFERENCE_ENUM_VALUE:       print_reference_expression(    &expr->reference);                break;
+       case EXPR_ENUM_CONSTANT:              print_reference_expression(    &expr->reference);                break;
        case EXPR_SELECT:                     print_select(                  &expr->select);                   break;
        case EXPR_STATEMENT:                  print_statement_expression(    &expr->statement);                break;
        case EXPR_STRING_LITERAL:
@@ -1778,7 +1778,7 @@ expression_classification_t is_constant_expression(const expression_t *expressio
        case EXPR_ALIGNOF:
        case EXPR_BUILTIN_CONSTANT_P:
        case EXPR_BUILTIN_TYPES_COMPATIBLE_P:
-       case EXPR_REFERENCE_ENUM_VALUE:
+       case EXPR_ENUM_CONSTANT:
                return EXPR_CLASS_CONSTANT;
 
        case EXPR_SIZEOF: {
index 098d126..5f7f660 100644 (file)
@@ -3450,7 +3450,7 @@ static ir_node *_expression_to_firm(const expression_t *expression)
                return wide_string_literal_to_firm(&expression->string_literal);
        case EXPR_REFERENCE:
                return reference_expression_to_firm(&expression->reference);
-       case EXPR_REFERENCE_ENUM_VALUE:
+       case EXPR_ENUM_CONSTANT:
                return enum_constant_to_firm(&expression->reference);
        case EXPR_CALL:
                return call_expression_to_firm(&expression->call);
diff --git a/ast_t.h b/ast_t.h
index 258bbb8..dfe84fa 100644 (file)
--- a/ast_t.h
+++ b/ast_t.h
@@ -64,7 +64,7 @@ typedef enum precedence_t {
 typedef enum expression_kind_t {
        EXPR_ERROR = 1,
        EXPR_REFERENCE,
-       EXPR_REFERENCE_ENUM_VALUE,
+       EXPR_ENUM_CONSTANT,
        EXPR_LITERAL_BOOLEAN,
        EXPR_LITERAL_INTEGER,
        EXPR_LITERAL_INTEGER_OCTAL,
index 73b0209..1a64f74 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -320,7 +320,7 @@ static size_t get_expression_struct_size(expression_kind_t kind)
        static const size_t sizes[] = {
                [EXPR_ERROR]                      = sizeof(expression_base_t),
                [EXPR_REFERENCE]                  = sizeof(reference_expression_t),
-               [EXPR_REFERENCE_ENUM_VALUE]       = sizeof(reference_expression_t),
+               [EXPR_ENUM_CONSTANT]              = sizeof(reference_expression_t),
                [EXPR_LITERAL_BOOLEAN]            = sizeof(literal_expression_t),
                [EXPR_LITERAL_INTEGER]            = sizeof(literal_expression_t),
                [EXPR_LITERAL_INTEGER_OCTAL]      = sizeof(literal_expression_t),
@@ -1536,7 +1536,7 @@ unary:
                case EXPR_OFFSETOF:
                case EXPR_STATEMENT: // TODO
                case EXPR_LABEL_ADDRESS:
-               case EXPR_REFERENCE_ENUM_VALUE:
+               case EXPR_ENUM_CONSTANT:
                        return;
        }
 
@@ -4741,7 +4741,7 @@ static bool expression_returns(expression_t const *const expr)
                }
 
                case EXPR_REFERENCE:
-               case EXPR_REFERENCE_ENUM_VALUE:
+               case EXPR_ENUM_CONSTANT:
                case EXPR_LITERAL_CASES:
                case EXPR_STRING_LITERAL:
                case EXPR_WIDE_STRING_LITERAL:
@@ -6233,7 +6233,7 @@ static expression_t *parse_reference(void)
 
        expression_kind_t kind = EXPR_REFERENCE;
        if (entity->kind == ENTITY_ENUM_VALUE)
-               kind = EXPR_REFERENCE_ENUM_VALUE;
+               kind = EXPR_ENUM_CONSTANT;
 
        expression_t *expression         = allocate_expression_zero(kind);
        expression->base.source_position = pos;
@@ -8543,7 +8543,7 @@ static bool expression_has_effect(const expression_t *const expr)
        switch (expr->kind) {
                case EXPR_ERROR:                      return true; /* do NOT warn */
                case EXPR_REFERENCE:                  return false;
-               case EXPR_REFERENCE_ENUM_VALUE:       return false;
+               case EXPR_ENUM_CONSTANT:              return false;
                case EXPR_LABEL_ADDRESS:              return false;
 
                /* suppress the warning for microsoft __noop operations */
diff --git a/walk.c b/walk.c
index 62a46a2..6162229 100644 (file)
--- a/walk.c
+++ b/walk.c
@@ -178,7 +178,7 @@ static void walk_expression(expression_t *const expr,
 
        case EXPR_LITERAL_CASES:
        case EXPR_REFERENCE:
-       case EXPR_REFERENCE_ENUM_VALUE:
+       case EXPR_ENUM_CONSTANT:
        case EXPR_STRING_LITERAL:
        case EXPR_WIDE_STRING_LITERAL:
        case EXPR_FUNCNAME:
index 09ef6aa..d005b46 100644 (file)
@@ -314,7 +314,7 @@ static void write_expression(const expression_t *expression)
        case EXPR_LITERAL_INTEGER_HEXADECIMAL:
                fprintf(out, "0x%s", expression->literal.value.begin);
                break;
-       case EXPR_REFERENCE_ENUM_VALUE: {
+       case EXPR_ENUM_CONSTANT: {
                /* UHOH... hacking */
                entity_t *entity = expression->reference.entity;
                write_enum_name(& entity->enum_value.enum_type->enumt);