Nick Cameron
37306c1d25
Refactor ty_vec represent &[T] as &([T])
...
Refactores all uses of ty_vec and associated things to remove the vstore abstraction (still used for strings, for now). Pointers to vectors are stored as ty_rptr or ty_uniq wrapped around a ty_vec. There are no user-facing changes. Existing behaviour is preserved by special-casing many instances of pointers containing vectors. Hopefully with DST most of these hacks will go away. For now it is useful to leave them hanging around rather than abstracting them into a method or something.
Closes #13554 .
2014-04-20 12:41:53 +12:00
Alex Crichton
675b82657e
Update the rest of the compiler with ~[T] changes
2014-04-18 10:57:10 -07:00
Eduard Burtescu
b61764b609
rustc: rename ty::vstore and its variants to UpperCamelCase.
2014-04-10 20:18:46 +03:00
Alex Crichton
57e0908af3
syntax: Remove AbiSet, use one Abi
...
This change removes the AbiSet from the AST, converting all usage to have just
one Abi value. The current scheme selects a relevant ABI given a list of ABIs
based on the target architecture and how relevant each ABI is to that
architecture.
Instead of this mildly complicated scheme, only one ABI will be allowed in abi
strings, and pseudo-abis will be created for special cases as necessary. For
example the "system" abi exists for stdcall on win32 and C on win64.
Closes #10049
2014-04-03 13:43:45 -07:00
Corey Richardson
8f385fc2e0
middle: trans: callee: remove dead code
2014-04-02 11:17:22 -04:00
Alex Crichton
89fa141cd7
rustc: Switch field privacy as necessary
2014-03-31 15:47:36 -07:00
Daniel Micay
cbbc1fc843
vec: convert append
and append_one
to methods
...
These were only free functions on `~[T]` because taking self by-value
used to be broken.
2014-03-31 01:13:48 -04:00
Corey Richardson
b8ed13686a
Address review
2014-03-27 02:51:54 -04:00
Corey Richardson
7febdb7b15
rustc: mark references w/anonymous lifetime nocapture
...
Closes #6751
2014-03-27 02:48:08 -04:00
Eduard Burtescu
75d7d5210a
Implement vtable support for autoderef.
...
Closes #13042 .
2014-03-22 23:31:42 +02:00
Alex Crichton
0dbb909bf7
rustc: Fix fallout of removing get()
2014-03-22 08:48:20 -07:00
Alex Crichton
da3625161d
Removing imports of std::vec_ng::Vec
...
It's now in the prelude.
2014-03-20 09:30:14 -07:00
Daniel Micay
14f656d1a7
rename std::vec_ng -> std::vec
...
Closes #12771
2014-03-20 04:25:32 -04:00
Daniel Micay
ce620320a2
rename std::vec -> std::slice
...
Closes #12702
2014-03-20 01:30:27 -04:00
Eduard Burtescu
0bb6de3076
De-@ move maps and rework parts of trans.
2014-03-17 09:53:08 +02:00
Eduard Burtescu
4fae06824c
De-@ Session usage.
2014-03-17 09:53:06 +02:00
Eduard Burtescu
feedd37653
Apply @nikomatsakis' nits and comments patch.
2014-03-13 14:21:45 +02:00
Eduard Burtescu
20b4e159ed
Implement automatic overloaded dereference.
...
Closes #7141 .
2014-03-13 14:21:45 +02:00
Felix S. Klock II
43c07244b3
librustc: Fix up fallout from the automatic conversion.
2014-03-08 21:41:32 +01:00
Patrick Walton
3b6e9d4a7a
librustc: Automatically change uses of ~[T]
to Vec<T>
in rustc.
2014-03-08 21:24:27 +01:00
Eduard Burtescu
bcc5486c17
Allow overloading explicit dereferences.
2014-03-05 00:26:51 +02:00
Eduard Burtescu
05e4d944a9
Replace callee_id with information stored in method_map.
2014-02-26 16:06:45 +02:00
Eduard Burtescu
a02b10a062
Refactored ast_map and friends, mainly to have Paths without storing them.
2014-02-14 08:43:29 +02:00
Flavio Percoco
968633b60a
Replace crate
usage with krate
...
This patch replaces all `crate` usage with `krate` before introducing the
new keyword. This ensures that after introducing the keyword, there
won't be any compilation errors.
krate might not be the most expressive substitution for crate but it's a
very close abbreviation for it. `module` was already used in several
places already.
2014-02-13 20:52:07 +01:00
mr.Shu
ee3fa68fed
Fixed error starting with uppercase
...
Error messages cleaned in librustc/middle
Error messages cleaned in libsyntax
Error messages cleaned in libsyntax more agressively
Error messages cleaned in librustc more aggressively
Fixed affected tests
Fixed other failing tests
Last failing tests fixed
2014-02-08 20:59:38 +01:00
Huon Wilson
f8734df515
rustc: remove use of @[].
2014-02-02 02:59:03 +11:00
Eduard Burtescu
15ba0c310a
Demote self to an (almost) regular argument and remove the env param.
...
Fixes #10667 and closes #10259 .
2014-01-27 14:31:24 +02:00
Huon Wilson
68517a2cca
syntax: convert ast_map to use a SmallIntMap.
...
NodeIds are sequential integers starting at zero, so we can achieve some
memory savings by just storing the items all in a line in a vector.
The occupancy for typical crates seems to be 75-80%, so we're already
more efficient than a HashMap (maximum occupancy 75%), not even counting
the extra book-keeping that HashMap does.
2014-01-19 12:56:26 +11:00
Niko Matsakis
5e7657fafb
Distinguish zero-size types from those that we return as void
2014-01-16 19:10:17 -05:00
Niko Matsakis
14b0abfd82
Consider all zero-sized data structures to be voidish, bypassing some "quirky" parts of LLVM (see e.g. LLVM bug 9900) but also generating better code
2014-01-16 15:11:22 -05:00
Niko Matsakis
419ac4a1b8
Issue #3511 - Rationalize temporary lifetimes.
...
Major changes:
- Define temporary scopes in a syntax-based way that basically defaults
to the innermost statement or conditional block, except for in
a `let` initializer, where we default to the innermost block. Rules
are documented in the code, but not in the manual (yet).
See new test run-pass/cleanup-value-scopes.rs for examples.
- Refactors Datum to better define cleanup roles.
- Refactor cleanup scopes to not be tied to basic blocks, permitting
us to have a very large number of scopes (one per AST node).
- Introduce nascent documentation in trans/doc.rs covering datums and
cleanup in a more comprehensive way.
2014-01-15 18:34:38 -05:00
Eduard Burtescu
08ac616d37
Use the right type for self in methods and remove obsoleted items.
...
Fixes #7411 , #10615 .
2014-01-11 16:40:23 +02:00
Eduard Burtescu
5ad2a7825b
Removed obsolete 'e' prefix on ty_evec and ty_estr.
2014-01-11 16:40:23 +02:00
Eduard Burtescu
6b221768cf
libsyntax: Renamed types, traits and enum variants to CamelCase.
2014-01-09 22:25:28 +02:00
Patrick Walton
5e637a890c
librustc: Move block contexts into per-function arenas, and
...
stack-allocate function contexts.
2014-01-07 17:00:47 -08:00
Patrick Walton
449ebeea08
librustc: De-@mut
the AST map
2014-01-03 14:01:58 -08:00
Patrick Walton
f7393d8658
librustc: De-@mut
the method map
2013-12-26 15:54:32 -08:00
Patrick Walton
c9432327c4
librustc: Change @mut Block
to @Block
.
2013-12-26 13:01:21 -08:00
Michael Woerister
91efb2a67f
debuginfo: Set correct source position for function calls.
2013-12-16 10:23:28 +01:00
Erik Price
5731ca3078
Make 'self lifetime illegal.
...
Also remove all instances of 'self within the codebase.
This fixes #10889 .
2013-12-11 10:54:06 -08:00
Kiet Tran
1755408d1a
Remove dead codes
2013-12-08 02:55:28 -05:00
Eduard Burtescu
a9c4b18b18
Box Block, fn_decl, variant and Ty in the AST, as they were inflating critical enum sizes.
2013-12-01 00:00:39 +02:00
Alex Crichton
ab387a6838
Register new snapshots
2013-11-28 20:27:56 -08:00
Patrick Walton
8ceb374ab7
librustc: Remove non-procedure uses of do
from librustc, librustdoc,
...
and librustpkg.
2013-11-26 08:25:00 -08:00
Patrick Walton
7e3f20133a
librustc: Change most uses of &fn()
to ||
.
2013-11-19 13:22:03 -08:00
Luqman Aden
c669ccf3d3
libsyntax/librustc: Allow calling variadic foreign functions.
2013-11-04 23:53:11 -05:00
Alex Crichton
daf5f5a4d1
Drop the '2' suffix from logging macros
...
Who doesn't like a massive renaming?
2013-10-22 08:09:56 -07:00
Daniel Micay
abe648d608
treat uninhabited enums as voidish
2013-10-02 10:02:52 -04:00
bors
33a5928b46
auto merge of #9656 : thestinger/rust/immediate, r=alexcrichton
...
fn foo() -> (u32, u8, u8, u8, u8) {
(4, 5, 6, 7, 8)
}
Before:
; Function Attrs: nounwind uwtable
define void @_ZN3foo18hbb616262f874f8daf4v0.0E({ i32, i8, i8, i8, i8 }* noalias nocapture sret, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone) #0 {
"function top level":
%2 = getelementptr inbounds { i32, i8, i8, i8, i8 }* %0, i64 0, i32 0
store i32 4, i32* %2, align 4
%3 = getelementptr inbounds { i32, i8, i8, i8, i8 }* %0, i64 0, i32 1
store i8 5, i8* %3, align 4
%4 = getelementptr inbounds { i32, i8, i8, i8, i8 }* %0, i64 0, i32 2
store i8 6, i8* %4, align 1
%5 = getelementptr inbounds { i32, i8, i8, i8, i8 }* %0, i64 0, i32 3
store i8 7, i8* %5, align 2
%6 = getelementptr inbounds { i32, i8, i8, i8, i8 }* %0, i64 0, i32 4
store i8 8, i8* %6, align 1
ret void
}
After:
; Function Attrs: nounwind readnone uwtable
define { i32, i8, i8, i8, i8 } @_ZN3foo18hbb616262f874f8daf4v0.0E({ i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone) #0 {
"function top level":
ret { i32, i8, i8, i8, i8 } { i32 4, i8 5, i8 6, i8 7, i8 8 }
}
2013-10-01 21:56:27 -07:00
Daniel Micay
5e4ae4f45f
make small (<= size_of::<int>()) tuples immediate
...
fn foo() -> (u32, u8, u8, u8, u8) {
(4, 5, 6, 7, 8)
}
Before:
; Function Attrs: nounwind uwtable
define void @_ZN3foo18hbb616262f874f8daf4v0.0E({ i32, i8, i8, i8, i8 }* noalias nocapture sret, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone) #0 {
"function top level":
%2 = getelementptr inbounds { i32, i8, i8, i8, i8 }* %0, i64 0, i32 0
store i32 4, i32* %2, align 4
%3 = getelementptr inbounds { i32, i8, i8, i8, i8 }* %0, i64 0, i32 1
store i8 5, i8* %3, align 4
%4 = getelementptr inbounds { i32, i8, i8, i8, i8 }* %0, i64 0, i32 2
store i8 6, i8* %4, align 1
%5 = getelementptr inbounds { i32, i8, i8, i8, i8 }* %0, i64 0, i32 3
store i8 7, i8* %5, align 2
%6 = getelementptr inbounds { i32, i8, i8, i8, i8 }* %0, i64 0, i32 4
store i8 8, i8* %6, align 1
ret void
}
After:
; Function Attrs: nounwind readnone uwtable
define { i32, i8, i8, i8, i8 } @_ZN3foo18hbb616262f874f8daf4v0.0E({ i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone) #0 {
"function top level":
ret { i32, i8, i8, i8, i8 } { i32 4, i8 5, i8 6, i8 7, i8 8 }
}
2013-10-01 02:57:59 -04:00