authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-02-05 13:12:06-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-02-05 13:12:06-05:00
log52eec6b9a60f18ef9818b38c83e8e056985acebd
tree5de700bad83f53cedb218c87e58c95fc8d713dbd
parent6f316d8ebd1d7e594b957bac16a5458b5d173481

`%=` in inline assembly survives optimization


2 files changed, 1 insertions(+), 6 deletions(-)

src/all_types.hpp-2
......@@ -1292,8 +1292,6 @@ struct CodeGen {
12921292
12931293 IrInstruction *invalid_instruction;
12941294 ConstExprValue const_void_val;
1295
1296 uint32_t unique_asm_id;
12971295};
12981296
12991297enum VarLinkage {
src/codegen.cpp+1-4
......@@ -1487,9 +1487,6 @@ static LLVMValueRef ir_render_asm(CodeGen *g, IrExecutable *executable, IrInstru
14871487 Buf llvm_template = BUF_INIT;
14881488 buf_resize(&llvm_template, 0);
14891489
1490 uint32_t unique_id = g->unique_asm_id;
1491 g->unique_asm_id += 1;
1492
14931490 for (size_t token_i = 0; token_i < asm_expr->token_list.length; token_i += 1) {
14941491 AsmToken *asm_token = &asm_expr->token_list.at(token_i);
14951492 switch (asm_token->id) {
......@@ -1514,7 +1511,7 @@ static LLVMValueRef ir_render_asm(CodeGen *g, IrExecutable *executable, IrInstru
15141511 break;
15151512 }
15161513 case AsmTokenIdUniqueId:
1517 buf_appendf(&llvm_template, "%" PRIu32, unique_id);
1514 buf_append_str(&llvm_template, "${:uid}");
15181515 break;
15191516 }
15201517 }