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 {...@@ -1292,8 +1292,6 @@ struct CodeGen {
12921292
1293 IrInstruction *invalid_instruction;1293 IrInstruction *invalid_instruction;
1294 ConstExprValue const_void_val;1294 ConstExprValue const_void_val;
1295
1296 uint32_t unique_asm_id;
1297};1295};
12981296
1299enum VarLinkage {1297enum VarLinkage {
src/codegen.cpp+1-4
...@@ -1487,9 +1487,6 @@ static LLVMValueRef ir_render_asm(CodeGen *g, IrExecutable *executable, IrInstru...@@ -1487,9 +1487,6 @@ static LLVMValueRef ir_render_asm(CodeGen *g, IrExecutable *executable, IrInstru
1487 Buf llvm_template = BUF_INIT;1487 Buf llvm_template = BUF_INIT;
1488 buf_resize(&llvm_template, 0);1488 buf_resize(&llvm_template, 0);
14891489
1490 uint32_t unique_id = g->unique_asm_id;
1491 g->unique_asm_id += 1;
1492
1493 for (size_t token_i = 0; token_i < asm_expr->token_list.length; token_i += 1) {1490 for (size_t token_i = 0; token_i < asm_expr->token_list.length; token_i += 1) {
1494 AsmToken *asm_token = &asm_expr->token_list.at(token_i);1491 AsmToken *asm_token = &asm_expr->token_list.at(token_i);
1495 switch (asm_token->id) {1492 switch (asm_token->id) {
...@@ -1514,7 +1511,7 @@ static LLVMValueRef ir_render_asm(CodeGen *g, IrExecutable *executable, IrInstru...@@ -1514,7 +1511,7 @@ static LLVMValueRef ir_render_asm(CodeGen *g, IrExecutable *executable, IrInstru
1514 break;1511 break;
1515 }1512 }
1516 case AsmTokenIdUniqueId:1513 case AsmTokenIdUniqueId:
1517 buf_appendf(&llvm_template, "%" PRIu32, unique_id);1514 buf_append_str(&llvm_template, "${:uid}");
1518 break;1515 break;
1519 }1516 }
1520 }1517 }