about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2011-05-10 17:58:11 -0700
committerGraydon Hoare <graydon@mozilla.com>2011-05-10 18:07:40 -0700
commitcf3e737eeeabb26ca555fd8ed85f4df7317e992a (patch)
treeac21edda19429e1d0741168c8151090576706290 /src
parent869e9017ebfbb222503c503a1b319b5a3e81f74b (diff)
downloadrust-cf3e737eeeabb26ca555fd8ed85f4df7317e992a.tar.gz
rust-cf3e737eeeabb26ca555fd8ed85f4df7317e992a.zip
Avoid mangle_name_by_type_only call in tydesc names unless debugging.
Diffstat (limited to 'src')
-rw-r--r--src/comp/middle/trans.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index 4f9de4965ca..95183c531ed 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -1783,7 +1783,14 @@ fn declare_tydesc(@local_ctxt cx, ty.t t) -> @tydesc_info {
 
     auto glue_fn_ty = T_ptr(T_glue_fn(ccx.tn));
 
-    auto name = mangle_name_by_type_only(ccx, t, "tydesc");
+    auto name;
+    if (cx.ccx.sess.get_opts().debuginfo) {
+        name = mangle_name_by_type_only(cx.ccx, t, "tydesc");
+        name = sanitize(name);
+    } else {
+        name = mangle_name_by_seq(cx.ccx, cx.path, "tydesc");
+    }
+
     auto gvar = llvm.LLVMAddGlobal(ccx.llmod, T_tydesc(ccx.tn),
                                    Str.buf(name));
     auto tydesc = C_struct(vec(C_null(T_ptr(T_ptr(T_tydesc(ccx.tn)))),