This is an archive of the discontinued LLVM Phabricator instance.

[MC][MCParser] Mark local and weak symbols as such when parsing assembly text
Needs ReviewPublic

Authored by sdardis on Sep 19 2016, 5:19 AM.



When parsing assembly text directives such as .local, .weak, the symbols were
not marked as such in the internal symbol table. This lead to different output
depending on whether MCAsmStreamer or MCELFStreamer was. This patch
corrects such behaviour.

Diff Detail

Event Timeline

sdardis updated this revision to Diff 71812.Sep 19 2016, 5:19 AM
sdardis retitled this revision from to [MC][MCParser] Mark local and weak symbols as such when parsing assembly text.
sdardis updated this object.
sdardis added a subscriber: llvm-commits.

dsanders observed this behaviour in D23497. I've since reposted that patch as D24722.

sdardis updated this revision to Diff 71836.Sep 19 2016, 9:05 AM
sdardis edited edge metadata.

Expanded MCSymbol<ELF/COFF/MachO> to dump internal state. Expanded MCContext to be able to dump the symbol table. Added a new hidden option -asm-show-symbol-table that prints out the symbol table just before the AsmParser finishes running.

vkalintiris edited edge metadata.Sep 26 2016, 8:09 AM

We should split this in two separate review requests, ie. one that introduces symbol dumping and another that marks local and weak symbols. Can you also add a separate test file just for checking the newly introduced -asm-show-symbol-table option?