This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Clarify a comment regarding AArch64. NFC.
ClosedPublic

Authored by mstorsjo on Mar 30 2021, 3:28 AM.

Diff Detail

Event Timeline

mstorsjo created this revision.Mar 30 2021, 3:28 AM
mstorsjo requested review of this revision.Mar 30 2021, 3:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 30 2021, 3:28 AM
compnerd added inline comments.Mar 30 2021, 8:31 AM
llvm/lib/Target/ARM/MCTargetDesc/ARMWinCOFFObjectWriter.cpp
30–31

ARM64 is a different target, but the COFF writer can be shared across the two right? What makes it special? A comment to that effect would be useful. I think that we might want to try to push this upwards to avoid the parameter all together if the two paths cannot be merged.

mstorsjo added inline comments.Mar 30 2021, 8:53 AM
llvm/lib/Target/ARM/MCTargetDesc/ARMWinCOFFObjectWriter.cpp
30–31

You mean this class? Almost everything in each of them is different between the two, so I don't really see what benefits there would be to stuffing both into one class with conditionals around everything.

rnk added inline comments.Mar 31 2021, 1:02 PM
llvm/lib/Target/ARM/MCTargetDesc/ARMWinCOFFObjectWriter.cpp
29

I think you can go further and remove the parameter here and in the factory function createARMWinCOFFObjectWriter. We only ever pass false to it. This just appears to be copy-pasta from the MachO version. The ARMELFObjectWriter doesn't have this constructor parameter.

30–31

Even if there is overlap between aarch64 and arm, the shared code would have to live in MC, which means it would have to live in MCWinCOFFObjectWriter anyway. I think we can do this simplification.

mstorsjo updated this revision to Diff 334522.Mar 31 2021, 1:38 PM

Updated to remove the parameter and the related asserts.

rnk accepted this revision.Apr 1 2021, 9:11 AM

lgtm

This revision is now accepted and ready to land.Apr 1 2021, 9:11 AM
This revision was landed with ongoing or failed builds.Apr 1 2021, 11:26 AM
This revision was automatically updated to reflect the committed changes.