This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Merge Utils library into MCTargetDesc
ClosedPublic

Authored by craig.topper on Dec 12 2020, 1:31 PM.

Details

Summary

MCTargetDesc includes headers from Utils and Utils includes headers from MCTargetDesc. So from a library layering perspective it makes sense for them to be in the same library. I guess the other option might be to move the tablegen includes from RISCVMCTargetDesc.h to RISCVBaseInfo.h so that RISCVBaseInfo.h didn't need to include RISCVMCTargetDesc.h. Everything else that depends on Utils also depends on MCTargetDesc so having one library seemed simpler.

Diff Detail

Event Timeline

craig.topper created this revision.Dec 12 2020, 1:31 PM
craig.topper requested review of this revision.Dec 12 2020, 1:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 12 2020, 1:31 PM
Herald added a subscriber: MaskRay. · View Herald Transcript
asb accepted this revision.Jan 14 2021, 5:00 AM

I think this is a reasonable change. The pattern of having "Utils" is common to AArch64, AMDGPU, ARM, and RISCV but I agree with your point that it's not cleanly separated from MCTargetDesc, so there's little benefit.

This revision is now accepted and ready to land.Jan 14 2021, 5:00 AM
This revision was automatically updated to reflect the committed changes.
llvm/lib/Target/RISCV/RISCVTargetMachine.cpp