Commit Graph

1980 Commits

Author SHA1 Message Date
Alex Crichton
7baff57f26 Improve name mangling for gdb
Remove __extensions__ from method symbols as well as the meth_XXX. The XXX is
now used to append a few characters at the end of the name of the symbol.

Closes #6602
2013-09-04 23:28:23 -07:00
Alex Crichton
36a4af49e0 Remove __extensions__ in names for a "pretty name"
As with the previous commit, this is targeted at removing the possibility of
collisions between statics. The main use case here is when there's a
type-parametric function with an inner static that's compiled as a library.
Before this commit, any impl would generate a path item of "__extensions__".
This changes this identifier to be a "pretty name", which is either the last
element of the path of the trait implemented or the last element of the type's
path that's being implemented.  That doesn't quite cut it though, so the (trait,
type) pair is hashed and again used to append information to the symbol.

Essentially, __extensions__ was removed for something nicer for debugging, and
then some more information was added to symbol name by including a hash of the
trait being implemented and type it's being implemented for. This should prevent
colliding names for inner statics in regular functions with similar names.
2013-09-02 23:12:41 -07:00
Daniel Micay
331d2d6d31 repr: handle tuple structs sanely
Closes #8919
2013-09-02 04:10:56 -04:00
Daniel Micay
cc1f0027c7 repr: add support for trait objects
Closes #8916
2013-09-02 02:50:14 -04:00
Marvin Löbel
857f867320 Renamed syntax::ast::ident -> Ident 2013-09-02 02:51:21 +02:00
Marvin Löbel
539f37925c Modernized a few type names in rustc and syntax 2013-09-01 14:43:26 +02:00
bors
a60c6a8b18 auto merge of #8903 : luqmana/rust/en, r=thestinger
Fixes #8735.
2013-08-31 16:25:40 -07:00
bors
04fac7f90d auto merge of #8899 : thestinger/rust/repr, r=huonw 2013-08-31 15:15:40 -07:00
Luqman Aden
ba5f101fa9 librustc: Add export_name attribute to specify symbol name. 2013-08-31 13:23:31 -04:00
Daniel Micay
874611b348 repr: print the name of structs 2013-08-31 03:54:13 -04:00
bors
29449e355a auto merge of #8889 : erickt/rust/cleanup, r=catamorphism
This fixes a couple minor things I've been sitting on. It cleans up some warnings, CapCases some types in librustc's rscope module, and adds a fixme.
2013-08-30 17:20:36 -07:00
Erick Tryzelaar
66e3a4c50e rustc: capitalize types in rscope.rs 2013-08-30 15:10:55 -07:00
Tim Chevalier
8464ee04a4 rustc: Change a stray error! statement to debug! 2013-08-30 14:31:52 -07:00
bors
f9142536a6 auto merge of #8869 : alexcrichton/rust/issue-8847-fix-unused, r=huonw
Closes #8847
2013-08-30 07:35:40 -07:00
bors
f10e50a4be auto merge of #8843 : alexcrichton/rust/fix-bug, r=huonw
Whenever a generic function was encountered, only the top-level items were
recursed upon, even though the function could contain items inside blocks or
nested inside of other expressions. This fixes the existing code from traversing
just the top level items to using a Visitor to deeply recurse and find any items
which need to be translated.

This was uncovered when building code with --lib, because the encode_symbol
function would panic once it found that an item hadn't been translated.

Closes #8134
2013-08-30 02:25:47 -07:00
bors
f94844c558 auto merge of #8820 : alexcrichton/rust/no-io-writer, r=brson
At the same time, this updates the TyVisitor to use a mutable self because it's
probably going to be mutating state as it goes along anyway.
2013-08-30 01:20:44 -07:00
Alex Crichton
6409f6bcf1 Correct the sources of glob imports
Closes #8847
2013-08-29 19:54:10 -07:00
Alex Crichton
2c1d6568f2 Fix a bug with statics inside blocks in generic fns
Whenever a generic function was encountered, only the top-level items were
recursed upon, even though the function could contain items inside blocks or
nested inside of other expressions. This fixes the existing code from traversing
just the top level items to using a Visitor to deeply recurse and find any items
which need to be translated.

This was uncovered when building code with --lib, because the encode_symbol
function would panic once it found that an item hadn't been translated.

Closes #8134
2013-08-29 18:51:29 -07:00
Alex Crichton
97f61e7bbe Remove @io::Writer from sys/repr/reflect
At the same time, this updates the TyVisitor to use a mutable self because it's
probably going to be mutating state as it goes along anyway.
2013-08-28 23:00:46 -07:00
bors
7971c46c44 auto merge of #8718 : bblum/rust/typeof, r=pcwalton
r? anybody
2013-08-28 15:30:38 -07:00
bors
64ed3721f7 auto merge of #8807 : alexcrichton/rust/remove-two-offsets, r=thestinger
Everything that we do is actually inbounds, so there's no reason for us to be exposing two of these functions
2013-08-28 11:00:41 -07:00
bors
9708ef03a6 auto merge of #8806 : klutzy/rust/winmain, r=cmr
Fixes #8510.
2013-08-28 07:25:42 -07:00
Alex Crichton
e3662b1880 Remove offset_inbounds for an unsafe offset function 2013-08-27 23:22:52 -07:00
klutzy
eaa565829d rustc: Use "main" entry point on Windows
Fixes #8510.
2013-08-28 13:43:11 +09:00
Patrick Walton
aac9d6eee9 librustc: Fix merge fallout 2013-08-27 19:09:27 -07:00
Patrick Walton
2bd46e767c librustc: Fix problem with cross-crate reexported static methods. 2013-08-27 18:47:59 -07:00
Patrick Walton
6c37e3b7f8 librustc: Implement basic lazy implementation loading.
This is only for implementations defined in the same crate as the trait they
implement.
2013-08-27 18:47:59 -07:00
Patrick Walton
ff7b8d6d88 librustc: Implement lazy module loading. 2013-08-27 18:47:58 -07:00
Patrick Walton
1bbb1e06f1 librustc: Remove each_path.
This does not implement lazy symbol resolution yet.
2013-08-27 18:47:58 -07:00
Patrick Walton
d9bb78efdf librustc: Stop calling each_path in coherence.
10% win or so for small crates.
2013-08-27 18:47:58 -07:00
Patrick Walton
4f32a2d854 librustc: Fix merge fallout. 2013-08-27 18:47:57 -07:00
Patrick Walton
a20af8b276 librustc: Convert check loans to use the new visitor 2013-08-27 18:47:57 -07:00
Patrick Walton
8693943676 librustc: Ensure that type parameters are in the right positions in paths.
This removes the stacking of type parameters that occurs when invoking
trait methods, and fixes all places in the standard library that were
relying on it. It is somewhat awkward in places; I think we'll probably
want something like the `Foo::<for T>::new()` syntax.
2013-08-27 18:47:57 -07:00
Patrick Walton
3b6314c39b librustc: Add support for type parameters in the middle of paths.
For example, `foo::<T>::bar::<U>`.

This doesn't enforce that the type parameters are in the right
positions, however.
2013-08-27 18:46:51 -07:00
Patrick Walton
5c3504799d librustc: Remove &const and *const from the language.
They are still present as part of the borrow check.
2013-08-27 18:46:51 -07:00
bors
58d6eb5048 auto merge of #8797 : nikomatsakis/rust/issue-8625-assign-to-andmut-in-borrowed-loc-2, r=pcwalton
Fixes for #8625 to prevent assigning to `&mut` in borrowed or aliasable locations. The old code was insufficient in that it failed to catch bizarre cases like `& &mut &mut`. 

r? @pnkfelix
2013-08-27 17:05:46 -07:00
Niko Matsakis
8c09865b66 Remove remnants of implicit self 2013-08-27 16:49:06 -04:00
Daniel Micay
c2bc59e086 repr: print integer/float suffixes 2013-08-27 16:31:45 -04:00
Niko Matsakis
35a4177550 Extend aliasability check to uncover & &mut &mut and the like 2013-08-27 15:45:19 -04:00
bors
35f975b838 auto merge of #8700 : alexcrichton/rust/better-llvm, r=thestinger
Beforehand, it was unclear whether rust was performing the "recommended set" of
optimizations provided by LLVM for code. This commit changes the way we run
passes to closely mirror that of clang, which in theory does it correctly. The
notable changes include:

* Passes are no longer explicitly added one by one. This would be difficult to
  keep up with as LLVM changes and we don't guaranteed always know the best
  order in which to run passes
* Passes are now managed by LLVM's PassManagerBuilder object. This is then used
  to populate the various pass managers run.
* We now run both a FunctionPassManager and a module-wide PassManager. This is
  what clang does, and I presume that we *may* see a speed boost from the
  module-wide passes just having to do less work. I have no measured this.
* The codegen pass manager has been extracted to its own separate pass manager
  to not get mixed up with the other passes
* All pass managers now include passes for target-specific data layout and
  analysis passes

Some new features include:

* You can now print all passes being run with `-Z print-llvm-passes`
* When specifying passes via `--passes`, the passes are now appended to the
  default list of passes instead of overwriting them.
* The output of `--passes list` is now generated by LLVM instead of maintaining
  a list of passes ourselves
* Loop vectorization is turned on by default as an optimization pass and can be
  disabled with `-Z no-vectorize-loops`


All of these "copies" of clang are based off their [source code](http://clang.llvm.org/doxygen/BackendUtil_8cpp_source.html) in case anyone is curious what my source is. I was hoping that this would fix #8665, but this does not help the performance issues found there. Hopefully i'll allow us to tweak passes or see what's going on to try to debug that problem.
2013-08-26 21:25:55 -07:00
Alex Crichton
73540551e5 Rewrite pass management with LLVM
Beforehand, it was unclear whether rust was performing the "recommended set" of
optimizations provided by LLVM for code. This commit changes the way we run
passes to closely mirror that of clang, which in theory does it correctly. The
notable changes include:

* Passes are no longer explicitly added one by one. This would be difficult to
  keep up with as LLVM changes and we don't guaranteed always know the best
  order in which to run passes
* Passes are now managed by LLVM's PassManagerBuilder object. This is then used
  to populate the various pass managers run.
* We now run both a FunctionPassManager and a module-wide PassManager. This is
  what clang does, and I presume that we *may* see a speed boost from the
  module-wide passes just having to do less work. I have no measured this.
* The codegen pass manager has been extracted to its own separate pass manager
  to not get mixed up with the other passes
* All pass managers now include passes for target-specific data layout and
  analysis passes

Some new features include:

* You can now print all passes being run with `-Z print-llvm-passes`
* When specifying passes via `--passes`, the passes are now appended to the
  default list of passes instead of overwriting them.
* The output of `--passes list` is now generated by LLVM instead of maintaining
  a list of passes ourselves
* Loop vectorization is turned on by default as an optimization pass and can be
  disabled with `-Z no-vectorize-loops`
2013-08-26 20:11:51 -07:00
bors
ce27752a69 auto merge of #8488 : klutzy/rust/mingw-w64, r=brson
This patchset enables rustc to cross-build mingw-w64 outputs.
Tested on mingw + mingw-w64 (mingw-builds, win64/seh/win32-threads/gcc-4.8.1).

I also patched llvm to support Win64 stack unwinding.
ebe22bdbce

I cross-built test/run-pass/smallest-hello-world.rs and confirmed it works.
However, I also found something went wrong if I don't have custom `#[start]` routine.
2013-08-26 11:46:13 -07:00
bors
c6eb3ec30c auto merge of #8758 : pnkfelix/rust/fsk-more-oldvisit-ports, r=pnkfelix
Further followup on #7081.

There still remains writeback.rs, but I want to wait to investigate that one because I've seen `make check` issues with it in the past.
2013-08-26 08:26:14 -07:00
klutzy
e41a81b1ee Set main_name "WinMain" on Win64 2013-08-26 22:15:26 +09:00
Felix S. Klock II
2f82d89b28 Placate make tidy. 2013-08-26 13:27:36 +02:00
Felix S. Klock II
df6644104e Port typeck/check/vtable.rs from oldvisit to <V:Visitor> trait API. 2013-08-26 11:49:24 +02:00
Felix S. Klock II
da88f69f06 Port middle/stack_check.rs from oldvisit to <V:Visitor> trait API. 2013-08-26 11:43:14 +02:00
Felix S. Klock II
6af6b088ad Port middle/moves.rs from oldvisit to <V:Visitor> trait API. 2013-08-26 11:31:21 +02:00
Felix S. Klock II
ec6ab8c899 Remove occurrences of oldvisit text to improve grepping for old oldvisit. 2013-08-26 11:10:18 +02:00
Brian Anderson
4aa342b868 Revert "auto merge of #8745 : brson/rust/metadata, r=cmr"
This reverts commit 491bc3568c, reversing
changes made to 05f1bbba16.
2013-08-25 20:21:13 -07:00