mirror of
https://github.com/ziglang/zig.git
synced 2026-11-22 04:37:39 -05:00
add concept of inline for, inline while, inline var
This commit is contained in:
1 parent
1a0111d4c3
commit
c8333d0cc9
8 files changed
+217
-108
No files matched your search
+3
-3
@@ -4105,7 +4105,7 @@ static void build_all_basic_blocks(CodeGen *g, FnTableEntry *fn) {
|
||||
static void gen_global_var(CodeGen *g, VariableTableEntry *var, LLVMValueRef init_val,
|
||||
TypeTableEntry *type_entry)
|
||||
{
|
||||
assert(var->is_const);
|
||||
assert(var->gen_is_const);
|
||||
assert(var->import);
|
||||
assert(type_entry);
|
||||
bool is_local_to_unit = true;
|
||||
@@ -4183,12 +4183,12 @@ static void do_code_gen(CodeGen *g) {
|
||||
LLVMSetUnnamedAddr(global_value, true);
|
||||
|
||||
// TODO debug info for function pointers
|
||||
if (var->is_const && var->type->id != TypeTableEntryIdFn) {
|
||||
if (var->gen_is_const && var->type->id != TypeTableEntryIdFn) {
|
||||
gen_global_var(g, var, init_val, var->type);
|
||||
}
|
||||
}
|
||||
|
||||
LLVMSetGlobalConstant(global_value, var->is_const);
|
||||
LLVMSetGlobalConstant(global_value, var->gen_is_const);
|
||||
|
||||
var->value_ref = global_value;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user