bool ast_call_codegen(ast_call *self, ast_function *func, bool lvalue, ir_value **out)
{
- /* TODO: call ir codegen */
ast_expression_codegen *cgen;
ir_value_vector params;
ir_instr *callinstr;
MKGLOBAL(name); \
} while(0)
+#define MKCONSTSTRING(name, value) \
+do { \
+ name->isconst = true; \
+ name->constval.vstring = util_strdup(value); \
+ MKGLOBAL(name); \
+} while(0)
+
#define STATE(a) \
do { \
ast_expression *exp = (ast_expression*)(a); \
DEFVAR(f0);
DEFVAR(f1);
DEFVAR(f5);
+ DEFVAR(sHello);
DEFVAR(print);
/* opts_debug = true; */
VAR(TYPE_FLOAT, f0);
VAR(TYPE_FLOAT, f1);
VAR(TYPE_FLOAT, f5);
+VAR(TYPE_STRING, sHello);
MKCONSTFLOAT(f0, 0.0);
MKCONSTFLOAT(f1, 1.0);
MKCONSTFLOAT(f5, 5.0);
+MKCONSTSTRING(sHello, "Hello, World\n");
FUNCTION(foo, TYPE_VOID);
ENDFUNCTION(foo);