Vadim Chugunov
7f79b52ad9
Un-disabled debug info tests on Windows.
2013-08-26 01:23:18 -07:00
bors
679102109f
auto merge of #8554 : michaelwoerister/rust/generics, r=brson
...
This pull request includes support for generic functions and self arguments in methods, and combinations thereof. This also encompasses any kind of trait methods, regular and static, with and without default implementation. The implementation is backed up by a felt ton of test cases `:)`
This is a very important step towards being able to compile larger programs with debug info, since practically any generic function caused an ICE before.
One point worth discussing is that activating debug info now automatically (and silently) sets the `no_monomorphic_collapse` flag. Otherwise debug info would show wrong type names in all but one instance of the monomorphized function.
Another thing to note is that the handling of generic types does not strictly follow the DWARF specification. That is, variables with type `T` (where `T=int`) are described as having type `int` and not as having type `T`. In other words, we are losing information whether a variable has been declared with a type parameter as its type. In practice this should not make much of difference though since the concrete type is mostly what one is interested in. I'll post an issue later so this won't be forgotten.
Also included are a number of bug fixes:
* Closes #1758
* Closes #8513
* Closes #8443
* Fixes handling of field names in tuple structs
* Fixes and re-enables test case for option-like enums that relied on undefined behavior before
* Closes #1339 (should have been closed a while ago)
Cheers,
Michael
2013-08-17 15:22:04 -07:00
Erick Tryzelaar
ad5c676853
Fix warnings it tests
2013-08-17 08:42:35 -07:00
Michael Woerister
80fb2f2056
debuginfo: Added test cases for static struct and enum methods.
2013-08-16 22:30:43 +02:00
Michael Woerister
5abb7c3a67
debuginfo: Test cases for [generic][default][static] methods and functions:
...
* closure-in-generic-function
* generic-functions-nested
* generic-method-on-generic-struct
* generic-trait-generic-static-default-method
* method-on-generic-struct
* self-in-generic-default-method
* trait-generic-static-default-method
Also, fixed an 'unused variable' warning in debuginfo.rs
2013-08-16 22:30:43 +02:00
Michael Woerister
024d644c68
debuginfo: Add test case for issue #8513 .
2013-08-16 22:30:43 +02:00
Michael Woerister
c1734cef33
debuginfo: Implemented support for Self type parameter in trait methods with default implementation.
2013-08-16 22:30:43 +02:00
Michael Woerister
a36e53730f
debuginfo: Added test cases for methods on structs, enums, traits, and tuple-structs.
...
Also new test cases for tuple structs and by-value parameter passing.
2013-08-16 22:30:43 +02:00
Michael Woerister
5c9d7c2072
debuginfo: Added test cases for generic structs and enums.
...
Also, always set no_monomorphic_collapse flags if debuginfo is generated.
2013-08-16 22:30:42 +02:00
Michael Woerister
6c49c2df76
debuginfo: Properly handle monomorphization of generic functions.
2013-08-16 22:30:42 +02:00
Michael Woerister
907633b1bf
debuginfo: Generate template type parameters for generic functions.
...
Conflicts:
src/librustc/lib/llvm.rs
src/librustc/middle/trans/debuginfo.rs
src/rustllvm/RustWrapper.cpp
src/rustllvm/rustllvm.def.in
2013-08-16 22:27:38 +02:00
Michael Woerister
1dec27bed5
debuginfo: Fixed option-like-enum test case so it does not rely on undefined behavior.
2013-08-16 22:27:38 +02:00
Michael Woerister
983cc777c5
debuginfo: Add some tests for visibiliy scopes within closures.
2013-08-13 11:13:49 +02:00
Michael Woerister
9c7d9eb6fd
debuginfo: Add support for argument shadowing.
2013-08-13 11:13:49 +02:00
Michael Woerister
33e7d95e9c
debuginfo: Implemented proper handling of lexical scopes and variable shadowing.
2013-08-13 11:13:49 +02:00
Brian Anderson
ad8010fdf2
xfail debug-info/option-like-enum
...
Don't understand why this broke.
2013-08-07 15:40:27 -07:00
Michael Woerister
d54615528c
debuginfo: Fixed a few things for PR.
2013-07-25 23:05:56 +02:00
Michael Woerister
02a0f2822e
debuginfo: Support for destructured function arguments.
2013-07-25 19:47:03 +02:00
Michael Woerister
c9e51cef12
debuginfo: Support for function arguments. (WIP)
2013-07-25 19:47:03 +02:00
Michael Woerister
203f96f71d
debuginfo: Implemented support for destructured locals.
...
Conflicts:
src/librustc/middle/trans/debuginfo.rs
src/test/debug-info/destructured-local.rs
2013-07-25 19:47:03 +02:00
Michael Woerister
a1303cc815
debuginfo: Removed some test relying on data structure sizes hard to predict for all possible platforms and configurations.
2013-07-20 10:47:24 +02:00
Michael Woerister
e9baeab695
debuginfo: Adapted DI generation to new memory layout of unique vecs.
2013-07-19 07:58:28 +02:00
Michael Woerister
b2aeb4b04b
debuginfo: Cleaned up style issues for pull request.
2013-07-19 07:58:28 +02:00
Michael Woerister
eed2d0e1f2
debuginfo: Added support for Option<T>-like enums.
2013-07-19 07:57:39 +02:00
Michael Woerister
7af2e6ee45
debuginfo: Fixed unique pointers to data containing managed pointers.
2013-07-19 07:57:39 +02:00
Michael Woerister
e0108a47ab
debuginfo: DI generation for enums uses adt::represent_type() now.
2013-07-19 07:57:38 +02:00
Michael Woerister
70e5c08e39
debuginfo: Extended test suite with various tests for enums.
2013-07-19 07:57:38 +02:00
Michael Woerister
77a00cca03
debuginfo: Fixes related to changed memory layout of unique allocations
2013-07-19 07:55:25 +02:00
Michael Woerister
3b06df4e35
debuginfo: Added support for struct-style enums.
2013-07-19 07:55:25 +02:00
Michael Woerister
7cf0aac6cf
debuginfo: Better support for univariant tuple-style enums.
2013-07-19 07:55:24 +02:00
Michael Woerister
f389bd8f2a
debuginfo: Support for tuple-style enums (WIP)
2013-07-19 07:55:24 +02:00
Michael Woerister
739f3eece9
debuginfo: Added support for c-style enums.
2013-07-19 07:55:24 +02:00
Michael Woerister
99ebb816cf
debuginfo: Added test cases for packed structs (/w drop)
2013-07-19 07:55:24 +02:00
Michael Woerister
f424e931da
debuginfo: Refactoring of composite type info generation done.
...
There is no more StructContext now. Better support for boxed vectors in there too.
2013-07-19 07:55:24 +02:00
Michael Woerister
36ea756831
debuginfo: Refactored vec slice code to use the new infrastructure. Added test cases for vec slices.
2013-07-19 07:53:58 +02:00
Michael Woerister
7a31a3e071
debuginfo: Removed some misleading comments from test cases.
2013-07-19 07:53:57 +02:00
Michael Woerister
1b20831c1e
debuginfo: Renamed *reference-to-* test cases to *borrowed-*
2013-07-19 07:53:57 +02:00
Michael Woerister
976d7a53cb
debuginfo: Began refactoring of composite type handling.
2013-07-19 07:53:57 +02:00
Michael Woerister
2f5e33d02f
debuginfo: Some corrections after review.
2013-06-27 19:28:37 +02:00
Michael Woerister
42dbae7f2a
debuginfo: Formatting cleanup.
2013-06-27 19:28:37 +02:00
Michael Woerister
4fb471ab78
debuginfo: Added test case for function arguments.
2013-06-27 19:28:37 +02:00
Michael Woerister
074e0fa2a9
debuginfo: Added test case for local variables declared with destructuring.
2013-06-27 19:28:37 +02:00
Michael Woerister
9102ad035c
debuginfo: Added more tests for region pointers (tuples, structs).
2013-06-27 19:28:37 +02:00
Michael Woerister
6a3094159f
debuginfo: Fixed some instances of gdb wrongly printing u8/i8 values as chars.
2013-06-27 19:28:37 +02:00
Michael Woerister
fb3e17b93a
debuginfo: Added test cases for region pointers into heap boxes for basic types.
2013-06-27 19:28:37 +02:00
Michael Woerister
751f0fba6f
debuginfo: Added test case for region pointers pointing to stack values with basic type.
2013-06-27 19:28:37 +02:00
Michael Woerister
168eba9201
debuginfo: Added test case for structs with destructor.
2013-06-27 19:28:17 +02:00
Michael Woerister
0b5fef3b26
debuginfo: Added test case for local variable scopes.
2013-06-27 19:28:17 +02:00
Michael Woerister
1dc8e76d3a
debuginfo: Made test cases use correct naming convention for variables.
2013-06-27 19:28:17 +02:00
Michael Woerister
5f97a6e951
debuginfo: Added test cases for tuples contained in structs.
2013-06-27 19:28:17 +02:00