diff options
author | John Hodge <tpg@mutabah.net> | 2016-12-04 17:25:50 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-12-04 17:25:50 +0800 |
commit | 7c253cf4cc0e0fb4508362dbfe5389d7054198dc (patch) | |
tree | d47cdae8a83bcee3d8d614c8cce32f92c4707d18 /src | |
parent | 0fa897c376084e2719c00af35bc3d8b6c0c02da9 (diff) | |
download | mrust-7c253cf4cc0e0fb4508362dbfe5389d7054198dc.tar.gz |
Trans C - Annotation comments on variables
Diffstat (limited to 'src')
-rw-r--r-- | src/trans/codegen_c.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/trans/codegen_c.cpp b/src/trans/codegen_c.cpp index fc7310a0..6fca8016 100644 --- a/src/trans/codegen_c.cpp +++ b/src/trans/codegen_c.cpp @@ -221,11 +221,15 @@ namespace { m_of << "\t"; emit_ctype(params.monomorph(m_crate, item.m_return)); m_of << " rv;\n"; for(unsigned int i = 0; i < code->named_variables.size(); i ++) { DEBUG("var" << i << " : " << code->named_variables[i]); - m_of << "\t"; emit_ctype(code->named_variables[i]); m_of << " var" << i << ";\n"; + m_of << "\t"; emit_ctype(code->named_variables[i]); m_of << " var" << i << ";"; + m_of << "\t// " << code->named_variables[i]; + m_of << "\n"; } for(unsigned int i = 0; i < code->temporaries.size(); i ++) { DEBUG("tmp" << i << " : " << code->temporaries[i]); - m_of << "\t"; emit_ctype(code->temporaries[i]); m_of << " tmp" << i << ";\n"; + m_of << "\t"; emit_ctype(code->temporaries[i]); m_of << " tmp" << i << ";"; + m_of << "\t// " << code->temporaries[i]; + m_of << "\n"; } // TODO: Code. for(unsigned int i = 0; i < code->blocks.size(); i ++) |