Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debuginfo: Support for generic functions and self arguments #8554

Closed
wants to merge 12 commits into from

Conversation

michaelwoerister
Copy link
Member

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:

Cheers,
Michael

Conflicts:
	src/librustc/lib/llvm.rs
	src/librustc/middle/trans/debuginfo.rs
	src/rustllvm/RustWrapper.cpp
	src/rustllvm/rustllvm.def.in
Also, always set no_monomorphic_collapse flags if debuginfo is generated.
…d tuple-structs.

Also new test cases for tuple structs and by-value parameter passing.
…tions:

* 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
@brson
Copy link
Contributor

brson commented Aug 17, 2013

wowie ❗

@brson
Copy link
Contributor

brson commented Aug 17, 2013

Well this is just awesome. I love that it's mostly self-contained in debuginfo.rs and comes with a felt-ton of test cases.

bors added a commit that referenced this pull request Aug 17, 2013
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
@graydon
Copy link
Contributor

graydon commented Aug 17, 2013

Superb! Amazing! 🍰 😹 👍

@bors bors closed this Aug 18, 2013
@michaelwoerister
Copy link
Member Author

@brson and @graydon: Thanks for cake, cat and exclamation marks :) I really appreciate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants