With this change generating clang order files using dtrace uses the following workflow:
Configure LLVM & Clang using any options on a system with dtrace
cmake <whatever options you want>
Builds clang and runs the perf-training data to generate the order file
ninja generate-order-file
Re-link clang with the new order file
ninja clang
This patch works by setting a default path to the order file (which can be overridden by the user). If the order file doesn't exist during configuration CMake will create an empty one.
CMake then ties up the dependencies between the clang link job and the order file, and generate-order-file overwrites CLANG_ORDER_FILE with the new order file.