diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-08-25 04:48:58 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-08-25 04:48:58 -0400 |
| commit | 815950996dcc92ac6ac285f2005dbac51b9cb6f8 (patch) | |
| tree | 1f77690a5fb7ccbef75bcab9c8c1e008ef3c5068 /src | |
| parent | 8aacfc846523aad142537b2bff49162d5feb6a91 (diff) | |
| parent | bf1f91595d4d3b5911632c671ef16e44d70dc9a6 (diff) | |
| download | zig-815950996dcc92ac6ac285f2005dbac51b9cb6f8.tar.gz zig-815950996dcc92ac6ac285f2005dbac51b9cb6f8.zip | |
Merge remote-tracking branch 'origin/master' into macos-stack-traces
Diffstat (limited to 'src')
| -rw-r--r-- | src/all_types.hpp | 4 | ||||
| -rw-r--r-- | src/analyze.cpp | 2 | ||||
| -rw-r--r-- | src/codegen.cpp | 6 | ||||
| -rw-r--r-- | src/ir.cpp | 12 |
4 files changed, 12 insertions, 12 deletions
diff --git a/src/all_types.hpp b/src/all_types.hpp index b1e8a3746d..a8dd9dde83 100644 --- a/src/all_types.hpp +++ b/src/all_types.hpp @@ -1852,7 +1852,7 @@ struct ScopeDecls { HashMap<Buf *, Tld *, buf_hash, buf_eql_buf> decl_table; bool safety_off; AstNode *safety_set_node; - bool fast_math_off; + bool fast_math_on; AstNode *fast_math_set_node; ImportTableEntry *import; // If this is a scope from a container, this is the type entry, otherwise null @@ -1872,7 +1872,7 @@ struct ScopeBlock { bool safety_off; AstNode *safety_set_node; - bool fast_math_off; + bool fast_math_on; AstNode *fast_math_set_node; }; diff --git a/src/analyze.cpp b/src/analyze.cpp index eb43575d62..a8b3ea7132 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -3073,7 +3073,7 @@ static bool scope_is_root_decls(Scope *scope) { static void wrong_panic_prototype(CodeGen *g, AstNode *proto_node, TypeTableEntry *fn_type) { add_node_error(g, proto_node, - buf_sprintf("expected 'fn([]const u8, ?&builtin.StackTrace) unreachable', found '%s'", + buf_sprintf("expected 'fn([]const u8, ?*builtin.StackTrace) noreturn', found '%s'", buf_ptr(&fn_type->name))); } diff --git a/src/codegen.cpp b/src/codegen.cpp index 56d15a43dc..7ea322c1c3 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -829,15 +829,15 @@ static bool ir_want_fast_math(CodeGen *g, IrInstruction *instruction) { if (scope->id == ScopeIdBlock) { ScopeBlock *block_scope = (ScopeBlock *)scope; if (block_scope->fast_math_set_node) - return !block_scope->fast_math_off; + return block_scope->fast_math_on; } else if (scope->id == ScopeIdDecls) { ScopeDecls *decls_scope = (ScopeDecls *)scope; if (decls_scope->fast_math_set_node) - return !decls_scope->fast_math_off; + return decls_scope->fast_math_on; } scope = scope->parent; } - return true; + return false; } static bool ir_want_runtime_safety(CodeGen *g, IrInstruction *instruction) { diff --git a/src/ir.cpp b/src/ir.cpp index 363d49feed..5bf39ee691 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -15203,17 +15203,17 @@ static TypeTableEntry *ir_analyze_instruction_set_float_mode(IrAnalyze *ira, return ira->codegen->builtin_types.entry_void; } - bool *fast_math_off_ptr; + bool *fast_math_on_ptr; AstNode **fast_math_set_node_ptr; if (target_type->id == TypeTableEntryIdBlock) { ScopeBlock *block_scope = (ScopeBlock *)target_val->data.x_block; - fast_math_off_ptr = &block_scope->fast_math_off; + fast_math_on_ptr = &block_scope->fast_math_on; fast_math_set_node_ptr = &block_scope->fast_math_set_node; } else if (target_type->id == TypeTableEntryIdFn) { assert(target_val->data.x_ptr.special == ConstPtrSpecialFunction); FnTableEntry *target_fn = target_val->data.x_ptr.data.fn.fn_entry; assert(target_fn->def_scope); - fast_math_off_ptr = &target_fn->def_scope->fast_math_off; + fast_math_on_ptr = &target_fn->def_scope->fast_math_on; fast_math_set_node_ptr = &target_fn->def_scope->fast_math_set_node; } else if (target_type->id == TypeTableEntryIdMetaType) { ScopeDecls *decls_scope; @@ -15229,7 +15229,7 @@ static TypeTableEntry *ir_analyze_instruction_set_float_mode(IrAnalyze *ira, buf_sprintf("expected scope reference, found type '%s'", buf_ptr(&type_arg->name))); return ira->codegen->builtin_types.entry_invalid; } - fast_math_off_ptr = &decls_scope->fast_math_off; + fast_math_on_ptr = &decls_scope->fast_math_on; fast_math_set_node_ptr = &decls_scope->fast_math_set_node; } else { ir_add_error_node(ira, target_instruction->source_node, @@ -15251,7 +15251,7 @@ static TypeTableEntry *ir_analyze_instruction_set_float_mode(IrAnalyze *ira, return ira->codegen->builtin_types.entry_invalid; } *fast_math_set_node_ptr = source_node; - *fast_math_off_ptr = (float_mode_scalar == FloatModeStrict); + *fast_math_on_ptr = (float_mode_scalar == FloatModeOptimized); ir_build_const_from(ira, &instruction->base); return ira->codegen->builtin_types.entry_void; @@ -17093,7 +17093,7 @@ static ConstExprValue *create_ptr_like_type_info(IrAnalyze *ira, TypeTableEntry // alignment: u32 ensure_field_index(result->type, "alignment", 3); fields[3].special = ConstValSpecialStatic; - fields[3].type = ira->codegen->builtin_types.entry_u32; + fields[3].type = get_int_type(ira->codegen, false, 29); bigint_init_unsigned(&fields[3].data.x_bigint, attrs_type->data.pointer.alignment); // child: type ensure_field_index(result->type, "child", 4); |
