Skip to content

Reflect supporting only LLVM 3.7+ in the LLVM wrappers #34178

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

Merged
merged 2 commits into from
Jun 10, 2016

Conversation

shepmaster
Copy link
Member

Based on 12abddb, it appears we can drop support for these older LLVM versions. Hopefully, this will make it slightly easier to support the changes needed for LLVM 3.9.

r? @nagisa

/cc @brson

@@ -34,13 +31,8 @@ struct LLVMRustArchiveMember {
~LLVMRustArchiveMember() {}
};

#if LLVM_VERSION_MINOR >= 6
typedef OwningBinary<Archive> RustArchive;
#define GET_ARCHIVE(a) ((a)->getBinary())
Copy link
Member

@nagisa nagisa Jun 9, 2016

Choose a reason for hiding this comment

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

Uses of GET_ARCHIVE can be inlined now?

@nagisa
Copy link
Member

nagisa commented Jun 9, 2016

r? @alexcrichton

Seems overall good to me, but I would rather get alex to sign off on it.

@rust-highfive rust-highfive assigned alexcrichton and unassigned nagisa Jun 9, 2016
@shepmaster
Copy link
Member Author

Yeah, reading through the nested conditionals is pretty mind-bending; I had to redo a handful of the sections a few times! The more 👀 the better!

#endif
unwrap(PMB)->SLPVectorize = SLPVectorize;
unwrap(PMB)->OptLevel = OptLevel;
unwrap(PMB)->LoopVectorize = LoopVectorize;
Copy link
Member

Choose a reason for hiding this comment

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

Maybe these were accidentally deleted?

Copy link
Member Author

@shepmaster shepmaster Jun 9, 2016

Choose a reason for hiding this comment

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

Ooops, nice catch! Fixed now.

@alexcrichton
Copy link
Member

Awesome, thanks @shepmaster! If you're feeling extra ambitious we can now probably also remove the long-dead code path of actually calling ar to assemble archives. This has been predicated on having LLVM version 7 available, and it's also on by default everywhere (even for custom target specs I believe).

That can also be saved for another PR, however, as there's probably even more cleanup that could happen in that module.

@shepmaster
Copy link
Member Author

shepmaster commented Jun 9, 2016

remove the long-dead code path of actually calling ar to assemble archives

I'd be happy to submit a separate PR for that, but I'm not seeing where the big cleanup would be there. It looks like that function can still return None from the subsequent match, so it doesn't seem like we'd be be able to remove the Option result type. Of course, the comment "LLVM only supports writing archives in the 'gnu' format" right above code for 4 total formats seems suspicious ;-)

@brson
Copy link
Contributor

brson commented Jun 10, 2016

What a relief to jettison all that cruft.

@alexcrichton
Copy link
Member

@bors: r+ f3d9de4

Yeah we probably want to handle it a little differently there anyway. Basically we should reject any custom target spec with a value that we don't recognize, and probably reject those that LLVM just doesn't support...

@bors
Copy link
Collaborator

bors commented Jun 10, 2016

⌛ Testing commit f3d9de4 with merge 68241f0...

bors added a commit that referenced this pull request Jun 10, 2016
Reflect supporting only LLVM 3.7+ in the LLVM wrappers

Based on 12abddb, it appears we can drop support for these older LLVM versions. Hopefully, this will make it slightly easier to support the changes needed for LLVM 3.9.

r? @nagisa

/cc @brson
@bors bors merged commit f3d9de4 into rust-lang:master Jun 10, 2016
@shepmaster shepmaster deleted the llvm-3.7-and-up branch June 10, 2016 21:44
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.

5 participants