Correct several uses of expr->literal to expr->string_literal.
authorChristoph Mallon <christoph.mallon@gmx.de>
Mon, 21 May 2012 10:51:28 +0000 (12:51 +0200)
committerChristoph Mallon <christoph.mallon@gmx.de>
Wed, 23 May 2012 04:53:41 +0000 (06:53 +0200)
This was harmless, because the accessed field (value) has the same offset in both structs.

ast2firm.c
attribute.c
format_check.c
parser.c

index 8a02168..3b7b991 100644 (file)
@@ -3358,7 +3358,7 @@ static ir_node *_expression_to_firm(expression_t const *const expr)
        case EXPR_VA_START:                   return va_start_expression_to_firm(     &expr->va_starte);
        case EXPR_WIDE_STRING_LITERAL:        return wide_string_literal_to_firm(     &expr->string_literal);
 
-       case EXPR_STRING_LITERAL: return string_to_firm(&expr->base.source_position, "str.%u", &expr->literal.value);
+       case EXPR_STRING_LITERAL: return string_to_firm(&expr->base.source_position, "str.%u", &expr->string_literal.value);
 
        case EXPR_ERROR: break;
        }
index ce97cc6..71f91d3 100644 (file)
@@ -228,7 +228,7 @@ static const char *get_argument_string(const attribute_argument_t *argument)
        expression_t *expression = argument->v.expression;
        if (expression->kind != EXPR_STRING_LITERAL)
                return NULL;
-       return expression->literal.value.begin;
+       return expression->string_literal.value.begin;
 }
 
 static void handle_attribute_visibility(const attribute_t *attribute,
index 332c9c6..fa6ffd1 100644 (file)
@@ -131,8 +131,8 @@ static int internal_check_printf_format(const expression_t *fmt_expr,
                        && fmt_expr->kind != EXPR_WIDE_STRING_LITERAL)
                return -1;
 
-       const char *string = fmt_expr->literal.value.begin;
-       size_t      size   = fmt_expr->literal.value.size;
+       const char *string = fmt_expr->string_literal.value.begin;
+       size_t      size   = fmt_expr->string_literal.value.size;
        const char *c      = string;
 
        const source_position_t *pos = &fmt_expr->base.source_position;
@@ -604,8 +604,8 @@ static void check_scanf_format(const call_argument_t *arg,
                        && fmt_expr->kind != EXPR_WIDE_STRING_LITERAL)
                return;
 
-       const char *string = fmt_expr->literal.value.begin;
-       size_t      size   = fmt_expr->literal.value.size;
+       const char *string = fmt_expr->string_literal.value.begin;
+       size_t      size   = fmt_expr->string_literal.value.size;
        const char *c      = string;
 
        /* find the real args */
index c542874..b2702de 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -5741,7 +5741,7 @@ static expression_t *parse_string_literal(void)
                literal->base.type = get_string_type();
        }
        literal->base.source_position = pos;
-       literal->literal.value        = res;
+       literal->string_literal.value = res;
 
        return literal;
 }