This is an archive of the discontinued LLVM Phabricator instance.

[COFF] Clean up boolean flag handling
ClosedPublic

Authored by smeenai on Oct 23 2017, 4:34 PM.

Details

Summary

LLD's handling of boolean flags is suboptimal:

  • All boolean flags have a corresponding :no flag to turn the flag off, and the linker should scan for both the non-suffixed and suffixed flags (and the last one should win), but right now it only scans for either the suffixed or non-suffixed flag (depending on the default flag value).
  • The B multiclass only allows specifying help text for the suffixed (:no) flag, but for some flags (e.g. /appcontainer) the help text should be associated with the non-suffixed flag instead.

Extend the B multiclass to have help text for both non-suffixed and
suffixed flag variants, and alter the existing help text accordingly in
some cases. Scan for both the non-suffixed and suffixed variants in the
driver and set config values accordingly.

This should mostly have no behavior change, apart from the added help
text and the modified argument scanning. Some flags are handled slightly
differently now, however; for example, LLD would previously always treat
64-bit images as large address aware, whereas /largeaddressaware:no is
now respected for 64-bit images (which is also how link.exe behaves).

Diff Detail

Repository
rL LLVM

Event Timeline

smeenai created this revision.Oct 23 2017, 4:34 PM
ruiu accepted this revision.Oct 23 2017, 7:06 PM

LGTM

This revision is now accepted and ready to land.Oct 23 2017, 7:06 PM
This revision was automatically updated to reflect the committed changes.