about summary refs log tree commit diff
path: root/src/comp/middle
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2011-12-14 15:47:05 -0500
committerJosh Matthews <josh@joshmatthews.net>2011-12-18 23:48:04 -0500
commitc6f16ed2c418268f2acbb8728f265b3b960f8efd (patch)
tree181c56232f02f06e3ff0658612a5e3fceb5de681 /src/comp/middle
parent8597077b7ace2a16b3c6c7c9e37eeb47f758194f (diff)
Hide extended, unfinished debug information behind --xg compiler flag.
Diffstat (limited to 'src/comp/middle')
-rw-r--r--src/comp/middle/debuginfo.rs11
-rw-r--r--src/comp/middle/trans.rs10
2 files changed, 13 insertions, 8 deletions
diff --git a/src/comp/middle/debuginfo.rs b/src/comp/middle/debuginfo.rs
index 2c249a64d4a..14cc13e217e 100644
--- a/src/comp/middle/debuginfo.rs
+++ b/src/comp/middle/debuginfo.rs
@@ -782,9 +782,14 @@ fn create_function(fcx: @fn_ctxt, item: @ast::item, llfndecl: ValueRef)
     let ret_ty = alt item.node {
       ast::item_fn(f, _) { f.decl.output }
     };
-    let ty_node = alt ret_ty.node {
-      ast::ty_nil. { llnull() }
-      _ { create_ty(cx, ty::node_id_to_type(ccx_tcx(cx), item.id), ret_ty).node }
+    let ty_node = if cx.sess.get_opts().extra_debuginfo {
+        alt ret_ty.node {
+          ast::ty_nil. { llnull() }
+          _ { create_ty(cx, ty::node_id_to_type(ccx_tcx(cx), item.id),
+                        ret_ty).node }
+        }
+    } else {
+        llnull()
     };
     let sub_node = create_composite_type(SubroutineTag, "", file_node, 0, 0,
                                          0, 0, option::none,
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index 563f4d64cd2..b030a5d52c9 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -4027,7 +4027,7 @@ fn trans_stmt(cx: @block_ctxt, s: ast::stmt) -> @block_ctxt {
                 } else {
                     bcx = init_ref_local(bcx, local);
                 }
-                if bcx_ccx(cx).sess.get_opts().debuginfo {
+                if bcx_ccx(cx).sess.get_opts().extra_debuginfo {
                     debuginfo::create_local_var(bcx, local);
                 }
             }
@@ -4422,7 +4422,7 @@ fn create_llargs_for_fn_args(cx: @fn_ctxt, ty_self: self_arg,
 
 fn copy_args_to_allocas(fcx: @fn_ctxt, bcx: @block_ctxt, args: [ast::arg],
                         arg_tys: [ty::arg]) -> @block_ctxt {
-    if fcx_ccx(fcx).sess.get_opts().debuginfo {
+    if fcx_ccx(fcx).sess.get_opts().extra_debuginfo {
         llvm::LLVMAddAttribute(llvm::LLVMGetFirstParam(fcx.llfn),
                                lib::llvm::LLVMStructRetAttribute as
                                    lib::llvm::llvm::Attribute);
@@ -4446,7 +4446,7 @@ fn copy_args_to_allocas(fcx: @fn_ctxt, bcx: @block_ctxt, args: [ast::arg],
           }
           ast::by_ref. {}
         }
-        if fcx_ccx(fcx).sess.get_opts().debuginfo {
+        if fcx_ccx(fcx).sess.get_opts().extra_debuginfo {
             debuginfo::create_arg(bcx, args[arg_n]);
         }
         arg_n += 1u;
@@ -4584,7 +4584,7 @@ fn trans_fn(cx: @local_ctxt, sp: span, f: ast::_fn, llfndecl: ValueRef,
     let start = do_time ? time::get_time() : {sec: 0u32, usec: 0u32};
     let fcx = option::none;
     trans_closure(cx, sp, f, llfndecl, ty_self, ty_params, id, {|new_fcx| fcx = option::some(new_fcx);});
-    if cx.ccx.sess.get_opts().debuginfo {
+    if cx.ccx.sess.get_opts().extra_debuginfo {
         let item = alt option::get(cx.ccx.ast_map.find(id)) {
             ast_map::node_item(item) { item }
         };
@@ -5654,7 +5654,7 @@ fn trans_crate(sess: session::session, crate: @ast::crate, tcx: ty::ctxt,
     let td = mk_target_data(sess.get_targ_cfg().target_strs.data_layout);
     let tn = mk_type_names();
     let intrinsics = declare_intrinsics(llmod);
-    if sess.get_opts().debuginfo {
+    if sess.get_opts().extra_debuginfo {
         declare_dbg_intrinsics(llmod, intrinsics);
     }
     let int_type = T_int(targ_cfg);