This is an archive of the discontinued LLVM Phabricator instance.

[clang][CodeGen] Break up TargetInfo.cpp [4/8]
ClosedPublic

Authored by barannikov88 on Apr 12 2023, 2:27 AM.

Details

Summary

Remove getABIInfo overrides returning references to target-specific
implementations of ABIInfo.
The methods may be convenient, but they are only used in one place and
prevent from ABIInfo implementations from being put into anonymous
namespaces in different cpp files.

Diff Detail

Event Timeline

barannikov88 created this revision.Apr 12 2023, 2:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 12 2023, 2:27 AM
barannikov88 published this revision for review.Apr 12 2023, 3:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 12 2023, 3:34 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Is this supposed to be different from D148093?

Is this supposed to be different from D148093?

Yes indeed. I've updated D148093.

Is there some alternative way we can write this? Even if each of the overrides is only technically used in one place, it's a repeating pattern, and writing the casts inline makes it really hard to read. (Maybe the helpers can be somewhere else?)

Add a templated overload to help derived classes avoid explicit casts

Is there some alternative way we can write this? Even if each of the overrides is only technically used in one place, it's a repeating pattern, and writing the casts inline makes it really hard to read. (Maybe the helpers can be somewhere else?)

Thanks for the suggestion. Does it look better now?

efriedma accepted this revision.May 5 2023, 2:53 PM

LGTM

This revision is now accepted and ready to land.May 5 2023, 2:53 PM
barannikov88 retitled this revision from [clang][CodeGen] Break up TargetInfo.cpp [4/6] to [clang][CodeGen] Break up TargetInfo.cpp [4/7].May 9 2023, 12:19 AM
barannikov88 retitled this revision from [clang][CodeGen] Break up TargetInfo.cpp [4/7] to [clang][CodeGen] Break up TargetInfo.cpp [4/8].May 9 2023, 11:31 AM
This revision was landed with ongoing or failed builds.May 19 2023, 1:55 PM
This revision was automatically updated to reflect the committed changes.