Jorge Aparicio
2628f3cc8f
fix alignment
2016-03-22 22:03:54 -05:00
Jorge Aparicio
aa7fe93d4a
sprinkle feature gates here and there
2016-03-22 22:02:47 -05:00
Jorge Aparicio
0f02309e4b
try! -> ?
...
Automated conversion using the untry tool [1] and the following command:
```
$ find -name '*.rs' -type f | xargs untry
```
at the root of the Rust repo.
[1]: https://github.com/japaric/untry
2016-03-22 22:01:37 -05:00
bors
e3f2dfdece
Auto merge of #32156 - pnkfelix:borrowck-on-mir-move-analysis, r=nikomatsakis
...
Move analysis for MIR borrowck
This PR adds code for doing MIR-based gathering of the moves in a `fn` and the dataflow to determine where uninitialized locations flow to, analogous to how the same thing is done in `borrowck`.
It also adds a couple attributes to print out graphviz visualizations of the analyzed MIR that includes the dataflow analysis results.
cc @nikomatsakis
2016-03-22 10:00:12 -07:00
Felix S. Klock II
baeae780e0
Switch libgraphviz from type params to associated types for Node/Edge.
2016-03-21 18:36:14 +01:00
Björn Steinbrink
4fd318b9e9
Fix tupling of fn args for rust-call ABI functions
...
Fixes #32389
2016-03-21 12:22:29 +01:00
bors
2af3dd73db
Auto merge of #32010 - devonhollowood:non-c-like-enum-repr, r=Aatch
...
Add tests for #26114
First step in fixing #26114
2016-03-20 12:49:46 -07:00
bors
8eeb5062d1
Auto merge of #32244 - Amanieu:compare_exchange_result, r=alexcrichton
...
Change compare_exchange to return a Result<T, T>
As per the discussion in #31767
I also changed the feature name from `extended_compare_and_swap` to `compare_exchange`.
r? @alexcrichton
2016-03-19 12:25:34 -07:00
Amanieu d'Antras
421fed188c
Change compare_exchange to return a Result<T, T>
2016-03-19 11:44:38 +00:00
Eduard-Mihai Burtescu
5bf1e58bc0
Rollup merge of #32347 - Amanieu:volatile_fat_ptr, r=eddyb
...
Fix volatile stores of fat pointers
This was previously causing an LLVM assertion.
r? @eddyb
2016-03-19 12:30:02 +02:00
Amanieu d'Antras
135d24dd03
Fix volatile stores of fat pointers
2016-03-19 02:24:37 +00:00
Ulrik Sverdrup
2dbac1fb8e
Add intrinsics for float arithmetic with fast
flag enabled
...
`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-18 17:31:41 +01:00
Eduard Burtescu
e177207b36
trans: Don't ignore zero-sized struct arguments on x86_64-pc-windows-gnu.
2016-03-18 14:28:11 +02:00
Eduard Burtescu
181097da33
trans: Decide whether to load volatile_store's argument based on its ArgType.
2016-03-18 05:29:53 +02:00
Eduard Burtescu
9a8b80762b
trans: Pass newtypes of immediates as their inner-most type again.
2016-03-18 01:01:47 +02:00
Eduard Burtescu
02a141a550
mir: Don't memset allocas of types that do not require drop.
2016-03-17 22:48:07 +02:00
Eduard Burtescu
460e66457a
mir: Store immediates used for indirect arguments in an alloca.
2016-03-17 22:48:07 +02:00
Eduard Burtescu
5739ed1f80
trans: Do not depend on having Expr's around for generic_simd_intrinsic.
2016-03-17 22:48:07 +02:00
Eduard Burtescu
7912f94b2d
const_eval: Take just one set of substitutions in lookup_const_by_id.
2016-03-17 22:48:07 +02:00
Eduard Burtescu
5eeda543df
mir: Use usize instead of u32 for indexing slices.
2016-03-17 21:51:55 +02:00
Eduard Burtescu
835e2bdf7d
Add -Z orbit for forcing MIR for everything, unless #[rustc_no_mir] is used.
2016-03-17 21:51:55 +02:00
Eduard Burtescu
856185dbb2
hir, mir: Separate HIR expressions / MIR operands from InlineAsm.
2016-03-17 21:51:55 +02:00
Eduard Burtescu
415d95fbeb
mir: Translate Rvalue::Slice without relying on tvec.
2016-03-17 21:51:55 +02:00
Eduard Burtescu
d9277b163c
trans: Make everything used from within at_start Builder-friendly.
2016-03-17 21:51:54 +02:00
Eduard Burtescu
82fad1dfc7
mir: Call set_operand_dropped in more places, specifically Unsize casts.
2016-03-17 21:51:54 +02:00
Eduard Burtescu
3e98220a1c
mir: Translate intrinsics, via old trans where possible.
2016-03-17 21:51:54 +02:00
Eduard Burtescu
ee7687a5e5
mir: Reintroduce the temporary block after invokes, to handle critical edges.
2016-03-17 21:51:54 +02:00
Eduard Burtescu
41fc5f7c2a
mir: Trigger closure instantiations when the closure value is created.
2016-03-17 21:51:54 +02:00
Eduard Burtescu
6c551b3766
trans: Load and cache cross-crate Mir instances in the shared context.
2016-03-17 21:51:54 +02:00
Eduard Burtescu
47cd05c8c1
mir: Don't shadow the "args" variable in Call translation.
2016-03-17 21:51:54 +02:00
Eduard Burtescu
9c6bfe4499
mir: Truncate bool to i1 for SwitchInt.
2016-03-17 21:51:54 +02:00
Eduard Burtescu
38638d37f7
trans: Take a &Builder in call_memcpy, like call_memset.
2016-03-17 21:51:54 +02:00
Eduard Burtescu
b63a5eed6e
mir: Support RustCall ABI functions.
2016-03-17 21:51:53 +02:00
Eduard Burtescu
92e485874e
mir: Load FatPtr constants instead of keeping them indirect.
2016-03-17 21:51:53 +02:00
Eduard Burtescu
eb43d95211
mir: Don't load the discriminant, it's already in immediate form.
2016-03-17 21:51:53 +02:00
Eduard Burtescu
1de6a9682f
mir: Don't use ConstVal kinds that contain local NodeId's.
2016-03-17 21:51:53 +02:00
Eduard Burtescu
b38627dafb
mir: Use the right form of GEPi for indexing slices vs arrays.
2016-03-17 21:51:53 +02:00
Eduard Burtescu
56417b3732
mir: Monomorphize LvalueTy's of projections.
2016-03-17 21:51:53 +02:00
Eduard Burtescu
f9c06abc21
trans: Simplify "try" intrinsic.
2016-03-17 21:51:53 +02:00
Eduard Burtescu
6c0674e613
trans: Remove the foreign module.
2016-03-17 21:51:52 +02:00
Eduard Burtescu
aec63821d0
trans: Handle all function setup for all ABIs via FnType.
2016-03-17 21:51:52 +02:00
Eduard Burtescu
bd0a849f3b
trans: datum::lvalue_scratch_datum doesn't need a move-into-closure trick.
2016-03-17 21:51:52 +02:00
Eduard Burtescu
03993882d6
trans: Handle calls for all ABIs through FnType.
2016-03-17 21:51:52 +02:00
Eduard Burtescu
9e036c0ff0
trans: Provide the FnType for a direct call via Callee::direct_fn_type.
2016-03-17 21:51:52 +02:00
Eduard Burtescu
80d939fd22
trans: Handle ignored arguments/returns uniformly.
2016-03-17 21:51:52 +02:00
Eduard Burtescu
7454b5c61d
trans: Set the calling convention in apply_attrs_callsite.
2016-03-17 21:51:51 +02:00
Eduard Burtescu
77f3484148
trans: Apply all attributes through FnType.
2016-03-17 21:51:51 +02:00
Eduard Burtescu
de5f8244f2
trans: Use llvm::Attributes directly in ArgTy.
2016-03-17 21:51:51 +02:00
Eduard Burtescu
c7172a9935
rustc_llvm: An AttrBuilder that's not completely wasteful.
2016-03-17 21:51:51 +02:00
Eduard Burtescu
1d7c9bd137
trans: use sizing_type_of for interacting with potentially incomplete types.
2016-03-17 21:51:51 +02:00