about summary refs log tree commit diff
path: root/src/librustc_llvm
AgeCommit message (Collapse)AuthorLines
2016-08-06Merge branch 'master' into issue-30961Cameron Hart-2107/+2218
2016-08-03finish type-auditing rustllvmAriel Ben-Yehuda-75/+110
2016-08-03split the FFI part of rustc_llvm to rustc_llvm::ffiAriel Ben-Yehuda-2063/+2083
2016-08-03begin auditing the C++ types in RustWrapperAriel Ben-Yehuda-323/+360
2016-08-03audit LLVM C++ types in ArchiveWrapper and PassWrapperAriel Ben-Yehuda-28/+48
2016-08-03remove the ExecutionEngine bindingAriel Ben-Yehuda-11/+1
the code has no tests and will just bitrot by itself. this is a [breaking-change]
2016-08-01Auto merge of #34743 - badboy:llvm-upgrade, r=eddybbors-10/+19
LLVM upgrade As discussed in https://internals.rust-lang.org/t/need-help-with-emscripten-port/3154/46 I'm trying to update the used LLVM checkout in Rust. I basically took @shepmaster's code and applied it on top (though I did the commits manually, the [original commits have better descriptions](https://github.com/rust-lang/rust/compare/master...avr-rust:avr-support). With these changes I was able to build rustc. `make check` throws one last error on `run-pass/issue-28950.rs`. Output: https://gist.github.com/badboy/bcdd3bbde260860b6159aa49070a9052 I took the metadata changes as is and they seem to work, though it now uses the module in another step. I'm not sure if this is the best and correct way. Things to do: * [x] ~~Make `run-pass/issue-28950.rs` pass~~ unrelated * [x] Find out how the `PositionIndependentExecutable` setting is now used * [x] Is the `llvm::legacy` still the right way to do these things? cc @brson @alexcrichton
2016-07-30Update gcc crate dependency to 0.3.27.Timon Van Overveldt-1/+1
This is to pull in changes to support ARM MUSL targets. This change also commits a couple of other cargo-generated changes to other dependencies in the various Cargo.toml files.
2016-07-29Make rust build pass LLVM_RUSTLLVM to C++ compilerCameron Hart-0/+4
2016-07-29llvm: Remove no longer existent LLVMAddTargetData bindingAlex Crichton-3/+0
2016-07-29Update parsing llvm-config outputAlex Crichton-4/+15
Now it prints full paths on MSVC, but we're only interested in path names
2016-07-29[LLVM-3.9] Configure PIE at the module level instead of compilation unit levelJan-Erik Rediger-0/+1
This was deleted here[1] which appears to be replaced by this[2] which is a new setPIELevel function on the LLVM module itself. [1]: http://reviews.llvm.org/D19753 [2]: http://reviews.llvm.org/D19671
2016-07-29[LLVM-3.9] Rename custom methods to Rust-specific onesJan-Erik Rediger-3/+3
2016-07-11Add help for target CPUs, features, relocation and code models.Cameron Hart-0/+3
2016-07-03prefer `if let` to match with `None => {}` arm in some placesZack M. Davis-12/+10
This is a spiritual succesor to #34268/8531d581, in which we replaced a number of matches of None to the unit value with `if let` conditionals where it was judged that this made for clearer/simpler code (as would be recommended by Manishearth/rust-clippy's `single_match` lint). The same rationale applies to matches of None to the empty block.
2016-06-10Remove linking with ARJake Goulding-0/+15
Since we only support LLVM 3.7 and above, we will never need to use the AR linker. Remove the possibility of calling it and all the now-dead code.
2016-05-29run rustfmt on librustc_llvm folderSrinivas Reddy Thatiparthy-56/+83
2016-04-28Add opt-level options for optimizing for size and minimum size. This attemptsBrandon Edens-0/+9
to mimic the behavior of clang's options Os and Oz.
2016-04-28Make the codegen unit partitioner also emit item declarations.Michael Woerister-1/+1
2016-04-20Auto merge of #31709 - ranma42:target_feature-from-llvm, r=alexcrichtonbors-0/+10
Compute `target_feature` from LLVM This is a work-in-progress fix for #31662. The logic that computes the target features from the command line has been replaced with queries to the `TargetMachine`.
2016-04-15Add initial version of codegen unit partitioning for incremental compilation.Michael Woerister-1/+1
2016-04-09Implement feature extraction from `TargetMachine`Andrea Canciani-0/+10
Add the `LLVMRustHasFeature` function to check whether a `TargetMachine` has a given feature.
2016-03-29Use weak_odr linkage when reusing definitions across codegen unitsBjörn Steinbrink-0/+21
When reuing a definition across codegen units, we obviously cannot use internal linkage, but using external linkage means that we can end up with multiple conflicting definitions of a single symbol across multiple crates. Since the definitions should all be equal semantically, we can use weak_odr linkage to resolve the situation. Fixes #32518
2016-03-26Fix removal of function attributes on ARMBjörn Steinbrink-2/+10
We use a 64bit integer to pass the set of attributes that is to be removed, but the called C function expects a 32bit integer. On most platforms this doesn't cause any problems other than being unable to unset some attributes, but on ARM even the lower 32bit aren't handled correctly because the 64bit value is passed in different registers, so the C function actually sees random garbage. So we need to fix the relevant functions to use 32bit integers instead. Additionally we need an implementation that actually accepts 64bit integers because some attributes can only be unset that way. Fixes #32360
2016-03-18Add intrinsics for float arithmetic with `fast` flag enabledUlrik Sverdrup-0/+1
`fast` a.k.a UnsafeAlgebra is the flag for enabling all "unsafe" (according to llvm) float optimizations. See LangRef for more information http://llvm.org/docs/LangRef.html#fast-math-flags Providing these operations with less precise associativity rules (for example) is useful to numerical applications. For example, the summation loop: let sum = 0.; for element in data { sum += *element; } Using the default floating point semantics, this loop expresses the floats must be added in a sequence, one after another. This constraint is usually completely unintended, and it means that no autovectorization is possible.
2016-03-17trans: Apply all attributes through FnType.Eduard Burtescu-49/+6
2016-03-17trans: Use llvm::Attributes directly in ArgTy.Eduard Burtescu-1/+1
2016-03-17rustc_llvm: An AttrBuilder that's not completely wasteful.Eduard Burtescu-61/+74
2016-03-17rustc_llvm: Update the Attribute bitflags and remove OtherAttribute.Eduard Burtescu-40/+25
2016-03-17trans: Use fmt::Debug for debugging instead of ad-hoc methods.Eduard Burtescu-0/+1
2016-03-14rustbuild: Fix 32-bit Windows buildAlex Crichton-7/+13
Unfortunately on i686-pc-windows-gnu LLVM's answer to `--host-target` is `x86_64-pc-windows-gnu` even though we're building in a 32-bit shell as well as compiling 32-bit libraries. For now use Cargo's `HOST` environment variable to determine whether we're doing a cross compilation or not.
2016-03-01Auto merge of #31430 - nagisa:mir-dyndrop, r=nikomatsakisbors-0/+2
Zeroing on-drop seems to work fine. Still thinking about the best way to approach zeroing on-move. (based on top of the other drop PR; only the last 2 commits are relevant)
2016-02-28rustbuild: Enable cross-compiling LLVMAlex Crichton-3/+43
Currently all multi-host builds assume the the build platform can run the `llvm-config` binary generated for each host platform we're creating a compiler for. Unfortunately this assumption isn't always true when cross compiling, so we need to handle this case. This commit alters the build script of `rustc_llvm` to understand when it's running an `llvm-config` which is different than the platform we're targeting for.
2016-02-24Implement filling drop in MIRSimonas Kazlauskas-0/+2
Hopefully the author caught all the cases. For the mir_dynamic_drops_3 test case the ratio of memsets to other instructions is 12%. On the other hand we actually do not double drop for at least the test cases provided anymore in MIR.
2016-02-22Auto merge of #30969 - Amanieu:extended_atomic_cmpxchg, r=alexcrichtonbors-1/+2
This is an implementation of rust-lang/rfcs#1443.
2016-02-21rustbuild: Sync some Cargo.toml/lib.rs dependenciesAlex Crichton-0/+3
The standard library doesn't depend on rustc_bitflags, so move it to explicit dependencies on all other crates. Additionally, the arena/fmt_macros deps could be dropped from libsyntax.
2016-02-18Add intrinsics for compare_exchange and compare_exchange_weakAmanieu d'Antras-1/+2
2016-02-18Remove unnecessary explicit lifetime bounds.Corey Farwell-2/+2
These explicit lifetimes can be ommitted because of lifetime elision rules. Instances were found using rust-clippy.
2016-02-11rustc_llvm: Tweak how initialization is performedAlex Crichton-78/+39
Refactor a bit to have less repetition and #[cfg] and try to bury it all inside of a macro.
2016-02-11bootstrap: Add directives to not double-link libsAlex Crichton-0/+6
Have all Cargo-built crates pass `--cfg cargobuild` and then add appropriate `#[cfg]` definitions to all crates to avoid linking anything if this is passed. This should help allow libstd to compile with both the makefiles and with Cargo.
2016-02-11bootstrap: Add build scripts for cratesAlex Crichton-0/+130
This commits adds build scripts to the necessary Rust crates for all the native dependencies. This is currently a duplication of the support found in mk/rt.mk and is my best effort at representing the logic twice, but there may be some unfortunate-and-inevitable divergence. As a summary: * alloc_jemalloc - build script to compile jemallocal * flate - build script to compile miniz.c * rustc_llvm - build script to run llvm-config and learn about how to link it. Note that this crucially (and will not ever) compile LLVM as that would take far too long. * rustdoc - build script to compile hoedown * std - script to determine lots of libraries/linkages as well as compile libbacktrace
2016-02-11bootstrap: Add a bunch of Cargo.toml filesAlex Crichton-0/+17
These describe the structure of all our crate dependencies.
2016-02-08Remove old #[allow(trivial_casts)] annotationsAlex Crichton-1/+0
These were added a long time ago but we long since switched the lint back to allow-by-default, so these annotations shouldn't be necessary.
2016-01-29trans: Reimplement unwinding on MSVCAlex Crichton-14/+78
This commit transitions the compiler to using the new exception handling instructions in LLVM for implementing unwinding for MSVC. This affects both 32 and 64-bit MSVC as they're both now using SEH-based strategies. In terms of standard library support, lots more details about how SEH unwinding is implemented can be found in the commits. In terms of trans, this change necessitated a few modifications: * Branches were added to detect when the old landingpad instruction is used or the new cleanuppad instruction is used to `trans::cleanup`. * The return value from `cleanuppad` is not stored in an `alloca` (because it cannot be). * Each block in trans now has an `Option<LandingPad>` instead of `is_lpad: bool` for indicating whether it's in a landing pad or not. The new exception handling intrinsics require that on MSVC each `call` inside of a landing pad is annotated with which landing pad that it's in. This change to the basic block means that whenever a `call` or `invoke` instruction is generated we know whether to annotate it as part of a cleanuppad or not. * Lots of modifications were made to the instruction builders to construct the new instructions as well as pass the tagging information for the call/invoke instructions. * The translation of the `try` intrinsics for MSVC has been overhauled to use the new `catchpad` instruction. The filter function is now also a rustc-generated function instead of a purely libstd-defined function. The libstd definition still exists, it just has a stable ABI across architectures and leaves some of the really weird implementation details to the compiler (e.g. the `localescape` and `localrecover` intrinsics).
2016-01-29trans: Upgrade LLVMAlex Crichton-5/+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`.
2016-01-26Auto merge of #31120 - alexcrichton:attribute-deny-warnings, r=brsonbors-0/+1
This commit removes the `-D warnings` flag being passed through the makefiles to all crates to instead be a crate attribute. We want these attributes always applied for all our standard builds, and this is more amenable to Cargo-based builds as well. Note that all `deny(warnings)` attributes are gated with a `cfg(stage0)` attribute currently to match the same semantics we have today
2016-01-25Register LLVM passes with the correct LLVM pass manager.Corey Farwell-1/+13
LLVM was upgraded to a new version in this commit: https://github.com/rust-lang/rust/commit/f9d4149c29e8b989fa3624993be379f380e48dcf which was part of this pull request: https://github.com/rust-lang/rust/issues/26025 Consider the following two lines from that commit: https://github.com/rust-lang/rust/commit/f9d4149c29e8b989fa3624993be379f380e48dcf#diff-a3b24dbe2ea7c1981f9ac79f9745f40aL462 https://github.com/rust-lang/rust/commit/f9d4149c29e8b989fa3624993be379f380e48dcf#diff-a3b24dbe2ea7c1981f9ac79f9745f40aL469 The purpose of these lines is to register LLVM passes. Prior to the that commit, the passes being handled were assumed to be ModulePasses (a specific type of LLVM pass) since they were being added to a ModulePass manager. After that commit, both lines were refactored (presumably in an attempt to DRY out the code), but the ModulePasses were changed to be registered to a FunctionPass manager. This change resulted in ModulePasses being run, but a Function object was being passed as a parameter to the pass instead of a Module, which resulted in segmentation faults. In this commit, I changed relevant sections of the code to check the type of the passes being added and register them to the appropriate pass manager. Closes https://github.com/rust-lang/rust/issues/31067
2016-01-24mk: Move from `-D warnings` to `#![deny(warnings)]`Alex Crichton-0/+1
This commit removes the `-D warnings` flag being passed through the makefiles to all crates to instead be a crate attribute. We want these attributes always applied for all our standard builds, and this is more amenable to Cargo-based builds as well. Note that all `deny(warnings)` attributes are gated with a `cfg(stage0)` attribute currently to match the same semantics we have today
2015-12-26llvm: Add support for vectorcall (X86_VectorCall) conventionSteffen-0/+1
2015-12-21Register new snapshotsAlex Crichton-5/+0
Lots of cruft to remove!