Skip to content

Commit 7246d58

Browse files
amilendratstellar
authored andcommitted
[clang][ARM] Re-word PACBTI warning.
The original warning added in D115501 when pacbti is used with an incompatible architecture was not exactly correct because it was not really ignored and can affect codegen. Therefore reword to say that the pacbti option is incompatible with the given architecture. Reviewed By: chill Differential Revision: https://reviews.llvm.org/D119166 (cherry picked from commit 424e850)
1 parent be308cf commit 7246d58

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

clang/include/clang/Basic/DiagnosticCommonKinds.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ def warn_conflicting_nullability_attr_overriding_param_types : Warning<
145145
def err_nullability_conflicting : Error<
146146
"nullability specifier %0 conflicts with existing specifier %1">;
147147

148-
def warn_target_unsupported_branch_protection_option: Warning <
149-
"ignoring '-mbranch-protection=' option because the '%0' architecture does not support it">,
148+
def warn_incompatible_branch_protection_option: Warning <
149+
"'-mbranch-protection=' option is incompatible with the '%0' architecture">,
150150
InGroup<BranchProtection>;
151151

152152
def warn_target_unsupported_branch_protection_attribute: Warning <

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1639,7 +1639,7 @@ static void CollectARMPACBTIOptions(const ToolChain &TC, const ArgList &Args,
16391639
const Driver &D = TC.getDriver();
16401640
const llvm::Triple &Triple = TC.getEffectiveTriple();
16411641
if (!(isAArch64 || (Triple.isArmT32() && Triple.isArmMClass())))
1642-
D.Diag(diag::warn_target_unsupported_branch_protection_option)
1642+
D.Diag(diag::warn_incompatible_branch_protection_option)
16431643
<< Triple.getArchName();
16441644

16451645
StringRef Scope, Key;

clang/test/Driver/arm-security-options.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,4 @@
9090
// BAD-B-KEY-COMBINATION: invalid branch protection option 'b-key' in '-mbranch-protection={{.*}}'
9191
// BAD-LEAF-COMBINATION: invalid branch protection option 'leaf' in '-mbranch-protection={{.*}}'
9292

93-
// INCOMPATIBLE-ARCH: ignoring '-mbranch-protection=' option because the '{{.*}}' architecture does not support it
93+
// INCOMPATIBLE-ARCH: '-mbranch-protection=' option is incompatible with the '{{.*}}' architecture

0 commit comments

Comments
 (0)