Daniel Micay
0e885e42b1
remove reference counting headers from ~
...
Unique pointers and vectors currently contain a reference counting
header when containing a managed pointer.
This `{ ref_count, type_desc, prev, next }` header is not necessary and
not a sensible foundation for tracing. It adds needless complexity to
library code and is responsible for breakage in places where the branch
has been left out.
The `borrow_offset` field can now be removed from `TyDesc` along with
the associated handling in the compiler.
Closes #9510
Closes #11533
2014-01-14 22:01:40 -05:00
Eduard Burtescu
509fc92a9b
Removed remnants of @mut
and ~mut
from comments and the type system.
2014-01-12 02:26:04 +02: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
Patrick Walton
5e637a890c
librustc: Move block contexts into per-function arenas, and
...
stack-allocate function contexts.
2014-01-07 17:00:47 -08:00
Brian Anderson
3b1862a82f
Don't allow newtype structs to be dereferenced. #6246
2014-01-04 14:44:12 -08:00
Brian Anderson
18cef3fad4
Don't allow single-variant enums to be dereferenced. #6246
...
I'm not sure if this was even intentional at this point.
2014-01-04 13:17:31 -08:00
Patrick Walton
88281290ff
librustc: Remove @mut
support from the typechecker and borrow checker
2014-01-03 14:02:01 -08:00
Patrick Walton
b941677ea3
librustc: De-@mut
the crate context
2013-12-26 13:01:26 -08:00
Patrick Walton
c9432327c4
librustc: Change @mut Block
to @Block
.
2013-12-26 13:01:21 -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
Niko Matsakis
195f1d77bd
Rename and modernize region enum names
2013-11-08 19:47:57 -05:00
Niko Matsakis
3d1f3f4de0
Rename misleading contains_managed to owns_managed
2013-11-05 15:51:18 -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
34ae5d70ac
partially fix immediate rvalues
...
The code generation previously assumed a reference could not alter the
value in a way the destructor would notice. This is an incorrect
assumption for `&mut`, and is also incorrect for an `&` pointer to a
non-`Freeze` type.
Closes #7972
2013-10-17 16:50:07 -04:00
Daniel Micay
bd7610f3e3
introduce base_and_len
fns for element length
2013-10-16 12:28:25 -04:00
Daniel Micay
ef3ec1fe97
rename base_and_len
-> base_and_byte_len
2013-10-16 12:00:31 -04:00
Alex Crichton
de7d143176
Fix existing privacy/visibility violations
...
This commit fixes all of the fallout of the previous commit which is an attempt
to refine privacy. There were a few unfortunate leaks which now must be plugged,
and the most horrible one is the current `shouldnt_be_public` module now inside
`std::rt`. I think that this either needs a slight reorganization of the
runtime, or otherwise it needs to just wait for the external users of these
modules to get replaced with their `rt` implementations.
Other fixes involve making things pub which should be pub, and otherwise
updating error messages that now reference privacy instead of referencing an
"unresolved name" (yay!).
2013-10-07 13:00:52 -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
Alex Crichton
1b80558be3
rustc: Remove usage of fmt!
2013-09-30 23:21:19 -07:00
Daniel Micay
11b7109b7b
rm only use of type_is_immediate outside of trans
2013-09-30 18:16:35 -04:00
Marvin Löbel
7419085337
Modernized a few more types in syntax::ast
2013-09-03 14:45:06 +02:00
Marvin Löbel
539f37925c
Modernized a few type names in rustc and syntax
2013-09-01 14:43:26 +02:00
Niko Matsakis
303f650ecf
Issue #3678 : Remove wrappers and call foreign functions directly
2013-08-19 07:13:15 -04:00
Michael Woerister
8a329770b6
New naming convention for ast::{node_id, local_crate, crate_node_id, blk_check_mode, ty_field, ty_method}
2013-07-29 16:16:48 +02:00
Michael Woerister
3315edfae7
Adapted trans::common::{block, fn_ctxt, scope_info}
to new naming convention.
2013-07-23 15:38:55 +02:00
Huon Wilson
e252277fe9
rustc: handle allocas and LoadRangeAsserts in unreachable blocks correctly.
...
An alloca in an unreachable block would shortcircuit with Undef, but with type
`Type`, rather than type `*Type` (i.e. a plain value, not a pointer) but it is
expected to return a pointer into the stack, leading to confusion and LLVM
asserts later.
Similarly, attaching the range metadata to a Load in an unreachable block
makes LLVM unhappy, since the Load returns Undef.
Fixes #7344 .
2013-07-17 03:13:23 +10:00
Brendan Cully
e6e4f52bcf
remove unused imports
2013-07-10 22:08:50 -07:00
Niko Matsakis
2d3262ca7b
Update trans to use type to decide when to move, not the moves table (simpler
...
for cases where it's hard to decide what id to use for the lookup); modify
irrefutable bindings code to move or copy depending on the type, rather than
threading through a flag. Also updates how local variables and arguments are
registered. These changes were hard to isolate.
2013-07-08 13:55:10 -04:00
Niko Matsakis
41efcdf299
Make all allocas named so we can see where they originate
...
in the generated LLVM code.
2013-07-08 13:55:10 -04:00
Daniel Micay
90f1db10fa
remove headers from exchange allocations
2013-07-08 04:54:41 -04:00
Seo Sanghyeon
8aa26ad454
Fix dereference of temporary immediate newtype structs
2013-07-02 01:08:51 +09:00
Seo Sanghyeon
fd19289108
Classify newtype structs S(T) as immediates if T is an immediate
2013-07-01 13:02:14 +09:00
Corey Richardson
1662bd371c
Great renaming: propagate throughout the rest of the codebase
2013-06-29 11:20:02 -04:00
Philipp Brüschweiler
7295a6da92
Remove many shared pointers
...
Mostly just low-haning fruit, i.e. function arguments that were @ even
though & would work just as well.
Reduces librustc.so size by 200k when compiling without -O, by 100k when
compiling with -O.
2013-06-27 15:06:19 +02:00
James Miller
048ed1486f
Move count-llvm-insn code into task-local storage
2013-06-22 12:38:40 +12:00
James Miller
57a75374d6
Initial Type Refactoring done
2013-06-22 12:32:11 +12:00
James Miller
b4b2cbb299
Change calls for TypeName stuff to methods
2013-06-22 12:24:20 +12:00
James Miller
cc908b772c
Remove @-fields from CrateContext
...
Remove all the explicit @mut-fields from CrateContext, though many
fields are still @-ptrs.
This required changing every single function call that explicitly
took a @CrateContext, so I took advantage and changed as many as I
could get away with to &-ptrs or &mut ptrs.
2013-06-16 09:20:40 +12:00
Patrick Walton
5fb254695b
Remove all uses of pub impl
. rs=style
2013-06-01 09:18:27 -07:00
Niko Matsakis
5209709e46
Fix matching of rvalues with destructors
...
Fixes #4542 .
2013-05-30 15:20:36 -04:00
Niko Matsakis
7dfb865339
Remove local_imm/local_mem since all variables are now by reference
2013-05-30 09:54:38 -04:00
Niko Matsakis
dcd84901c6
Remove TrByImplicitRef and source field on datums
2013-05-30 09:47:14 -04:00
Patrick Walton
206ab89629
librustc: Stop reexporting the standard modules from prelude.
2013-05-29 19:04:53 -07:00
Patrick Walton
f3723cf7c4
libextra: Rename the actual metadata names of libcore to libstd and libstd to libextra
2013-05-22 21:57:07 -07:00
Brian Anderson
66319b0278
Register snapshots
2013-05-19 23:34:32 -07:00
Corey Richardson
cc57ca012a
Use assert_eq! rather than assert! where possible
2013-05-19 08:16:02 -04:00