IRGen: Annotate LLVM IR of condfail with the condfail's message

`-Xfrontend -enable-cond-fail-message-annotation`
LLVM IR produced by the Swift compiler will add the `annotation`
metadata attribute to the branch instruction generated for cond_fail
builtins.
This commit is contained in:
Arnold Schwaighofer
2024-02-11 06:45:48 -08:00
parent 13ef626044
commit ee57eed78d
5 changed files with 46 additions and 2 deletions

View File

@@ -3764,6 +3764,11 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
Opts.EnableLayoutStringValueWitnessesInstantiation = Args.hasFlag(OPT_enable_layout_string_value_witnesses_instantiation,
OPT_disable_layout_string_value_witnesses_instantiation,
Opts.EnableLayoutStringValueWitnessesInstantiation);
Opts.AnnotateCondFailMessage =
Args.hasFlag(OPT_enable_cond_fail_message_annotation,
OPT_disable_cond_fail_message_annotation,
Opts.AnnotateCondFailMessage);
if (Opts.EnableLayoutStringValueWitnessesInstantiation &&
!Opts.EnableLayoutStringValueWitnesses) {