This is an archive of the discontinued LLVM Phabricator instance.

[llvm] Make split-file an utility instead of tool
ClosedPublic

Authored by zero9178 on Aug 2 2022, 3:16 AM.

Details

Summary

split-file is essentially a development tool used for writing tests. Other related tooling for this purpose such as FileCheck, count, not and more are already created via add_llvm_utility instead of add_llvm_tool. The later is more meant as LLVM tools used as part of a toolchain (eg. llvm-ar), not for tools for the development of LLVM itself.

The main semantic difference this makes is that split-file is now built and installed via the LLVM_INSTALL_UTILS and LLVM_BUILD_UTILS instead of LLVM_BUILD_TOOLS and LLVM_INSTALL_TOOLS cmake flags. That way one can use LLVM_BUILD_TOOLS=OFF LLVM_INSTALL_UTILS=ON and have split-file installed along side the other testing tools.

Diff Detail

Event Timeline

zero9178 created this revision.Aug 2 2022, 3:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2022, 3:16 AM
zero9178 requested review of this revision.Aug 2 2022, 3:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2022, 3:16 AM
MaskRay accepted this revision.EditedAug 2 2022, 6:42 PM

Thanks for the explanation. It makes sense to group split-file into not/FileCheck/yaml2obj/count/...

I'd use a [CMake] tag. As of [llvm], keeping it is optional: personally I think the information isn't significant enough to be part of the subject.

This revision is now accepted and ready to land.Aug 2 2022, 6:42 PM
This revision was landed with ongoing or failed builds.Aug 3 2022, 1:47 AM
This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Aug 11 2022, 12:27 PM

Should it move from llvm/tools to llvm/utils then?

zero9178 added a comment.EditedAug 11 2022, 12:33 PM

Should it move from llvm/tools to llvm/utils then?

That is probably a good idea. obj2yaml as well as yaml2obj are also utilities using add_llvm_utility which should probably be moved. I'll post a review shortly.