summary refs log tree commit diff
path: root/src/librustc/back
AgeCommit message (Collapse)AuthorLines
2013-09-19Replace unreachable() calls with unreachable!().Chris Morgan-2/+2
This is the second of two parts of #8991, now possible as a new snapshot has been made. (The first part implemented the unreachable!() macro; it was #8992, 6b7b8f2682.) ``std::util::unreachable()`` is removed summarily; any code which used it should now use the ``unreachable!()`` macro. Closes #9312. Closes #8991.
2013-09-18Register new snapshotsAlex Crichton-1/+1
2013-09-16switch Drop to `&mut self`Daniel Micay-1/+1
2013-09-06Remove even more usage of clownshoes in symbolsAlex Crichton-11/+7
This removes another large chunk of this odd 'clownshoes' identifier showing up in symbol names. These all originated from external crates because the encoded items were encoded independently of the paths calculated in ast_map. The encoding of these paths now uses the helper function in ast_map to calculate the "pretty name" for an impl block. Unfortunately there is still no information about generics in the symbol name, but it's certainly vastly better than before hash::__extensions__::write::_version::v0.8 becomes hash::Writer$SipState::write::hversion::v0.8 This also fixes bugs in which lots of methods would show up as `meth_XXX`, they now only show up as `meth` and throw some extra characters onto the version string.
2013-09-05Rename str::from_bytes to str::from_utf8, closes #8985Florian Hahn-2/+2
2013-09-04auto merge of #8875 : alexcrichton/rust/fix-inner-static-library-bug, r=huonwbors-24/+76
These commits fix bugs related to identically named statics in functions of implementations in various situations. The commit messages have most of the information about what bugs are being fixed and why. As a bonus, while I was messing around with name mangling, I improved the backtraces we'll get in gdb by removing `__extensions__` for the trait/type being implemented and by adding the method name as well. Yay!
2013-09-04Improve name mangling for gdbAlex Crichton-23/+54
Remove __extensions__ from method symbols as well as the meth_XXX. The XXX is now used to append a few characters at the end of the name of the symbol. Closes #6602
2013-09-04auto merge of #8978 : pnkfelix/rust/make-path-api-less-allocation-happy, r=huonwbors-2/+2
A [dialogue](https://github.com/mozilla/rust/pull/8909#discussion-diff-6102725) on PR #8909 inspired me to make this change. r? anyone (It is possible that `std::path` itself will soon be replaced with a new implementation that kballard's working on, as mentioned in the dialogue linked above, but this revision is simple enough that I figured I'd offer it up.)
2013-09-04Update clients of path.rs to use new API.Felix S. Klock II-2/+2
In most cases this involved removing a ~str allocations or clones (yay), or coercing a ~str to a slice. In a few places, I had to bind an intermediate Path (e.g. path.pop() return values), so that it would live long enough to support the borrowed &str. And in a few places, where the code was actively using the property that the old API returned ~str's, I had to put in to_owned() or clone(); but in those cases, we're trading an allocation within the path.rs code for one in the client code, so they neutralize each other.
2013-09-04auto merge of #8976 : alexcrichton/rust/issue-5425, r=pnkfelixbors-0/+4
Closes #5425
2013-09-04Don't die with an ICE on a blank library nameAlex Crichton-0/+4
Closes #5425
2013-09-03add type name to the tydescDaniel Micay-1/+2
Closes #8926
2013-09-02Remove __extensions__ in names for a "pretty name"Alex Crichton-4/+25
As with the previous commit, this is targeted at removing the possibility of collisions between statics. The main use case here is when there's a type-parametric function with an inner static that's compiled as a library. Before this commit, any impl would generate a path item of "__extensions__". This changes this identifier to be a "pretty name", which is either the last element of the path of the trait implemented or the last element of the type's path that's being implemented. That doesn't quite cut it though, so the (trait, type) pair is hashed and again used to append information to the symbol. Essentially, __extensions__ was removed for something nicer for debugging, and then some more information was added to symbol name by including a hash of the trait being implemented and type it's being implemented for. This should prevent colliding names for inner statics in regular functions with similar names.
2013-09-02librustc: Check for empty crate link meta name and vers.Luqman Aden-4/+4
2013-09-01Modernized a few type names in rustc and syntaxMarvin Löbel-56/+56
2013-08-30Tweak pass management and add some more optionsAlex Crichton-41/+75
The only changes to the default passes is that O1 now doesn't run the inline pass, just always-inline with lifetime intrinsics. O2 also now has a threshold of 225 instead of 275. Otherwise the default passes being run is the same. I've also added a few more options for configuring the pass pipeline. Namely you can now specify arguments to LLVM directly via the `--llvm-args` command line option which operates similarly to `--passes`. I also added the ability to turn off pre-population of the pass manager in case you want to run *only* your own passes.
2013-08-26Rewrite pass management with LLVMAlex Crichton-528/+165
Beforehand, it was unclear whether rust was performing the "recommended set" of optimizations provided by LLVM for code. This commit changes the way we run passes to closely mirror that of clang, which in theory does it correctly. The notable changes include: * Passes are no longer explicitly added one by one. This would be difficult to keep up with as LLVM changes and we don't guaranteed always know the best order in which to run passes * Passes are now managed by LLVM's PassManagerBuilder object. This is then used to populate the various pass managers run. * We now run both a FunctionPassManager and a module-wide PassManager. This is what clang does, and I presume that we *may* see a speed boost from the module-wide passes just having to do less work. I have no measured this. * The codegen pass manager has been extracted to its own separate pass manager to not get mixed up with the other passes * All pass managers now include passes for target-specific data layout and analysis passes Some new features include: * You can now print all passes being run with `-Z print-llvm-passes` * When specifying passes via `--passes`, the passes are now appended to the default list of passes instead of overwriting them. * The output of `--passes list` is now generated by LLVM instead of maintaining a list of passes ourselves * Loop vectorization is turned on by default as an optimization pass and can be disabled with `-Z no-vectorize-loops`
2013-08-24librustc: Always use session target triple.Luqman Aden-32/+8
2013-08-22Compile via external assembler on Windows.Vadim Chugunov-18/+14
2013-08-22On Windows, use g++ for linking, instead of gcc.Vadim Chugunov-4/+5
This is required in order to produce linked modules that perform correct registration of unwind tables.
2013-08-21auto merge of #8595 : vadimcn/rust/print_link_args, r=alexcrichtonbors-0/+5
This resolves issue #8569
2013-08-21Trimmed whitespaceVadim Chugunov-2/+2
2013-08-20auto merge of #8328 : alexcrichton/rust/llvm-head, r=brsonbors-1/+0
The first commit message is pretty good, but whomever reviews this should probably also at least glance at the changes I made in LLVM. I basically reorganized our pending patch queue to be a bit more organized and clearer in what needs to go where. After this, our queue would be: * Add the `no-split-stack` attribute * Add the `fixedstacksegment` attribute * Add split-stacks for arm android * Add split-stacks for arm linux * Add split stacks for mips Then there's a patch which I added to get rust to build at all on LLVM-head, and I'm not quite sure why it's there, but nothing seems to be crashing for now! (famous last words). Otherwise, I just updated code to reflect the changes I made in LLVM with the only major change being the advent of the new `no_split_stack` attribute. This is work towards #1226, but someone more familiar with the code should probably actually assign the attribute to the appropriate functions. Also as a bonus, I've verified that this closes #5774
2013-08-20Fix LLVM compilation issues and use the new attrsAlex Crichton-1/+0
This implements #[no_split_stack] and also changes #[fast_ffi] to using the new "fixedstacksegment" string attribute instead of integer attribute.
2013-08-19Issue #3678: Remove wrappers and call foreign functions directlyNiko Matsakis-5/+0
2013-08-18Fixed -Z print-link-argsVadim Chugunov-0/+5
2013-08-15Add ToCStr method .with_c_str()Kevin Ballard-12/+12
.with_c_str() is a replacement for the old .as_c_str(), to avoid unnecessary boilerplate. Replace all usages of .to_c_str().with_ref() with .with_c_str().
2013-08-12fix build with the new snapshot compilerDaniel Micay-13/+0
2013-08-11auto merge of #8410 : luqmana/rust/mcpu, r=sanxiynbors-13/+20
Adds `--target-cpu` flag which lets you choose a more specific target cpu instead of just passing the default, `generic`. It's more or less akin to `-mcpu`/`-mtune` in clang/gcc.
2013-08-11Add a field `borrow_offset` to the type descriptor indicatingNiko Matsakis-1/+2
what amount a T* pointer must be adjusted to reach the contents of the box. For `~T` types, this requires knowing the type `T`, which is not known in the case of objects.
2013-08-10rustc: Add --target-cpu flag to select a more specific processor instead of ↵Luqman Aden-13/+20
the default, 'generic'.
2013-08-10syntax and rustc: fix some warningsErick Tryzelaar-1/+1
2013-08-10std: Rename Iterator.transform -> .mapErick Tryzelaar-3/+3
cc #5898
2013-08-10Mass rename of .consume{,_iter}() to .move_iter()Erick Tryzelaar-1/+1
cc #7887
2013-08-09Merge remote-tracking branch 'remotes/origin/master' into ↵Erick Tryzelaar-117/+32
remove-str-trailing-nulls
2013-08-09auto merge of #8176 : catamorphism/rust/rustpkg-extern-mod, r=catamorphismbors-117/+23
r? @graydon Also, notably, make rustpkgtest depend on the rustpkg executable (otherwise, tests that shell out to rustpgk might run when rustpkg doesn't exist).
2013-08-09std/rustc/rustpkg/syntax: Support the `extern mod = ...` formTim Chevalier-117/+23
This commit allows you to write: extern mod x = "a/b/c"; which means rustc will search in the RUST_PATH for a package with ID a/b/c, and bind it to the name `x` if it's found. Incidentally, move get_relative_to from back::rpath into std::path
2013-08-08env! syntax extension changesSteven Fackler-0/+9
env! aborts compilation of the specified environment variable is not defined and takes an optional second argument containing a custom error message. option_env! creates an Option<&'static str> containing the value of the environment variable. There are no run-pass tests that check the behavior when the environment variable is defined since the test framework doesn't support setting environment variables at compile time as opposed to runtime. However, both env! and option_env! are used inside of rustc itself, which should act as a sufficient test. Close #2248
2013-08-06Merge remote-tracking branch 'remotes/origin/master' into ↵Erick Tryzelaar-5/+5
remove-str-trailing-nulls
2013-08-05Updated std::Option, std::Either and std::ResultMarvin Löbel-5/+5
- Made naming schemes consistent between Option, Result and Either - Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None) - Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead
2013-08-04Merge remote-tracking branch 'remotes/origin/master' into str-remove-nullErick Tryzelaar-25/+24
2013-08-04std: replace str::as_c_str with std::c_strErick Tryzelaar-11/+15
2013-08-04Fix build issues once LLVM has been upgradedAlex Crichton-1/+0
* LLVM now has a C interface to LLVMBuildAtomicRMW * The exception handling support for the JIT seems to have been dropped * Various interfaces have been added or headers have changed
2013-08-03remove obsolete `foreach` keywordDaniel Micay-24/+24
this has been replaced by `for`
2013-08-02replace `range` with an external iteratorDaniel Micay-2/+1
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-23/+23
2013-07-24auto merge of #7996 : erickt/rust/cleanup-strs, r=ericktbors-17/+18
This is a cleanup pull request that does: * removes `os::as_c_charp` * moves `str::as_buf` and `str::as_c_str` into `StrSlice` * converts some functions from `StrSlice::as_buf` to `StrSlice::as_c_str` * renames `StrSlice::as_buf` to `StrSlice::as_imm_buf` (and adds `StrSlice::as_mut_buf` to match `vec.rs`. * renames `UniqueStr::as_bytes_with_null_consume` to `UniqueStr::to_bytes` * and other misc cleanups and minor optimizations
2013-07-24Change 'print(fmt!(...))' to printf!/printfln! in src/lib*Birunthan Mohanathas-4/+4
2013-07-23std: move StrUtil::as_c_str into StrSliceErick Tryzelaar-17/+18
2013-07-22Ast spanned<T> refactoring, renaming: crate, local, blk, crate_num, crate_cfg.Michael Woerister-3/+3
`crate => Crate` `local => Local` `blk => Block` `crate_num => CrateNum` `crate_cfg => CrateConfig` Also, Crate and Local are not wrapped in spanned<T> anymore.