about summary refs log tree commit diff
path: root/src/rustllvm/ArchiveWrapper.cpp
AgeCommit message (Collapse)AuthorLines
2019-04-05rustc: Start implementing compat with LLVM 9Alex Crichton-12/+16
This commit doesn't actually migrate to LLVM 9, but it brings our own C++ bindings in line with LLVM 9 and able to compile against tip of tree. The changes made were: * The `MainSubprogram` flag for debuginfo moved between flag types. * Iteration of archive members was tweaked slightly and we have to construct the two iterators before constructing the returned `RustArchiveIterator` value. * The `getOrInsertFunction` binding now returns a wrapper which we use `getCallee()` on to get the value we're interested in.
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-09Bump minimum required LLVM version to 6.0Nikita Popov-6/+1
2018-11-05Remove support for building against LLVM 4Nikita Popov-2/+0
With emscripten removed in #55626, we no longer need to support building against LLVM 4.
2018-11-01Remove checks for LLVM < 4.0Nikita Popov-14/+0
While we still have to support LLVM 4.0 for Emscripten, we can drop checks for LLVM >= 4.0 and < 4.0.
2018-07-30rustc_llvm: move to rustc_codegen_llvm::llvm.Irina Popa-1/+1
2018-01-24llvm6: Different return value for writeArchiveAlex Crichton-3/+10
Updated in llvm-mirror/llvm@203c90ba this function now just returns an `Error`, so this updates the C++ bindings accordingly
2018-01-24llvm6: Remove MIPS64 archive variantAlex Crichton-3/+0
It looks like LLVM also removed it in llvm-mirror/llvm@f45adc29d in favor of the name "GNU64". This was added in the thought that we'd need such a variant when adding mips64 support but we ended up not needing it! For now let's just removing the various support on the Rust side of things.
2017-12-01rustllvm: Remove conditional code for LLVM < 3.9Josh Stone-49/+0
We bumped the minimum LLVM to 3.9 in #45326. This just cleans up the conditional code in the rustllvm C++ wrappers to assume at least 3.9.
2017-11-20[rustllvm] Use report_fatal_error over llvm_unreachableRobin Kruppe-1/+1
This makes it more robust when assertions are disabled, crashing instead of causing UB. Also introduces a tidy check to enforce this rule, which in turn necessitated making tidy run on src/rustllvm. Fixes #44020
2017-07-21Fix archive member names on 5.0Alex Crichton-0/+4
2016-12-31Improve naming style in rustllvm.Ian Kerins-102/+104
As per the LLVM style guide, use CamelCase for all locals and classes, and camelCase for all non-FFI functions. Also, make names of variables of commonly used types more consistent. Fixes #38688.
2016-12-30Switching from NULL to nullptr in src/rustllvm.karpinski-8/+8
2016-12-30Ran clang-format on src/rustllvm with llvm as the coding style.karpinski-145/+138
2016-12-29Check *all* errors in LLVMRustArchiveIterator* APIRobin Kruppe-9/+26
Incrementing the `Archive::child_iterator` fetches and validates the next child. This can trigger an error, which we previously checked on the *next* call to `LLVMRustArchiveIteratorNext()`. This means we ignore the last error if we stop iterating halfway through. This is harmless (we don't access the child, after all) but LLVM 4.0 calls `abort()` if *any* error goes unchecked, even a success value. This means that basically any rustc invocation that opens an archive and searches through it would die. The solution implemented here is to change the order of operations, such that advancing the iterator and fetching the newly-validated iterator happens in the same `Next()` call. This keeps the error handling behavior as before but ensures all `Error`s get checked.
2016-12-11[LLVM 4.0] Explicitly call constructor of 'llvm::Error'Dylan McKay-0/+2
The implicit constructor has been deleted. We should use Error::success() instead. The constructor in the LLVM headers mentions that "success" should be used instead of the deleted constructor for clarity.
2016-12-06[LLVM 4.0] rustllvm archive supportRobin Kruppe-0/+19
Error handling is being transitioned from ErrorOr<T> to Expected<T> which has a different API and requires explicitly handling all errors
2016-09-26Extend preprocessor LLVM version checks to support LLVM 4.xJake Goulding-12/+12
This doesn't actually do anything for LLVM 4.x yet, but sets the stage.
2016-08-03finish type-auditing rustllvmAriel Ben-Yehuda-1/+1
2016-08-03audit LLVM C++ types in ArchiveWrapper and PassWrapperAriel Ben-Yehuda-33/+65
2016-07-29Force check of errorJan-Erik Rediger-2/+14
The passed error needs to be checked. Otherwise it will force an abort when it is deconstructed, but a success value.
2016-07-29Use correct error handling typeJan-Erik Rediger-1/+1
2016-07-29Flip LLVM verion check clauseJan-Erik Rediger-9/+9
2016-07-29[LLVM-3.9] Use old way of getting next childJan-Erik Rediger-2/+7
This was changed back in https://github.com/rust-lang/llvm/commit/aacf2fbf
2016-07-29[LLVM-3.9] Maintain backward compatibility in ArchiverJan-Erik Rediger-0/+7
2016-07-29[LLVM-3.9] Update return type for Archive::createJan-Erik Rediger-0/+8
Changed in https://github.com/rust-lang/llvm/commit/0b21d88fd31b4bfb6fdb7e2f1ed5f93639d5bd1c
2016-07-29[LLVM-3.9] Replace NewArchiveIterator with NewArchiveMemberJan-Erik Rediger-3/+17
The new NewArchiveMember is simpler and requires less context, according to upstream. This was changed in http://reviews.llvm.org/D21721
2016-06-09Remove unneeded indirection of GET_ARCHIVEJake Goulding-2/+1
2016-06-09Reflect supporting only LLVM 3.7+ in the LLVM wrappersJake Goulding-25/+0
2016-01-29trans: Upgrade LLVMAlex Crichton-3/+19
This brings some routine upgrades to the bundled LLVM that we're using, the most notable of which is a bug fix to the way we handle range asserts when loading the discriminant of an enum. This fix ended up being very similar to f9d4149c where we basically can't have a range assert when loading a discriminant due to filling drop, and appropriate flags were added to communicate this to `trans::adt`.
2015-10-24rustllvm: Update to LLVM trunkSeo Sanghyeon-0/+8
2015-07-22Write deterministic archiveseternaleye-1/+1
Currently, `rustc` generates nondeterministic archives, which contain system timestamps. These don't really serve any useful purpose, and enabling deterministic archives moves us a little closer to completely deterministic builds. For a small toy library using `std::ops::{Deref,DerefMut}`, this change actually results in a bit-for-bit identical build every time.
2015-07-16trans: Add kind to writeArchiveAlex Crichton-3/+14
Updates our LLVM bindings to be able to write out multiple kinds of archives. This commit also enables using LLVM instead of the system ar on all current targets.
2015-07-10trans: Use LLVM's writeArchive to modify archivesAlex Crichton-0/+168
We have previously always relied upon an external tool, `ar`, to modify archives that the compiler produces (staticlibs, rlibs, etc). This approach, however, has a number of downsides: * Spawning a process is relatively expensive for small compilations * Encoding arguments across process boundaries often incurs unnecessary overhead or lossiness. For example `ar` has a tough time dealing with files that have the same name in archives, and the compiler copies many files around to ensure they can be passed to `ar` in a reasonable fashion. * Most `ar` programs found do **not** have the ability to target arbitrary platforms, so this is an extra tool which needs to be found/specified when cross compiling. The LLVM project has had a tool called `llvm-ar` for quite some time now, but it wasn't available in the standard LLVM libraries (it was just a standalone program). Recently, however, in LLVM 3.7, this functionality has been moved to a library and is now accessible by consumers of LLVM via the `writeArchive` function. This commit migrates our archive bindings to no longer invoke `ar` by default but instead make a library call to LLVM to do various operations. This solves all of the downsides listed above: * Archive management is now much faster, for example creating a "hello world" staticlib is now 6x faster (50ms => 8ms). Linking dynamic libraries also recently started requiring modification of rlibs, and linking a hello world dynamic library is now 2x faster. * The compiler is now one step closer to "hassle free" cross compilation because no external tool is needed for managing archives, LLVM does the right thing! This commit does not remove support for calling a system `ar` utility currently. We will continue to maintain compatibility with LLVM 3.5 and 3.6 looking forward (so the system LLVM can be used wherever possible), and in these cases we must shell out to a system utility. All nightly builds of Rust, however, will stop needing a system `ar`.