ir.c
// Add an instruction to load a value from the GOT. The result is a pointer to the
// value.
Add an instruction to load a value from the GOT. The result is a pointer to the
value.
Add an instruction to load a value from the GOT . The result is a pointer to the value .
Value *add_load_from_tac(Function *function, Tac *tac, Value *src) {
    Value *dst = new_value();
    dst->vreg = ++function->vreg_count;
    dst->type = make_pointer(src->type);
    Value *got_src = dup_value(src);
    got_src->type = dst->type;
    insert_instruction_from_operation(tac, IR_LOAD_FROM_GOT, dst, got_src, 0, 0);
    dst->offset = src->offset;
    src->offset = 0;
    got_src->offset = 0;
    return dst;
}
Value * add_load_from_tac ( Function * function , Tac * tac , Value * src ) { Value * dst = new_value ( ) ; dst -> vreg = ++ function -> vreg_count ; dst -> type = make_pointer ( src -> type ) ; Value * got_src = dup_value ( src ) ; got_src -> type = dst -> type ; insert_instruction_from_operation ( tac , IR_LOAD_FROM_GOT , dst , got_src , 0 , 0 ) ; dst -> offset = src -> offset ; src -> offset = 0 ; got_src -> offset = 0 ; return dst ; }
Add an instruction to load a value from the GOT.
Add an instruction to load a value from the GOT .