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

[LLVM 4.0] Use llvm::Attribute APIs instead of "raw value" APIs #37831

Merged
merged 2 commits into from
Nov 20, 2016

Conversation

hanna-kruppe
Copy link
Contributor

The latter will be removed in LLVM 4.0 (see llvm-mirror/llvm@4a6fc8b).

The librustc_llvm API remains mostly unchanged, except that llvm::Attribute is no longer a bitflag but represents only a single attribute.
The ability to store many attributes in a small number of bits and modify them without interacting with LLVM is only used in rustc_trans::abi and closely related modules, and only attributes for function arguments are considered there.
Thus rustc_trans::abi now has its own bit-packed representation of argument attributes, which are translated to rustc_llvm::Attribute when applying the attributes.

cc #37609

@rust-highfive
Copy link
Collaborator

r? @eddyb

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

@hanna-kruppe hanna-kruppe mentioned this pull request Nov 17, 2016
23 tasks
@shepmaster
Copy link
Member

Do we build against all the #ifdef-supported variants of LLVM? I ask because I don't see any new conditional compilation added in this PR, which means that the changes here need to work for LLVM versions 3.7, 3.8, and 3.9. Is the API we are switching to supported that far back?

@hanna-kruppe
Copy link
Contributor Author

The llvm::Attribute API seems to go back to at least 3.6 (e.g. this document is essentially unchanged since before 3.7)

@eddyb
Copy link
Member

eddyb commented Nov 17, 2016

@bors r+

@bors
Copy link
Contributor

bors commented Nov 17, 2016

📌 Commit cbc59b8 has been approved by eddyb

@@ -12,8 +12,7 @@ crate-type = ["dylib"]
[features]
static-libstdcpp = []

[dependencies]
rustc_bitflags = { path = "../librustc_bitflags" }
# FIXME this crate uses libc, which somehow works without a dependency here
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok to remove these, crates in this crate graph currently don't explicitly depend on the std crate and below (so this is expected)

@alexcrichton
Copy link
Member

@bors: r=eddyb

@bors
Copy link
Contributor

bors commented Nov 17, 2016

📌 Commit 15aaf94 has been approved by eddyb

…moved in LLVM 4.0.

The librustc_llvm API remains mostly unchanged, except that llvm::Attribute is no longer a bitflag but represents only a *single* attribute.
The ability to store many attributes in a small number of bits and modify them without interacting with LLVM is only used in rustc_trans::abi and closely related modules, and only attributes for function arguments are considered there.
Thus rustc_trans::abi now has its own bit-packed representation of argument attributes, which are translated to rustc_llvm::Attribute when applying the attributes.
@hanna-kruppe
Copy link
Contributor Author

Fixed an embarrassing compile error introduced in a last-minute renaming.

@eddyb
Copy link
Member

eddyb commented Nov 17, 2016

@bors r+

@bors
Copy link
Contributor

bors commented Nov 17, 2016

📌 Commit 30daedf has been approved by eddyb

@bors
Copy link
Contributor

bors commented Nov 19, 2016

⌛ Testing commit 30daedf with merge 0bd2ce6...

bors added a commit that referenced this pull request Nov 19, 2016
[LLVM 4.0] Use llvm::Attribute APIs instead of "raw value" APIs

The latter will be removed in LLVM 4.0 (see llvm-mirror/llvm@4a6fc8b).

The librustc_llvm API remains mostly unchanged, except that llvm::Attribute is no longer a bitflag but represents only a *single* attribute.
The ability to store many attributes in a small number of bits and modify them without interacting with LLVM is only used in rustc_trans::abi and closely related modules, and only attributes for function arguments are considered there.
Thus rustc_trans::abi now has its own bit-packed representation of argument attributes, which are translated to rustc_llvm::Attribute when applying the attributes.

cc #37609
@bors bors merged commit 30daedf into rust-lang:master Nov 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants