This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Improve the clang order-file generation workflow
ClosedPublic

Authored by beanz on Feb 4 2016, 1:05 PM.

Details

Summary

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.

Diff Detail

Event Timeline

beanz updated this revision to Diff 46950.Feb 4 2016, 1:05 PM
beanz retitled this revision from to [CMake] Improve the clang order-file generation workflow.
beanz updated this object.
beanz added a reviewer: bogner.
beanz added a subscriber: cfe-commits.
beanz updated this revision to Diff 46966.Feb 4 2016, 3:00 PM

Gate adding the -order_file linker option on whether the linker supports it.

This revision was automatically updated to reflect the committed changes.