about summary refs log tree commit diff
path: root/src/rustc/back
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-08-01 17:30:05 -0700
committerBrian Anderson <banderson@mozilla.com>2012-08-01 19:16:06 -0700
commitb355936b4da0831f47afe8f251daee503c8caa32 (patch)
tree9f870e26f773af714cbcf7f315de5ff3722300c3 /src/rustc/back
parentdc499f193e473abc78c557feaa86969bbe7aa159 (diff)
downloadrust-b355936b4da0831f47afe8f251daee503c8caa32.tar.gz
rust-b355936b4da0831f47afe8f251daee503c8caa32.zip
Convert ret to return
Diffstat (limited to 'src/rustc/back')
-rw-r--r--src/rustc/back/abi.rs8
-rw-r--r--src/rustc/back/link.rs54
-rw-r--r--src/rustc/back/rpath.rs10
-rw-r--r--src/rustc/back/upcall.rs4
-rw-r--r--src/rustc/back/x86.rs2
-rw-r--r--src/rustc/back/x86_64.rs2
6 files changed, 40 insertions, 40 deletions
diff --git a/src/rustc/back/abi.rs b/src/rustc/back/abi.rs
index 8213ff1576e..706c8ed991e 100644
--- a/src/rustc/back/abi.rs
+++ b/src/rustc/back/abi.rs
@@ -66,13 +66,13 @@ const worst_case_glue_call_args: uint = 7u;
 
 const abi_version: uint = 1u;
 
-fn memcpy_glue_name() -> ~str { ret ~"rust_memcpy_glue"; }
+fn memcpy_glue_name() -> ~str { return ~"rust_memcpy_glue"; }
 
-fn bzero_glue_name() -> ~str { ret ~"rust_bzero_glue"; }
+fn bzero_glue_name() -> ~str { return ~"rust_bzero_glue"; }
 
-fn yield_glue_name() -> ~str { ret ~"rust_yield_glue"; }
+fn yield_glue_name() -> ~str { return ~"rust_yield_glue"; }
 
-fn no_op_type_glue_name() -> ~str { ret ~"rust_no_op_type_glue"; }
+fn no_op_type_glue_name() -> ~str { return ~"rust_no_op_type_glue"; }
 //
 // Local Variables:
 // mode: rust
diff --git a/src/rustc/back/link.rs b/src/rustc/back/link.rs
index fede7d55af9..7e6c9567b4b 100644
--- a/src/rustc/back/link.rs
+++ b/src/rustc/back/link.rs
@@ -51,9 +51,9 @@ mod write {
     fn is_object_or_assembly_or_exe(ot: output_type) -> bool {
         if ot == output_type_assembly || ot == output_type_object ||
                ot == output_type_exe {
-            ret true;
+            return true;
         }
-        ret false;
+        return false;
     }
 
     // Decides what to call an intermediate file, given the name of the output
@@ -64,7 +64,7 @@ mod write {
           some(dot_pos) { str::slice(output_path, 0u, dot_pos) }
           none { output_path }
         };
-        ret stem + ~"." + extension;
+        return stem + ~"." + extension;
     }
 
     fn run_passes(sess: session, llmod: ModuleRef, output: ~str) {
@@ -234,7 +234,7 @@ mod write {
 
             llvm::LLVMDisposeModule(llmod);
             if sess.time_llvm_passes() { llvm::LLVMRustPrintPassTimings(); }
-            ret;
+            return;
         }
 
         if opts.output_type == output_type_llvm_assembly {
@@ -334,7 +334,7 @@ fn build_link_meta(sess: session, c: ast::crate, output: ~str,
                 }
             } else { vec::push(cmh_items, meta); }
         }
-        ret {name: name, vers: vers, cmh_items: cmh_items};
+        return {name: name, vers: vers, cmh_items: cmh_items};
     }
 
     // This calculates CMH as defined above
@@ -343,11 +343,11 @@ fn build_link_meta(sess: session, c: ast::crate, output: ~str,
                               metas: provided_metas,
                               dep_hashes: ~[@~str]) -> ~str {
         fn len_and_str(s: ~str) -> ~str {
-            ret fmt!{"%u_%s", str::len(s), s};
+            return fmt!{"%u_%s", str::len(s), s};
         }
 
         fn len_and_str_lit(l: ast::lit) -> ~str {
-            ret len_and_str(pprust::lit_to_str(@l));
+            return len_and_str(pprust::lit_to_str(@l));
         }
 
         let cmh_items = attr::sort_meta_items(metas.cmh_items);
@@ -374,18 +374,18 @@ fn build_link_meta(sess: session, c: ast::crate, output: ~str,
             symbol_hasher.input_str(len_and_str(*dh));
         }
 
-        ret truncated_hash_result(symbol_hasher);
+        return truncated_hash_result(symbol_hasher);
     }
 
     fn warn_missing(sess: session, name: ~str, default: ~str) {
-        if !sess.building_library { ret; }
+        if !sess.building_library { return; }
         sess.warn(fmt!{"missing crate link meta `%s`, using `%s` as default",
                        name, default});
     }
 
     fn crate_meta_name(sess: session, _crate: ast::crate,
                        output: ~str, metas: provided_metas) -> @~str {
-        ret alt metas.name {
+        return alt metas.name {
               some(v) { v }
               none {
                 let name =
@@ -407,7 +407,7 @@ fn build_link_meta(sess: session, c: ast::crate, output: ~str,
 
     fn crate_meta_vers(sess: session, _crate: ast::crate,
                        metas: provided_metas) -> @~str {
-        ret alt metas.vers {
+        return alt metas.vers {
               some(v) { v }
               none {
                 let vers = ~"0.0";
@@ -424,7 +424,7 @@ fn build_link_meta(sess: session, c: ast::crate, output: ~str,
     let extras_hash =
         crate_meta_extras_hash(symbol_hasher, c, provided_metas, dep_hashes);
 
-    ret {name: name, vers: vers, extras_hash: extras_hash};
+    return {name: name, vers: vers, extras_hash: extras_hash};
 }
 
 fn truncated_hash_result(symbol_hasher: hash::streaming) -> ~str unsafe {
@@ -447,16 +447,16 @@ fn symbol_hash(tcx: ty::ctxt, symbol_hasher: hash::streaming, t: ty::t,
     let hash = truncated_hash_result(symbol_hasher);
     // Prefix with _ so that it never blends into adjacent digits
 
-    ret ~"_" + hash;
+    return ~"_" + hash;
 }
 
 fn get_symbol_hash(ccx: @crate_ctxt, t: ty::t) -> ~str {
     alt ccx.type_hashcodes.find(t) {
-      some(h) { ret h; }
+      some(h) { return h; }
       none {
         let hash = symbol_hash(ccx.tcx, ccx.symbol_hasher, t, ccx.link_meta);
         ccx.type_hashcodes.insert(t, hash);
-        ret hash;
+        return hash;
       }
     }
 }
@@ -491,10 +491,10 @@ fn sanitize(s: ~str) -> ~str {
     if result.len() > 0u &&
         result[0] != '_' as u8 &&
         ! char::is_XID_start(result[0] as char) {
-        ret ~"_" + result;
+        return ~"_" + result;
     }
 
-    ret result;
+    return result;
 }
 
 fn mangle(ss: path) -> ~str {
@@ -513,14 +513,14 @@ fn mangle(ss: path) -> ~str {
 }
 
 fn exported_name(path: path, hash: @~str, vers: @~str) -> ~str {
-    ret mangle(
+    return mangle(
         vec::append_one(vec::append_one(path, path_name(hash)),
                         path_name(vers)));
 }
 
 fn mangle_exported_name(ccx: @crate_ctxt, path: path, t: ty::t) -> ~str {
     let hash = get_symbol_hash(ccx, t);
-    ret exported_name(path, @hash, ccx.link_meta.vers);
+    return exported_name(path, @hash, ccx.link_meta.vers);
 }
 
 fn mangle_internal_name_by_type_only(ccx: @crate_ctxt,
@@ -528,20 +528,20 @@ fn mangle_internal_name_by_type_only(ccx: @crate_ctxt,
    ~str {
     let s = @util::ppaux::ty_to_short_str(ccx.tcx, t);
     let hash = get_symbol_hash(ccx, t);
-    ret mangle(~[path_name(name), path_name(s), path_name(@hash)]);
+    return mangle(~[path_name(name), path_name(s), path_name(@hash)]);
 }
 
 fn mangle_internal_name_by_path_and_seq(ccx: @crate_ctxt, path: path,
                                         flav: @~str) -> ~str {
-    ret mangle(vec::append_one(path, path_name(@ccx.names(*flav))));
+    return mangle(vec::append_one(path, path_name(@ccx.names(*flav))));
 }
 
 fn mangle_internal_name_by_path(_ccx: @crate_ctxt, path: path) -> ~str {
-    ret mangle(path);
+    return mangle(path);
 }
 
 fn mangle_internal_name_by_seq(ccx: @crate_ctxt, flav: @~str) -> ~str {
-    ret ccx.names(*flav);
+    return ccx.names(*flav);
 }
 
 // If the user wants an exe generated we need to invoke
@@ -558,15 +558,15 @@ fn link_binary(sess: session,
                 (config.os == session::os_linux ||
                  config.os == session::os_freebsd) &&
                 option::is_some(found) && option::get(found) == 0u {
-                ret str::slice(filename, 3u, str::len(filename));
-            } else { ret filename; }
+                return str::slice(filename, 3u, str::len(filename));
+            } else { return filename; }
         };
         fn rmext(filename: ~str) -> ~str {
             let mut parts = str::split_char(filename, '.');
             vec::pop(parts);
-            ret str::connect(parts, ~".");
+            return str::connect(parts, ~".");
         }
-        ret alt config.os {
+        return alt config.os {
               session::os_macos { rmext(rmlib(filename)) }
               session::os_linux { rmext(rmlib(filename)) }
               session::os_freebsd { rmext(rmlib(filename)) }
diff --git a/src/rustc/back/rpath.rs b/src/rustc/back/rpath.rs
index 4f85fb48f2a..d92c5f8379e 100644
--- a/src/rustc/back/rpath.rs
+++ b/src/rustc/back/rpath.rs
@@ -18,7 +18,7 @@ fn get_rpath_flags(sess: session::session, out_filename: ~str) -> ~[~str] {
 
     // No rpath on windows
     if os == session::os_win32 {
-        ret ~[];
+        return ~[];
     }
 
     debug!{"preparing the RPATH!"};
@@ -89,7 +89,7 @@ fn get_rpaths(os: session::os, cwd: path::path, sysroot: path::path,
 
     // Remove duplicates
     let rpaths = minimize_rpaths(rpaths);
-    ret rpaths;
+    return rpaths;
 }
 
 fn get_rpaths_relative_to_output(os: session::os,
@@ -148,9 +148,9 @@ fn get_relative_to(abs1: path::path, abs2: path::path) -> path::path {
     vec::push_all(path, vec::view(split2, start_idx, len2 - 1u));
 
     if vec::is_not_empty(path) {
-        ret path::connect_many(path);
+        return path::connect_many(path);
     } else {
-        ret ~".";
+        return ~".";
     }
 }
 
@@ -192,7 +192,7 @@ fn minimize_rpaths(rpaths: ~[~str]) -> ~[~str] {
             set.insert(rpath, ());
         }
     }
-    ret minimized;
+    return minimized;
 }
 
 #[cfg(unix)]
diff --git a/src/rustc/back/upcall.rs b/src/rustc/back/upcall.rs
index 94c69976c8c..0b6b2455ac7 100644
--- a/src/rustc/back/upcall.rs
+++ b/src/rustc/back/upcall.rs
@@ -36,7 +36,7 @@ fn declare_upcalls(targ_cfg: @session::config,
         let mut arg_tys: ~[TypeRef] = ~[];
         for tys.each |t| { vec::push(arg_tys, t); }
         let fn_ty = T_fn(arg_tys, rv);
-        ret base::decl_cdecl_fn(llmod, prefix + name, fn_ty);
+        return base::decl_cdecl_fn(llmod, prefix + name, fn_ty);
     }
     fn nothrow(f: ValueRef) -> ValueRef {
         base::set_no_unwind(f); f
@@ -47,7 +47,7 @@ fn declare_upcalls(targ_cfg: @session::config,
     let int_t = T_int(targ_cfg);
     let size_t = T_size_t(targ_cfg);
 
-    ret @{_fail: dv(~"fail", ~[T_ptr(T_i8()),
+    return @{_fail: dv(~"fail", ~[T_ptr(T_i8()),
                              T_ptr(T_i8()),
                              size_t]),
           trace: dv(~"trace", ~[T_ptr(T_i8()),
diff --git a/src/rustc/back/x86.rs b/src/rustc/back/x86.rs
index a7cd20e875b..93001f5e06a 100644
--- a/src/rustc/back/x86.rs
+++ b/src/rustc/back/x86.rs
@@ -3,7 +3,7 @@ import session::sess_os_to_meta_os;
 import metadata::loader::meta_section_name;
 
 fn get_target_strs(target_os: session::os) -> target_strs::t {
-    ret {
+    return {
         module_asm: ~"",
 
         meta_sect_name: meta_section_name(sess_os_to_meta_os(target_os)),
diff --git a/src/rustc/back/x86_64.rs b/src/rustc/back/x86_64.rs
index 63399cd2b41..76a63fbf3d9 100644
--- a/src/rustc/back/x86_64.rs
+++ b/src/rustc/back/x86_64.rs
@@ -3,7 +3,7 @@ import session::sess_os_to_meta_os;
 import metadata::loader::meta_section_name;
 
 fn get_target_strs(target_os: session::os) -> target_strs::t {
-    ret {
+    return {
         module_asm: ~"",
 
         meta_sect_name: meta_section_name(sess_os_to_meta_os(target_os)),