This is an archive of the discontinued LLVM Phabricator instance.

[Alignment][NFC] Use Align in MCSymbol::setCommon
AbandonedPublic

Authored by gchatelet on Nov 25 2022, 5:29 AM.

Details

Reviewers
courbet

Diff Detail

Event Timeline

gchatelet created this revision.Nov 25 2022, 5:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 25 2022, 5:29 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
gchatelet requested review of this revision.Nov 25 2022, 5:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 25 2022, 5:29 AM
gchatelet retitled this revision from [Alignment] Use Align in MCSymbol::setCommon to [Alignment][NFC] Use Align in MCSymbol::setCommon.Nov 28 2022, 12:37 AM
gchatelet added a reviewer: courbet.
courbet added inline comments.Nov 28 2022, 12:46 AM
llvm/include/llvm/MC/MCSymbol.h
345

I can't convince myself that all callers pass a non-zero value for Align. In particular, I found that AsmPrinter::emitGlobalVariable does:

OutStreamer->emitCommonSymbol(GVSym, Size, SupportsAlignment ? Alignment.value() : 0);

gchatelet planned changes to this revision.Nov 28 2022, 12:53 AM
gchatelet added inline comments.
llvm/include/llvm/MC/MCSymbol.h
345

Yes this has been added by mistake many years ago.
See https://reviews.llvm.org/D138721#3951130.

I'm preparing a patch to revert to the old behavior where 0 is not a valid input anymore. Once this is accepted this will be NFC.
Let's put the patch on hold until then.

gchatelet abandoned this revision.Dec 12 2022, 1:23 AM