This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Introduce DiscardPolicy instead of 3 relative bool fields.
ClosedPublic

Authored by grimar on Aug 25 2016, 5:56 AM.

Details

Summary

DiscardPolicy is enum replacing several boolean options.
This approach is not only consistent with what we use for
unresolveds (UnresolvedPolicy), but also should help to solve a problem
of options with opposing meanings, mentioned in PR28843

Diff Detail

Event Timeline

grimar updated this revision to Diff 69228.Aug 25 2016, 5:56 AM
grimar retitled this revision from to [ELF] - Introduce DiscardPolicy instead of 3 relative bool fields..
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar.
ruiu added inline comments.Aug 29 2016, 3:30 PM
ELF/Config.h
33–37

They need comments.

// For --build-id.
// For --unresolved-symbols.
// For --discard-{all,locals}.
84

I couldn't find --discard-none in GNU ld manual. Where did this come from?

ELF/Driver.cpp
352–357

Use switch-case.

grimar updated this revision to Diff 69685.Aug 30 2016, 8:03 AM
  • Addressed review comments.
ELF/Config.h
33–37

Done.

84

According to gold changelog file it is fresh option:

2015-06-04 Cary Coutant <ccoutant@gmail.com>
PR gold/17498
...
(--discard-none): New option.
...

ELF/Driver.cpp
352–357

Done.

ruiu accepted this revision.Aug 30 2016, 11:24 AM
ruiu edited edge metadata.

LGTM

This revision is now accepted and ready to land.Aug 30 2016, 11:24 AM
This revision was automatically updated to reflect the committed changes.