-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Attach debug locations to generated internal LLVM functions #10934
Attach debug locations to generated internal LLVM functions #10934
Conversation
|
@HertzDevil this looks good, yet I have the following questions if you can spare some time to clear them:
Thanks! |
|
I see, thanks! This is ready then (we're seeing some fluke in CI, but that's unrelated). |
Given the following:
This PR changes the generated LLVM IR from:
to:
This means theoretically it would be possible to debug through those complex constant initializers. The same goes for class variables.
Originally this PR covered only constant and class variables, but now it should include every generated internal LLVM function, e.g.
~metaclass
and~match
. Ones that have no real location are attached to??:1:1
.Another use case is that Compiler Explorer relies on
.loc
directives of the generated assembly files to properly filter "library code". Applying this PR reduces the number of ASM lines of an empty Crystal source file from around 13.3k to 4.1k, mainly because the huge initializer forString::CHAR_TO_DIGIT
is now gone, i.e. regarded as library code originating fromsrc/string.cr
. (Yes, support for Crystal in the Compiler Explorer went live.)