void ast_type_to_string(ast_expression *e, char *buf, size_t bufsize);
typedef enum ast_binary_ref_s {
+ AST_REF_NONE = 0,
AST_REF_LEFT = 1 << 1,
AST_REF_RIGHT = 1 << 2,
AST_REF_ALL = (AST_REF_LEFT | AST_REF_RIGHT)
if(CanConstFold(exprs[0], exprs[1])) {
out = (ast_expression*)parser_const_float(parser, (float)((qcint)(ConstF(0)) ^ ((qcint)(ConstF(1)))));
} else {
+ ast_binary *expr = ast_binary_new(
+ ctx,
+ INSTR_SUB_F,
+ (ast_expression*)parser_const_float_neg1(parser),
+ (ast_expression*)ast_binary_new(
+ ctx,
+ INSTR_BITAND,
+ exprs[0],
+ exprs[1]
+ )
+ );
+ expr->refs = AST_REF_NONE;
+
out = (ast_expression*)
ast_binary_new(
ctx,
exprs[0],
exprs[1]
),
- (ast_expression*)ast_binary_new(
- ctx,
- INSTR_SUB_F,
- (ast_expression*)parser_const_float_neg1(parser),
- (ast_expression*)ast_binary_new(
- ctx,
- INSTR_BITAND,
- exprs[0],
- exprs[1]
- )
- )
+ (ast_expression*)expr
);
}
break;
} else {
ast_binary *eq = ast_binary_new(ctx, INSTR_EQ_F, exprs[0], exprs[1]);
- eq->refs = (ast_binary_ref)false; /* references nothing */
+ eq->refs = AST_REF_NONE;
/* if (lt) { */
out = (ast_expression*)ast_ternary_new(ctx,