rust/src/rustllvm
bors 42eb5ff404 Auto merge of #55641 - nagisa:optimize-attr, r=pnkfelix
Implement optimize(size) and optimize(speed) attributes

This PR implements both `optimize(size)` and `optimize(speed)` attributes.

While the functionality itself works fine now, this PR is not yet complete: the code might be messy in places and, most importantly, the compiletest must be improved with functionality to run tests with custom optimization levels. Otherwise the new attribute cannot be tested properly. Oh, and not all of the RFC is implemented – attribute propagation is not implemented for example.

# TODO

* [x] Improve compiletest so that tests can be written;
* [x] Assign a proper error number (E9999 currently, no idea how to allocate a number properly);
* [ ] Perhaps reduce the duplication in LLVM attribute assignment code…
2019-01-26 07:08:18 +00:00
..
.editorconfig
ArchiveWrapper.cpp Remove licenses 2018-12-25 21:08:33 -07:00
Linker.cpp Remove licenses 2018-12-25 21:08:33 -07:00
llvm-rebuild-trigger Rebase to the llvm-project monorepo 2019-01-25 15:39:54 -08:00
PassWrapper.cpp Rebase to the llvm-project monorepo 2019-01-25 15:39:54 -08:00
README
rustllvm.h Implement optimize(size) and optimize(speed) 2019-01-24 20:13:50 +02:00
RustWrapper.cpp Auto merge of #55641 - nagisa:optimize-attr, r=pnkfelix 2019-01-26 07:08:18 +00:00

This directory currently contains some LLVM support code. This will generally
be sent upstream to LLVM in time; for now it lives here.

NOTE: the LLVM C++ ABI is subject to between-version breakage and must *never*
be exposed to Rust. To allow for easy auditing of that, all Rust-exposed types
must be typedef-ed as "LLVMXyz", or "LLVMRustXyz" if they were defined here.

Functions that return a failure status and leave the error in
the LLVM last error should return an LLVMRustResult rather than an
int or anything to avoid confusion.

When translating enums, add a single `Other` variant as the first
one to allow for new variants to be added. It should abort when used
as an input.

All other types must not be typedef-ed as such.