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
Using --no-codegen blocks --emit options #5820
Comments
This also means that there is no way to dump llvm IR when there is a |
In order to debug #5972 I had to modify the compiler manually to disable module validation. So +1 to that! |
While looking into that, I noticed that all the codegen phases (mainly Also the current emit options are in 2 categories:
Those are currently all handled and processed after binary codegen. By having the WDYT? |
Also, when doing Maybe if there is |
What's so bad about not using |
@asterite True, these are all different stages of codegen. But what do you do if you want the
|
You just wait a little more? :-)
There's the confusion. Codegen means "run code to create the LLVM in memory". Emit comes after that. Of course we could change that, but I don't see the point. Just wait a few more seconds and you'll have it. |
Or, well, put another one, if someone wants to implement it, please send a PR (I won't) |
Also, there could be a I think it allows more control, and remove weird edge cases like "always do IR codegen when --emit is llvm-ir even on --no-codegen". |
For the Compiler Explorer it would be very useful if the assembly and the IR can both be generated without actually compiling / linking that into a binary or |
Agree with HertzDevil above. It would be useful to be able to emit and inspect the IR without needing to link |
When we do:
crystal build hello.cr --emit llvm-ir --no-codegen
It'll not generate the
hello.ll
file even though it was asked for.This is because the emit options are handled all-in-one-place in the
CompilationUnit#emit
methodcrystal/src/compiler/crystal/compiler.cr
Lines 676 to 687 in 80cbe66
Which is called in the
codegen
block:crystal/src/compiler/crystal/compiler.cr
Lines 339 to 353 in 80cbe66
At line 348.
I think it should emit what was asked for as soon as it get it, so the llvm-ir after it was built, the obj in the codegen phase, etc..
The text was updated successfully, but these errors were encountered: