Skip to content

Commit 49fe95c

Browse files
committed
---
yaml --- r: 6596 b: refs/heads/master c: aa99bfa h: refs/heads/master v: v3
1 parent 32e6a4d commit 49fe95c

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 15d60326f67e84608ff8b2ffe1984d9b4d600ba6
2+
refs/heads/master: aa99bfa170971b14bb72a10ef153480ec4caaa46

trunk/src/comp/middle/trans.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4536,7 +4536,9 @@ fn zero_alloca(cx: @block_ctxt, llptr: ValueRef, t: ty::t)
45364536
fn trans_stmt(cx: @block_ctxt, s: ast::stmt) -> @block_ctxt {
45374537
// FIXME Fill in cx.sp
45384538

4539-
add_span_comment(cx, s.span, stmt_to_str(s));
4539+
if (!bcx_ccx(cx).sess.get_opts().no_asm_comments) {
4540+
add_span_comment(cx, s.span, stmt_to_str(s));
4541+
}
45404542

45414543
let bcx = cx;
45424544
alt s.node {

trunk/src/comp/middle/trans_build.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,9 @@ fn add_span_comment(bcx: @block_ctxt, sp: span, text: str) {
515515
fn add_comment(bcx: @block_ctxt, text: str) {
516516
let ccx = bcx_ccx(bcx);
517517
if (!ccx.sess.get_opts().no_asm_comments) {
518-
let comment_text = "; " + text;
518+
check str::is_not_empty("$");
519+
let sanitized = str::replace(text, "$", "");
520+
let comment_text = "; " + sanitized;
519521
let asm = str::as_buf(comment_text, { |c|
520522
str::as_buf("", { |e|
521523
llvm::LLVMConstInlineAsm(T_fn([], T_void()), c, e, 0, 0)})});

0 commit comments

Comments
 (0)