This is an archive of the discontinued LLVM Phabricator instance.

[COFF] Unify output section code. NFC
ClosedPublic

Authored by smeenai on May 29 2018, 2:55 PM.

Details

Summary

Peter Collingbourne suggested moving the switch to the top of the
function, so that all the code that cares about the output section for a
symbol is in the same place.

Event Timeline

smeenai created this revision.May 29 2018, 2:55 PM
pcc added inline comments.May 29 2018, 3:04 PM
COFF/Writer.cpp
618

You can move the if on line 606 into the switch as well.

627

I'd drop the assert here and combine line 619 and 621 into one.

smeenai updated this revision to Diff 148994.May 29 2018, 3:15 PM

@pcc's comments

pcc added inline comments.May 29 2018, 3:17 PM
COFF/Writer.cpp
613

I meant that you can write:

case Symbol::DefinedSyntheticKind:
  return None;
pcc accepted this revision.May 29 2018, 3:40 PM

LGTM

This revision is now accepted and ready to land.May 29 2018, 3:40 PM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.