This is an archive of the discontinued LLVM Phabricator instance.

[llvm][CMake] Move `split-file` from tools to utils
ClosedPublic

Authored by zero9178 on Aug 11 2022, 12:59 PM.

Details

Summary

It fittingly already making use of add_llvm_utility during target creation and is usually only used in conjunction with other (test) related utilities such as FileCheck and not, which are already in utils.

Diff Detail

Unit TestsFailed

Event Timeline

zero9178 created this revision.Aug 11 2022, 12:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 11 2022, 12:59 PM
zero9178 requested review of this revision.Aug 11 2022, 12:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 11 2022, 12:59 PM

split-file seems to fit utils/ well. It is small and self-contained. utils mostly just uses LLVMSupport.

yaml2obj and obj2yaml, on the other hand, use the higher level LLVMObjectYAML/DebugInfoDWARF/etc. And they are now a bit similar to other binary utilities like llvm-readelf.

split-file seems to fit utils/ well. It is small and self-contained. utils mostly just uses LLVMSupport.

yaml2obj and obj2yaml, on the other hand, use the higher level LLVMObjectYAML/DebugInfoDWARF/etc. And they are now a bit similar to other binary utilities like llvm-readelf.

+1

I tentatively agree with @MaskRay on this. Certainly, split-file is really intended for use as a test helper only. yaml2obj and obj2yaml though could have wider usage potentially (I myself have occasionally used one or the other to experiment with some things). As such, I think split-file to utils only would be best.

That all being said, I've not looked at the CMake. What's the difference between add_llvm_utility and whatever is used for the other tools like llvm-objdump etc?

zero9178 updated this revision to Diff 452093.Aug 12 2022, 12:23 AM
zero9178 retitled this revision from [llvm][CMake] Move `yaml2obj`, `obj2yaml` and `split-file` from tools to utils to [llvm][CMake] Move `split-file` from tools to utils.
zero9178 edited the summary of this revision. (Show Details)

Only move 'split-file'

I tentatively agree with @MaskRay on this. Certainly, split-file is really intended for use as a test helper only. yaml2obj and obj2yaml though could have wider usage potentially (I myself have occasionally used one or the other to experiment with some things). As such, I think split-file to utils only would be best.

That all being said, I've not looked at the CMake. What's the difference between add_llvm_utility and whatever is used for the other tools like llvm-objdump etc?

See https://reviews.llvm.org/D130977, but the gist of it is essentially what CMake flags are used to control whether a target is built as well as installed.

thakis accepted this revision.Aug 12 2022, 5:11 AM

Thanks!

This revision is now accepted and ready to land.Aug 12 2022, 5:11 AM
This revision was landed with ongoing or failed builds.Aug 12 2022, 5:16 AM
This revision was automatically updated to reflect the committed changes.