-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
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 |
free((void *)LastError); | ||
LastError = strdup(Err); | ||
} | ||
|
||
extern "C" LLVMContextRef LLVMRustContextCreate(bool shouldDiscardNames) { | ||
auto ctx = new LLVMContext(); | ||
ctx->setDiscardValueNames(shouldDiscardNames); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not expose just that method? Seems self-documenting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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