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.
|60,040 ms||x64 debian > MLIR.Examples/standalone::test.toy|
Script: -- : 'RUN: at line 1'; /usr/bin/cmake /var/lib/buildkite-agent/builds/llvm-project/mlir/examples/standalone -G "Ninja" -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang -DLLVM_ENABLE_LIBCXX=OFF -DMLIR_DIR=/var/lib/buildkite-agent/builds/llvm-project/build/lib/cmake/mlir -DLLVM_USE_LINKER=lld
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.
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?