about summary refs log tree commit diff
path: root/src/librustc/back
AgeCommit message (Collapse)AuthorLines
2013-11-11Move std::rt::io to std::ioAlex Crichton-2/+2
2013-11-12Implemented a ProcessExit enum and helper methods to std::rt::io::process ↵Matthew Iselin-7/+6
for getting process termination status, or the signal that terminated a process. A test has been added to rtio-processes.rs to ensure signal termination is picked up correctly.
2013-11-10Only run dsymutil on OSX in debug buildsAlex Crichton-2/+3
When there are no debug symbols generated, then the program just prints an annoying warning otherwise. Closes #10198
2013-11-09auto merge of #10367 : alexcrichton/rust/system-abi, r=nikomatsakisbors-59/+58
This adds an other ABI option which allows a custom selection over the target architecture and OS. The only current candidate for this change is that kernel32 on win32 uses stdcall, but on win64 it uses the cdecl calling convention. Otherwise everywhere else this is defined as using the Cdecl calling convention. cc #10049 Closes #8774
2013-11-09Add a "system" ABIAlex Crichton-59/+58
This adds an other ABI option which allows a custom selection over the target architecture and OS. The only current candidate for this change is that kernel32 on win32 uses stdcall, but on win64 it uses the cdecl calling convention. Otherwise everywhere else this is defined as using the Cdecl calling convention. cc #10049 Closes #8774
2013-11-08Added default value for package_id attribute when encoding metadata for lib ↵Andrei Formiga-11/+3
crates
2013-11-08Add default 'package_id' link meta for crates (with value equal to 'name')Andrei Formiga-2/+23
2013-11-05Use loader_path instead of executable_path for osxAlex Crichton-2/+2
According to apple's documentation of rpath semantics, @executable_path means that the path is relative the the *process executable*, not necessarily the library in question. On the other hand, @loader_path is the path that points to the library which contains the @loader_path reference. All of our rpath usage is based off the library or executable, not just the executable. This means that on OSX we should be using @loader_path instead of @executable_path to achieve the same semantics as linux's $ORIGIN.
2013-11-04Move io::file to io::fs and fns out of FileAlex Crichton-2/+2
This renames the `file` module to `fs` because that more accurately describes its current purpose (manipulating the filesystem, not just files). Additionally, this adds an UnstableFileStat structure as a nested structure of FileStat to signify that the fields should not be depended on. The structure is currently flagged with #[unstable], but it's unlikely that it has much meaning. Closes #10241
2013-11-03Fill out the remaining functionality in io::fileAlex Crichton-4/+3
This adds bindings to the remaining functions provided by libuv, all of which are useful operations on files which need to get exposed somehow. Some highlights: * Dropped `FileReader` and `FileWriter` and `FileStream` for one `File` type * Moved all file-related methods to be static methods under `File` * All directory related methods are still top-level functions * Created `io::FilePermission` types (backed by u32) that are what you'd expect * Created `io::FileType` and refactored `FileStat` to use FileType and FilePermission * Removed the expanding matrix of `FileMode` operations. The mode of reading a file will not have the O_CREAT flag, but a write mode will always have the O_CREAT flag. Closes #10130 Closes #10131 Closes #10121
2013-11-03Remove all blocking std::os blocking functionsAlex Crichton-10/+7
This commit moves all thread-blocking I/O functions from the std::os module. Their replacements can be found in either std::rt::io::file or in a hidden "old_os" module inside of native::file. I didn't want to outright delete these functions because they have a lot of special casing learned over time for each OS/platform, and I imagine that these will someday get integrated into a blocking implementation of IoFactory. For now, they're moved to a private module to prevent bitrot and still have tests to ensure that they work. I've also expanded the extensions to a few more methods defined on Path, most of which were previously defined in std::os but now have non-thread-blocking implementations as part of using the current IoFactory. The api of io::file is in flux, but I plan on changing it in the next commit as well. Closes #10057
2013-11-01Stop propagating link arguments across cratesAlex Crichton-9/+1
This is a fairly brittle modle that doesn't scale well across many crates. It's unlikely that all of the downstream crates will have all of the original native dependencies of all the upstream crates. In the case that FFI functions are reachable, then it should be the responsibility of the downstream crate to link against the correct library, or the upstream crate should prevent the functions from being reachable.
2013-10-24Remove even more of std::ioAlex Crichton-2/+1
Big fish fried here: extra::json most of the compiler extra::io_util removed extra::fileinput removed Fish left to fry extra::ebml
2013-10-22auto merge of #10013 : bdash/rust/mavericks-unwinding, r=alexcrichtonbors-8/+0
OS X 10.9's linker has a bug that results in it failing to preserve DWARF unwind information when passed the -no_compact_unwind flag. This flag is passed on OS X because the unwind information for __morestack cannot be represented by the compact unwind format. We can work around this problem by using a more targeted approach to disabling compact unwind information. The OS X linker looks for a particular pattern in the DWARF unwind information and will not attempt to convert the unwind information to the compact format. The pattern in question is the return address register being saved twice to the same location. Fixes #6849.
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-18/+18
Who doesn't like a massive renaming?
2013-10-22Fix unwinding on OS X 10.9.Mark Rowe-8/+0
OS X 10.9's linker has a bug that results in it failing to preserve DWARF unwind information when passed the -no_compact_unwind flag. This flag is passed on OS X because the unwind information for __morestack cannot be represented by the compact unwind format. We can work around this problem by using a more targeted approach to disabling compact unwind information. The OS X linker looks for a particular pattern in the DWARF unwind information and will not attempt to convert the unwind information to the compact format. The pattern in question is the return address register being saved twice to the same location. Fixes #6849.
2013-10-20fix typoDaniel Micay-5/+5
2013-10-18rustc: Check that the output file is writeable before linkingTim Chevalier-0/+25
This is because on Linux, the linker will silently overwrite a read-only file.
2013-10-16Implement new methods vec.starts_with()/vec.ends_with()Kevin Ballard-5/+2
2013-10-16path2: Update based on more review feedbackKevin Ballard-2/+2
Standardize the is_sep() functions to be the same in both posix and windows, and re-export from path. Update extra::glob to use this. Remove the usage of either, as it's going away. Move the WindowsPath-specific methods out of WindowsPath and make them top-level functions of path::windows instead. This way you cannot accidentally write code that will fail to compile on non-windows architectures without typing ::windows anywhere. Remove GenericPath::from_c_str() and just impl BytesContainer for CString instead. Remove .join_path() and .push_path() and just implement BytesContainer for Path instead. Remove FilenameDisplay and add a boolean flag to Display instead. Remove .each_parent(). It only had one caller, so just inline its definition there.
2013-10-15path2: Adjust the API to remove all the _str mutation methodsKevin Ballard-15/+15
Add a new trait BytesContainer that is implemented for both byte vectors and strings. Convert Path::from_vec and ::from_str to one function, Path::new(). Remove all the _str-suffixed mutation methods (push, join, with_*, set_*) and modify the non-suffixed versions to use BytesContainer.
2013-10-15path2: Replace the path module outrightKevin Ballard-79/+104
Remove the old path. Rename path2 to path. Update all clients for the new path. Also make some miscellaneous changes to the Path APIs to help the adoption process.
2013-10-04rustc: Use static strings in a few literalsblake2-ppc-5/+5
Avoid allocating extra copies of strings by using "" instead of ~"" for the debug options list and for the `time` function. This is a small change, but it is in a path that's always executed.
2013-10-01Migrate users of 'loop' to 'continue'Alex Crichton-1/+1
Closes #9467
2013-10-01auto merge of #9599 : alexcrichton/rust/less-fmt, r=huonwbors-32/+32
This also prevents future fmt! usage from leaking into the compiler, but it's still turned on by default for everyone else.
2013-09-30rustc: Remove usage of fmt!Alex Crichton-32/+32
2013-10-01add -Z soft-float optionJyun-Yan You-1/+3
This change adds -Z soft-float option for generating software floating point library calls. It also implies using soft float ABI, that is the same as llc. It is useful for targets that have no FPU.
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