Commit Graph

1518 Commits

Author SHA1 Message Date
bors
4bf074cc66 auto merge of #7134 : vadimcn/rust/DIBuilder, r=jdm
This commit fixes rustc's debug info generation and turns debug-info tests back on.

The old generator used to write out LLVM metadata directly, however it seems that debug metadata format is not stable and keeps changing from release to release.  So I wrapped LLVM's official debug info API - the DIBuilder class, and now rustc will use that.

One bit of old functionality that still doesn't work, is debug info for function arguments.  Someone more familiar with the compiler guts will need to look into that.

Also, unfortunately, debug info is still won't work on Windows,- due to a LLVM bug (http://llvm.org/bugs/show_bug.cgi?id=16249).

Resolves issues #5836, #5848, #6814
2013-06-17 14:01:35 -07:00
Brian Anderson
fd09e40f97 Revert "stop using an absolute rpath"
This reverts commit 708395d65d.
2013-06-17 12:37:06 -07:00
Graydon Hoare
6914ff9d01 rustc: map node ids through a table that ensures bitset indexes in dataflow are dense 2013-06-17 10:37:42 -07:00
Vadim Chugunov
adff46250e Fixed rebase fallout . 2013-06-17 08:42:05 -07:00
Vadim Chugunov
1e682e29eb Refactoring and tidy warnings cleanup. 2013-06-17 08:41:26 -07:00
Vadim Chugunov
2b45591daf Made unimplemented debuginfo a note rather than a compiler error. 2013-06-17 08:41:26 -07:00
Vadim Chugunov
65dd6218af Fixed remaining issues to pass debug-test/* tests.
Made debugger scripts source line insensitive.
2013-06-17 08:41:25 -07:00
Vadim Chugunov
62e86e044d Fixed compile warnings.
Fixed whitespace "errors".
2013-06-17 08:41:25 -07:00
Vadim Chugunov
00bb15bf72 Removed extraneous string allocations.
Misc refactoring.
2013-06-17 08:41:24 -07:00
Vadim Chugunov
6db3302b35 Debug loc for local var declarations 2013-06-17 08:41:24 -07:00
Vadim Chugunov
1079e41143 Move "return" basic block after all other function blocks. 2013-06-17 08:41:23 -07:00
Vadim Chugunov
6cc3189787 Made the while DebugContext mutable, not just created_* hashes
Disabled create_arg
2013-06-17 08:41:23 -07:00
Vadim Chugunov
868f9a88d6 Use DIBuilder in debuginfo 2013-06-17 08:41:23 -07:00
bors
3495737291 auto merge of #7157 : sstewartgallus/rust/master, r=brson
I did a little bit of cleanup work in driver.rs. It's not much but hey little steps.
2013-06-16 17:48:58 -07:00
bors
81506a6b81 auto merge of #7186 : dotdash/rust/landing_pads, r=pcwalton
Currently, cleanup blocks are only reused when there are nested scopes, the
child scope's cleanup block will terminate with a jump to the parent
scope's cleanup block. But within a single scope, adding or revoking
any cleanup will force a fresh cleanup block. This means quadratic
growth with the number of allocations in a scope, because each
allocation needs a landing pad.

Instead of forcing a fresh cleanup block, we can keep a list chained
cleanup blocks that form a prefix of the currently required cleanups.
That way, the next cleanup block only has to handle newly added
cleanups. And by keeping the whole list instead of just the latest
block, we can also handle revocations more efficiently, by only
dropping those blocks that are no longer required, instead of all of
them.

Reduces the size of librustc by about 5% and the time required to build
it by about 10%.
2013-06-16 11:48:57 -07:00
Niko Matsakis
e014ab9023 Make it illegal to move from *T. This interacts poorly with moves-based-on-type,
since it creates moves that were not apparent. It also turns out to be not
widely used.
2013-06-16 12:47:36 -04:00
Niko Matsakis
a9012a2ad1 Make type parameters not implicitly copyable, even if they have the Copy bound.
Consider: T:Copy could be bound to ~T, which is not implicitly copyable.
2013-06-16 12:47:36 -04:00
Niko Matsakis
eb48c29681 Add copies to type params with Copy bound 2013-06-16 12:47:36 -04:00
Björn Steinbrink
642cd467c6 Avoid quadratic growth of cleanup blocks
Currently, cleanup blocks are only reused when there are nested scopes, the
child scope's cleanup block will terminate with a jump to the parent
scope's cleanup block. But within a single scope, adding or revoking
any cleanup will force a fresh cleanup block. This means quadratic
growth with the number of allocations in a scope, because each
allocation needs a landing pad.

Instead of forcing a fresh cleanup block, we can keep a list chained
cleanup blocks that form a prefix of the currently required cleanups.
That way, the next cleanup block only has to handle newly added
cleanups. And by keeping the whole list instead of just the latest
block, we can also handle revocations more efficiently, by only
dropping those blocks that are no longer required, instead of all of
them.

Reduces the size of librustc by about 5% and the time required to build
it by about 10%.
2013-06-16 17:52:46 +02:00
bors
03dff61d99 auto merge of #7159 : Blei/rust/free-glue-no-destructor, r=graydon
The free glue shouldn't be called for structs, and the drop glue already
contains the destructor.
2013-06-16 04:40:01 -07:00
bors
d0f88cd54e auto merge of #7155 : Blei/rust/drop-glue-alloca, r=graydon
Removes one alloca and store from the drop glue of @ boxes. This speeds
up the rustc build by 1s (might be noise, though).
2013-06-16 02:46:08 -07:00
bors
f74e1935aa auto merge of #7123 : huonw/rust/more-str, r=thestinger
Moves all the remaining functions that could reasonably be methods to be methods, except for some FFI ones (which I believe @erickt is working on, possibly) and `each_split_within`, since I'm not really sure the details of it (I believe @kimundi wrote the current implementation, so maybe he could convert it to an external iterator method on `StrSlice`, e.g. `word_wrap_iter(&self) -> WordWrapIterator<'self>`, where `WordWrapIterator` impls `Iterator<&'self str>`. It probably won't be too hard, since it's already a state machine.)

This also cleans up the comparison impls for the string types, except I'm not sure how the lang items `eq_str` and `eq_str_uniq` need to be handled, so they (`eq_slice` and `eq`) remain stand-alone functions.
2013-06-16 00:04:13 -07:00
Huon Wilson
bbcff95ac5 remove unused imports 2013-06-16 12:20:12 +10:00
Daniel Micay
e097d5eaba rm CopyableOrderedIter
replaced with OrdIterator
2013-06-15 22:16:21 -04:00
Huon Wilson
4b18fff2be std: convert str::{map,levdistance,subslice_offset} to methods.
The first two become map_chars and lev_distance. Also, remove a few
allocations in rustdoc.
2013-06-16 10:50:28 +10:00
bors
c989b79127 auto merge of #7132 : thestinger/rust/rpath, r=brson
This is a bad default, because the binaries will point at an absolute
path regardless of where they are moved. This opens up a security issue
for packages, because they will attempt to load libraries from a path
that's often owned by a regular user.

Every Rust binary is currently flagged by Debian, Fedora and Arch lint
checkers as having dangerous rpaths. They don't meet the requirements to
be placed in the repositories without manually stripping this from each
binary.

The relative rpath is still enough to keep the binaries working until
they are moved relative to the crates they're linked against.

http://wiki.debian.org/RpathIssue
https://fedoraproject.org/wiki/Packaging:Guidelines#Beware_of_Rpath
2013-06-15 16:13:09 -07:00
Daniel Micay
708395d65d stop using an absolute rpath
This is a bad default, because the binaries will point at an absolute
path regardless of where they are moved. This opens up a security issue
for packages, because they will attempt to load libraries from a path
that's often owned by a regular user.

Every Rust binary is currently flagged by Debian, Fedora and Arch lint
checkers as having dangerous rpaths. They don't meet the requirements to
be placed in the repositories without manually stripping this from each
binary.

The relative rpath is still enough to keep the binaries working until
they are moved relative to the crates they're linked against.

http://wiki.debian.org/RpathIssue
https://fedoraproject.org/wiki/Packaging:Guidelines#Beware_of_Rpath
2013-06-15 18:17:24 -04:00
James Miller
f2a7fc69da Fix Merge Fallout 2013-06-16 09:20:40 +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
James Miller
01e098aa05 Make CrateContext::new() fn.
Move construction of a CrateContext into a static method on
CrateContext.
2013-06-16 09:17:50 +12:00
James Miller
b1f39ce403 Move CrateContext into it's own file 2013-06-16 09:17:50 +12:00
James Miller
98b1c9e207 Move trans mod items into trans/mod.rs 2013-06-16 09:17:50 +12:00
bors
998e41a11a auto merge of #7154 : dotdash/rust/glue, r=graydon
Currently, when calling glue functions, we cast the function to match
the argument type. This interacts very badly with LLVM and breaks
inlining of the glue code.

It's more efficient to use a unified function type for the glue
functions and always cast the function argument instead of the function.

The resulting code for rustc is about 13% faster (measured up to and
including the "trans" pass) and the resulting librustc is about 5%
smaller.
2013-06-15 12:58:06 -07:00
Steven Stewart-Gallus
f22580dd29 Fix up mingw32 case 2013-06-15 11:26:02 -07:00
Philipp Brüschweiler
4ee99a1c0c trans::glue: don't generate struct destructors in the free glue
The free glue shouldn't be called for structs, and the drop glue already
contains the destructor.
2013-06-15 20:13:23 +02:00
Björn Steinbrink
a08d768cd8 Fix inlining of glue code
Currently, when calling glue functions, we cast the function to match
the argument type. This interacts very badly with LLVM and breaks
inlining of the glue code.

It's more efficient to use a unified function type for the glue
functions and always cast the function argument instead of the function.

The resulting code for rustc is about 13% faster (measured up to and
including the "trans" pass) and the resulting librustc is about 5%
smaller.
2013-06-15 18:29:19 +02:00
Philipp Brüschweiler
3f69e20043 trans::glue: don't allocate a pointer variable if it already exists
Removes one alloca and store from the drop glue of @ boxes. This speeds
up the rustc build by 1s (might be noise, though).
2013-06-15 18:21:47 +02:00
bors
eac0200f18 auto merge of #7148 : catamorphism/rust/rustpkg_tests, r=graydon
r? @graydon Automate more tests described in the commands.txt file,
and add infrastructure for running them. Right now, tests shell
out to call rustpkg. This is not ideal.

Goes part of the way towards addressing #5683
2013-06-15 08:12:57 -07:00
bors
83d44f87e5 auto merge of #7125 : alexcrichton/rust/rusti-issues, r=brson
This un-reverts the reverts of the rusti commits made awhile back. These were reverted for an LLVM failure in rustpkg. I believe that this is not a problem with these commits, but rather that rustc is being used in parallel for rustpkg tests (in-process). This is not working yet (almost! see #7011), so I serialized all the tests to run one after another.

@brson, I'm mainly just guessing as to the cause of the LLVM failures in rustpkg tests. I'm confident that running tests in parallel is more likely to be the problem than those commits I made.

Additionally, this fixes two recently reported issues with rusti.
2013-06-15 01:04:05 -07:00
Steven Stewart-Gallus
5de67f9cc9 Cleaned up driver.rs 2013-06-15 00:43:19 -07:00
Tim Chevalier
1adbb4520b rustc: Don't continue to resolve if there's an error in lang_items
This confused me when it happened.
2013-06-14 22:45:43 -07:00
bors
1ba6fa4777 auto merge of #7110 : thestinger/rust/iterator, r=brson 2013-06-14 21:37:27 -07:00
bors
1104e659d5 auto merge of #7144 : dotdash/rust/caches, r=graydon
The lookups for these items in external crates currently cause repeated
decoding of the EBML metadata, which is pretty slow. Adding caches to
avoid the repeated decoding reduces the time required for the type
checking of librustc by about 25%.
2013-06-14 20:28:09 -07:00
Daniel Micay
585f5f7f79 add IteratorUtil to the prelude 2013-06-14 23:15:42 -04:00
Björn Steinbrink
a710e61903 Add caches for method and impl metadata
The lookups for these items in external crates currently cause repeated
decoding of the EBML metadata, which is pretty slow. Adding caches to
avoid the repeated decoding reduces the time required for the type
checking of librustc by about 25%.
2013-06-15 04:28:19 +02:00
bors
104e6120b1 auto merge of #7116 : thestinger/rust/whitespace, r=luqmana 2013-06-14 19:25:05 -07:00
Alex Crichton
dc18321ef5 Don't run passes again on JIT code
These passes are already run beforehand, no need to do them twice.
2013-06-13 22:53:10 -07:00
Alex Crichton
a90fffe367 Revert "Revert "Have JIT execution take ownership of the LLVMContextRef""
This reverts commit 19adece68b.
2013-06-13 21:25:18 -07:00
Alex Crichton
1a3edecbf2 Revert "Revert "Remove all usage of the global LLVMContextRef""
This reverts commit 541c657a73.
2013-06-13 21:25:12 -07:00
Brian Anderson
7755018074 Revert "std: convert {vec,str}::to_owned to methods."
This fixes the strange random crashes in compile-fail tests.

This reverts commit 96cd61ad03.

Conflicts:
	src/librustc/driver/driver.rs
	src/libstd/str.rs
	src/libsyntax/ext/quote.rs
2013-06-13 19:06:47 -07:00