diff options
| author | Marijn Haverbeke <[email protected]> | 2011-05-06 22:13:13 +0200 |
|---|---|---|
| committer | Marijn Haverbeke <[email protected]> | 2011-05-06 22:51:19 +0200 |
| commit | a3ec0b1f643d00b9418e4884bd7caa07bf052201 (patch) | |
| tree | 82000510ac9c9cf3f0c7cf4ae5f3c6b123b559cb /src/comp/back | |
| parent | Register new snapshots. (diff) | |
| download | rust-a3ec0b1f643d00b9418e4884bd7caa07bf052201.tar.xz rust-a3ec0b1f643d00b9418e4884bd7caa07bf052201.zip | |
Rename std modules to be camelcased
(Have fun mergining your stuff with this.)
Diffstat (limited to 'src/comp/back')
| -rw-r--r-- | src/comp/back/Link.rs | 26 | ||||
| -rw-r--r-- | src/comp/back/x86.rs | 36 |
2 files changed, 31 insertions, 31 deletions
diff --git a/src/comp/back/Link.rs b/src/comp/back/Link.rs index ebeda8dc..695d3202 100644 --- a/src/comp/back/Link.rs +++ b/src/comp/back/Link.rs @@ -1,8 +1,8 @@ import driver.session; import lib.llvm.llvm; import middle.trans; -import std._str; -import std.fs; +import std.Str; +import std.FS; import lib.llvm.llvm.ModuleRef; import lib.llvm.llvm.ValueRef; @@ -19,14 +19,14 @@ tag output_type { } fn llvm_err(session.session sess, str msg) { - sess.err(msg + ": " + _str.str_from_cstr(llvm.LLVMRustGetLastError())); + sess.err(msg + ": " + Str.str_from_cstr(llvm.LLVMRustGetLastError())); fail; } fn link_intrinsics(session.session sess, ModuleRef llmod) { - auto path = fs.connect(sess.get_opts().sysroot, "intrinsics.bc"); + auto path = FS.connect(sess.get_opts().sysroot, "intrinsics.bc"); auto membuf = - llvm.LLVMRustCreateMemoryBufferWithContentsOfFile(_str.buf(path)); + llvm.LLVMRustCreateMemoryBufferWithContentsOfFile(Str.buf(path)); if ((membuf as uint) == 0u) { llvm_err(sess, "installation problem: couldn't open intrinstics.bc"); fail; @@ -58,12 +58,12 @@ mod Write { // Decides what to call an intermediate file, given the name of the output // and the extension to use. fn mk_intermediate_name(str output_path, str extension) -> str { - auto dot_pos = _str.index(output_path, '.' as u8); + auto dot_pos = Str.index(output_path, '.' as u8); auto stem; if (dot_pos < 0) { stem = output_path; } else { - stem = _str.substr(output_path, 0u, dot_pos as uint); + stem = Str.substr(output_path, 0u, dot_pos as uint); } ret stem + "." + extension; } @@ -86,12 +86,12 @@ mod Write { auto filename = mk_intermediate_name(output, "no-opt.bc"); llvm.LLVMWriteBitcodeToFile(llmod, - _str.buf(filename)); + Str.buf(filename)); } } case (_) { auto filename = mk_intermediate_name(output, "bc"); - llvm.LLVMWriteBitcodeToFile(llmod, _str.buf(filename)); + llvm.LLVMWriteBitcodeToFile(llmod, Str.buf(filename)); } } } @@ -183,15 +183,15 @@ mod Write { "opt.bc"); llvm.LLVMRunPassManager(pm.llpm, llmod); llvm.LLVMWriteBitcodeToFile(llmod, - _str.buf(filename)); + Str.buf(filename)); pm = mk_pass_manager(); } } } llvm.LLVMRustWriteOutputFile(pm.llpm, llmod, - _str.buf(x86.get_target_triple()), - _str.buf(output), + Str.buf(x86.get_target_triple()), + Str.buf(output), FileType); llvm.LLVMDisposeModule(llmod); ret; @@ -199,7 +199,7 @@ mod Write { llvm.LLVMRunPassManager(pm.llpm, llmod); - llvm.LLVMWriteBitcodeToFile(llmod, _str.buf(output)); + llvm.LLVMWriteBitcodeToFile(llmod, Str.buf(output)); llvm.LLVMDisposeModule(llmod); } } diff --git a/src/comp/back/x86.rs b/src/comp/back/x86.rs index 855bd51b..bad4eb3e 100644 --- a/src/comp/back/x86.rs +++ b/src/comp/back/x86.rs @@ -1,8 +1,8 @@ import lib.llvm.llvm; import lib.llvm.llvm.ModuleRef; -import std._str; -import std._vec; -import std.os.target_os; +import std.Str; +import std.Vec; +import std.OS.target_os; import util.common.istr; const int wordsz = 4; @@ -241,7 +241,7 @@ fn native_glue(int n_args, abi.native_glue_type ngt) -> vec[str] { } auto m = vec("movl " + src_off + "(%ebp),%eax", "movl %eax," + dst_off + "(%esp)"); - ret _str.connect(m, "\n\t"); + ret Str.connect(m, "\n\t"); } auto carg = bind copy_arg(pass_task, _); @@ -259,7 +259,7 @@ fn native_glue(int n_args, abi.native_glue_type ngt) -> vec[str] { + vec("subl $" + wstr(n_args) + ", %esp # esp -= args", "andl $~0xf, %esp # align esp down") - + _vec.init_fn[str](carg, (n_args) as uint) + + Vec.init_fn[str](carg, (n_args) as uint) + vec("movl %edx, %edi # save task from edx to edi", "call *%ecx # call *%ecx", @@ -278,7 +278,7 @@ fn decl_glue(int align, str prefix, str name, vec[str] insns) -> str { ret "\t.globl " + sym + "\n" + "\t.balign " + istr(align) + "\n" + sym + ":\n" + - "\t" + _str.connect(insns, "\n\t"); + "\t" + Str.connect(insns, "\n\t"); } @@ -291,8 +291,8 @@ fn decl_native_glue(int align, str prefix, abi.native_glue_type ngt, uint n) } fn get_symbol_prefix() -> str { - if (_str.eq(target_os(), "macos") || - _str.eq(target_os(), "win32")) { + if (Str.eq(target_os(), "macos") || + Str.eq(target_os(), "win32")) { ret "_"; } else { ret ""; @@ -313,44 +313,44 @@ fn get_module_asm() -> str { abi.yield_glue_name(), rust_yield_glue())) - + _vec.init_fn[str](bind decl_native_glue(align, prefix, + + Vec.init_fn[str](bind decl_native_glue(align, prefix, abi.ngt_rust, _), (abi.n_native_glues + 1) as uint) - + _vec.init_fn[str](bind decl_native_glue(align, prefix, + + Vec.init_fn[str](bind decl_native_glue(align, prefix, abi.ngt_pure_rust, _), (abi.n_native_glues + 1) as uint) - + _vec.init_fn[str](bind decl_native_glue(align, prefix, + + Vec.init_fn[str](bind decl_native_glue(align, prefix, abi.ngt_cdecl, _), (abi.n_native_glues + 1) as uint); - ret _str.connect(glues, "\n\n"); + ret Str.connect(glues, "\n\n"); } fn get_meta_sect_name() -> str { - if (_str.eq(target_os(), "macos")) { + if (Str.eq(target_os(), "macos")) { ret "__DATA,__note.rustc"; } - if (_str.eq(target_os(), "win32")) { + if (Str.eq(target_os(), "win32")) { ret ".note.rustc"; } ret ".note.rustc"; } fn get_data_layout() -> str { - if (_str.eq(target_os(), "macos")) { + if (Str.eq(target_os(), "macos")) { ret "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64" + "-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" + "-n8:16:32"; } - if (_str.eq(target_os(), "win32")) { + if (Str.eq(target_os(), "win32")) { ret "e-p:32:32-f64:64:64-i64:64:64-f80:32:32-n8:16:32"; } ret "e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32"; } fn get_target_triple() -> str { - if (_str.eq(target_os(), "macos")) { + if (Str.eq(target_os(), "macos")) { ret "i686-apple-darwin"; } - if (_str.eq(target_os(), "win32")) { + if (Str.eq(target_os(), "win32")) { ret "i686-pc-mingw32"; } ret "i686-unknown-linux-gnu"; |