From f2e8ba2716f4bb3a5c0b9f55be7dd8ddc413091e Mon Sep 17 00:00:00 2001 From: Walter Lee Date: Fri, 12 Aug 2022 18:53:46 -0700 Subject: [PATCH] Support order file instrumentation in swift compile actions PiperOrigin-RevId: 467339063 (cherry picked from commit 2a1a3874718305aeb83ff5506d2c58616bf81584) Signed-off-by: Brentley Jones --- swift/toolchains/config/compile_config.bzl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/swift/toolchains/config/compile_config.bzl b/swift/toolchains/config/compile_config.bzl index b95e4bc24..155b3c7e5 100644 --- a/swift/toolchains/config/compile_config.bzl +++ b/swift/toolchains/config/compile_config.bzl @@ -595,6 +595,19 @@ def compile_action_configs( ), ] + #### FDO flags + action_configs.append( + # Support for order-file instrumentation. + ActionConfigInfo( + actions = [SWIFT_ACTION_COMPILE], + configurators = [ + add_arg("-sanitize=undefined"), + add_arg("-sanitize-coverage=func"), + ], + features = ["fdo_instrument_order_file"], + ), + ) + #### Flags controlling how Swift/Clang modular inputs are processed action_configs += [