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

Use name-discarding LLVM context #47220

Merged
merged 1 commit into from
Jan 6, 2018
Merged

Use name-discarding LLVM context #47220

merged 1 commit into from
Jan 6, 2018

Conversation

nagisa
Copy link
Member

@nagisa nagisa commented Jan 5, 2018

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

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
Copy link
Collaborator

r? @petrochenkov

(rust_highfive has picked a reviewer for you, use r? to override)

@nagisa
Copy link
Member Author

nagisa commented Jan 5, 2018

r? @eddyb or @nikomatsakis

@rust-highfive rust-highfive assigned eddyb and unassigned petrochenkov Jan 5, 2018
@hanna-kruppe
Copy link
Contributor

hanna-kruppe commented Jan 5, 2018

Some sort of test would be nice, but the only variant that can reasonably be tested is --emit llvm-ir -Zfewer-names, and even then a plain codegen test would somewhat fragile. Whatever.

@bors r+

@bors
Copy link
Contributor

bors commented Jan 5, 2018

📌 Commit b719578 has been approved by rkruppe

@bors
Copy link
Contributor

bors commented Jan 5, 2018

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Contributor

bors commented Jan 5, 2018

📌 Commit b719578 has been approved by rkruppe

free((void *)LastError);
LastError = strdup(Err);
}

extern "C" LLVMContextRef LLVMRustContextCreate(bool shouldDiscardNames) {
auto ctx = new LLVMContext();
ctx->setDiscardValueNames(shouldDiscardNames);
Copy link
Member

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.

Copy link
Member Author

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.

@eddyb eddyb added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jan 5, 2018
@shepmaster shepmaster added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 6, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Jan 6, 2018
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
bors added a commit that referenced this pull request Jan 6, 2018
Rollup of 7 pull requests

- Successful merges: #46947, #47170, #47190, #47205, #47217, #47220, #47230
- Failed merges: #47233
@bors bors merged commit b719578 into rust-lang:master Jan 6, 2018
@nagisa nagisa added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jan 7, 2018
@nikomatsakis nikomatsakis added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Jan 11, 2018
@michaelwoerister
Copy link
Member

I'll prepare a backport of this soon.

@alexcrichton alexcrichton removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jan 18, 2018
bors added a commit that referenced this pull request Jan 18, 2018
[beta] Rollup + backports

This is a rollup of two PRs:

* #47546
* #47431

and a backport of two PRs:

* #47505
* #47220
@michaelwoerister
Copy link
Member

Seems like @alexcrichton beat me to it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants