Win32 Demo: OpenGL Context

This commit is contained in:
gingerBill
2016-08-16 20:08:40 +01:00
parent 2d49a61563
commit e8530ca883
14 changed files with 647 additions and 224 deletions
+9 -1
View File
@@ -210,7 +210,15 @@ void ssa_print_exact_value(gbFile *f, ssaModule *m, ExactValue value, Type *type
ssa_fprintf(f, "\"");
} break;
case ExactValue_Integer: {
ssa_fprintf(f, "%lld", value.value_integer);
if (is_type_pointer(get_base_type(type))) {
if (value.value_integer == 0) {
ssa_fprintf(f, "null");
} else {
GB_PANIC("TODO(bill): Pointer constant");
}
} else {
ssa_fprintf(f, "%lld", value.value_integer);
}
} break;
case ExactValue_Float: {
u64 u = *cast(u64*)&value.value_float;
+6 -1
View File
@@ -1355,6 +1355,11 @@ ssaValue *ssa_emit_conv(ssaProcedure *proc, ssaValue *value, Type *t) {
return ssa_emit(proc, ssa_make_instr_conv(proc, ssaConv_bitcast, value, src, dst));
}
// proc <-> proc
if (is_type_proc(src) && is_type_proc(dst)) {
return ssa_emit(proc, ssa_make_instr_conv(proc, ssaConv_bitcast, value, src, dst));
}
// []byte/[]u8 <-> string
if (is_type_u8_slice(src) && is_type_string(dst)) {
@@ -1743,7 +1748,7 @@ ssaValue *ssa_build_single_expr(ssaProcedure *proc, AstNode *expr, TypeAndValue
// NOTE(bill): Regular call
ssaValue *value = ssa_build_expr(proc, ce->proc);
Type *proc_type_ = ssa_value_type(value);
Type *proc_type_ = get_base_type(ssa_value_type(value));
GB_ASSERT(proc_type_->kind == Type_Proc);
auto *type = &proc_type_->proc;