Fix formatting of multi-line blocks in asm-comments

This commit is contained in:
Damian Gryski 2012-07-23 23:18:12 +02:00
parent f676547c97
commit 9b02acbc5d

View file

@ -653,7 +653,7 @@ fn add_comment(bcx: block, text: ~str) {
let ccx = bcx.ccx();
if !ccx.sess.no_asm_comments() {
let sanitized = str::replace(text, ~"$", ~"");
let comment_text = ~"# " + sanitized;
let comment_text = ~"# " + str::replace(sanitized, ~"\n", ~"\n\t# ");
let asm = str::as_c_str(comment_text, |c| {
str::as_c_str(~"", |e| {
count_insn(bcx, ~"inlineasm");