do not stringify AST nodes unless emitting comments
This commit is contained in:
parent
15d60326f6
commit
aa99bfa170
@ -4536,7 +4536,9 @@ fn zero_alloca(cx: @block_ctxt, llptr: ValueRef, t: ty::t)
|
||||
fn trans_stmt(cx: @block_ctxt, s: ast::stmt) -> @block_ctxt {
|
||||
// FIXME Fill in cx.sp
|
||||
|
||||
add_span_comment(cx, s.span, stmt_to_str(s));
|
||||
if (!bcx_ccx(cx).sess.get_opts().no_asm_comments) {
|
||||
add_span_comment(cx, s.span, stmt_to_str(s));
|
||||
}
|
||||
|
||||
let bcx = cx;
|
||||
alt s.node {
|
||||
|
@ -515,7 +515,9 @@ fn add_span_comment(bcx: @block_ctxt, sp: span, text: str) {
|
||||
fn add_comment(bcx: @block_ctxt, text: str) {
|
||||
let ccx = bcx_ccx(bcx);
|
||||
if (!ccx.sess.get_opts().no_asm_comments) {
|
||||
let comment_text = "; " + text;
|
||||
check str::is_not_empty("$");
|
||||
let sanitized = str::replace(text, "$", "");
|
||||
let comment_text = "; " + sanitized;
|
||||
let asm = str::as_buf(comment_text, { |c|
|
||||
str::as_buf("", { |e|
|
||||
llvm::LLVMConstInlineAsm(T_fn([], T_void()), c, e, 0, 0)})});
|
||||
|
Loading…
x
Reference in New Issue
Block a user