]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
ast_store to take ast_expression on its left, rather than ast_value. Assigning to...
authorWolfgang Bumiller <wolfgang.linux@bumiller.com>
Sat, 28 Jul 2012 16:13:12 +0000 (18:13 +0200)
committerWolfgang Bumiller <wolfgang.linux@bumiller.com>
Sat, 28 Jul 2012 16:13:12 +0000 (18:13 +0200)
ast.c
ast.h
test/ast-macros.h

diff --git a/ast.c b/ast.c
index 61b89e4caee5d78be54d00d201b126d6ac7542df..e153a5a7f57ef47b60d5a0f62b7f98e7da68b409 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -404,7 +404,7 @@ void ast_call_delete(ast_call *self)
 }
 
 ast_store* ast_store_new(lex_ctx ctx, int op,
-                         ast_value *dest, ast_expression *source)
+                         ast_expression *dest, ast_expression *source)
 {
     ast_instantiate(ast_store, ctx, ast_store_delete);
     ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_store_codegen);
diff --git a/ast.h b/ast.h
index 187ec882cb8093dc6f09d24374be9fa0944012e5..fc4fef3553e51dd08a9a8f12bffbdb83a36a0c73 100644 (file)
--- a/ast.h
+++ b/ast.h
@@ -218,11 +218,11 @@ struct ast_store_s
 {
     ast_expression_common expression;
     int             op;
-    ast_value      *dest; /* When we add pointers this might have to change to expression */
+    ast_expression *dest;
     ast_expression *source;
 };
 ast_store* ast_store_new(lex_ctx ctx, int op,
-                         ast_value *d, ast_expression *s);
+                         ast_expression *d, ast_expression *s);
 void ast_store_delete(ast_store*);
 
 bool ast_store_codegen(ast_store*, ast_function*, bool lvalue, ir_value**);
index c17b753696173db090398d7d78f713a15ecc0e07..ebb3a5bd6b7b09807622a90c8ef9523f0b09e4bb 100644 (file)
@@ -42,7 +42,7 @@ do {                                             \
 } while(0)
 
 #define ASSIGN(op, a, b) \
-(ast_expression*)ast_store_new(ctx, INSTR_##op, (a), (ast_expression*)(b))
+(ast_expression*)ast_store_new(ctx, INSTR_##op, (ast_expression*)(a), (ast_expression*)(b))
 
 #define BIN(op, a, b) \
 (ast_expression*)ast_binary_new(ctx, INSTR_##op, (ast_expression*)(a), (ast_expression*)(b))