This is an archive of the discontinued LLVM Phabricator instance.

[CFI] Require -flto instead of implying it.
ClosedPublic

Authored by samsonov on Jun 18 2015, 6:26 PM.

Details

Summary

This is unfortunate, but would let us land http://reviews.llvm.org/D10467,
that makes ToolChains responsible for computing the set of sanitizers
they support.

Unfortunately, Darwin ToolChains doesn't know about actual OS they
target until ToolChain::TranslateArgs() is called. In particular, it
means we won't be able to construct SanitizerArgs for these ToolChains
before that.

This change removes SanitizerArgs::needsLTO() method, so that now
ToolChain::IsUsingLTO(), which is called very early, doesn't need
SanitizerArgs to implement this method.

Docs and test cases are updated accordingly. See
https://llvm.org/bugs/show_bug.cgi?id=23539, which describes why we
start all these.

Diff Detail

Repository
rL LLVM

Event Timeline

samsonov updated this revision to Diff 27986.Jun 18 2015, 6:26 PM
samsonov retitled this revision from to [CFI] Require -flto instead of implying it..
samsonov updated this object.
samsonov edited the test plan for this revision. (Show Details)
samsonov added a reviewer: pcc.
samsonov added a subscriber: Unknown Object (MLST).
pcc accepted this revision.Jun 18 2015, 6:46 PM
pcc edited edge metadata.

LGTM

I think you will also need to adjust config.lto_flags in compiler-rt/test/lit.common.cfg.

lib/Driver/Driver.cpp
1387 ↗(On Diff #27986)

This could just be return Args.hasFlag(...) now.

This revision is now accepted and ready to land.Jun 18 2015, 6:46 PM
This revision was automatically updated to reflect the committed changes.