This is an archive of the discontinued LLVM Phabricator instance.

Call TargetMachine::addEarlyAsPossiblePasses from BackendUtil.
ClosedPublic

Authored by jlebar on Mar 30 2016, 11:57 AM.

Details

Summary

As of D18614, TargetMachine exposes a hook to add a set of passes that should
be run as early as possible. Invoke this hook from clang when setting up the
pass manager.

Diff Detail

Repository
rL LLVM

Event Timeline

jlebar updated this revision to Diff 52101.Mar 30 2016, 11:57 AM
jlebar retitled this revision from to Call TargetMachine::addEarlyAsPossiblePasses from BackendUtil..
jlebar updated this object.
jlebar added a reviewer: chandlerc.
jlebar added subscribers: tra, cfe-commits, rnk.
chandlerc accepted this revision.Apr 7 2016, 12:26 AM
chandlerc edited edge metadata.

Minor tweak, but with that LGTM once the LLVM side is in place.

lib/CodeGen/BackendUtil.cpp
347 ↗(On Diff #52101)

Why capture this? Capturing TM would seem narrower. If you don't want a narrow capture, I'd just use [&]...

This revision is now accepted and ready to land.Apr 7 2016, 12:26 AM
jlebar added inline comments.Apr 7 2016, 9:18 AM
lib/CodeGen/BackendUtil.cpp
347 ↗(On Diff #52101)

TM is a member variable; you can't explicitly capture member variables? https://godbolt.org/g/T4kl3G

I can change it to [&] if you like that better.

jlebar updated this revision to Diff 53415.Apr 12 2016, 9:04 AM
jlebar edited edge metadata.

Switch [this] to [&].

chandlerc added inline comments.Apr 12 2016, 10:10 AM
lib/CodeGen/BackendUtil.cpp
347 ↗(On Diff #53415)

Wow, C++ is silly here. You can't capture it *by value*. You have to use an init capture (which we can't use yet). How silly. Anyways, thanks for the explanation.

This revision was automatically updated to reflect the committed changes.