diff options
author | John Hodge <tpg@mutabah.net> | 2017-01-20 21:50:28 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2017-01-20 21:50:28 +0800 |
commit | 80fba399bb4a6f652a1a88e61522b73f96f1114b (patch) | |
tree | fdd55506524ac1db920d25cabec915e94a0d1df3 /src/trans/codegen_c.cpp | |
parent | 71d55f1e97d80b3f42610f7a8a22e57cafb46561 (diff) | |
download | mrust-80fba399bb4a6f652a1a88e61522b73f96f1114b.tar.gz |
MIR - Merging of drop flags
Diffstat (limited to 'src/trans/codegen_c.cpp')
-rw-r--r-- | src/trans/codegen_c.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/trans/codegen_c.cpp b/src/trans/codegen_c.cpp index 9af8875b..11a74b4f 100644 --- a/src/trans/codegen_c.cpp +++ b/src/trans/codegen_c.cpp @@ -1188,7 +1188,12 @@ namespace { case ::MIR::Statement::TAGDEAD: throw ""; case ::MIR::Statement::TAG_SetDropFlag: { const auto& e = stmt.as_SetDropFlag(); - m_of << "\tdf" << e.idx << " = " << e.new_val << ";\n"; + m_of << "\tdf" << e.idx << " = "; + if( e.other == ~0u ) + m_of << e.new_val; + else + m_of << (e.new_val ? "!" : "") << "df" << e.other; + m_of << ";\n"; break; } case ::MIR::Statement::TAG_Drop: { const auto& e = stmt.as_Drop(); |