Use name-discarding LLVM context#47220
Conversation
This is only applicable when neither of --emit=llvm-ir or --emit=llvm-bc are not requested. In case either of these outputs are wanted, but the benefits of such context are desired as well, -Zfewer_names option provides the same functionality regardless of the outputs requested.
|
(rust_highfive has picked a reviewer for you, use r? to override) |
|
r? @eddyb or @nikomatsakis |
|
Some sort of test would be nice, but the only variant that can reasonably be tested is @bors r+ |
|
📌 Commit b719578 has been approved by |
|
💡 This pull request was already approved, no need to approve it again.
|
|
📌 Commit b719578 has been approved by |
|
|
||
| extern "C" LLVMContextRef LLVMRustContextCreate(bool shouldDiscardNames) { | ||
| auto ctx = new LLVMContext(); | ||
| ctx->setDiscardValueNames(shouldDiscardNames); |
There was a problem hiding this comment.
Why not expose just that method? Seems self-documenting.
There was a problem hiding this comment.
Just an arbitrary decision. I feel that function with an argument is slightly cleaner for our use-case.
Use name-discarding LLVM context This is only applicable when neither of --emit=llvm-ir or --emit=llvm-bc are not requested. In case either of these outputs are wanted, but the benefits of such context are desired as well, -Zfewer_names option provides the same functionality regardless of the outputs requested. Should be a viable fix for rust-lang#46449
|
I'll prepare a backport of this soon. |
|
Seems like @alexcrichton beat me to it |
This is only applicable when neither of --emit=llvm-ir or --emit=llvm-bc are not
requested.
In case either of these outputs are wanted, but the benefits of such context are
desired as well, -Zfewer_names option provides the same functionality regardless
of the outputs requested.
Should be a viable fix for #46449