amilendra created this revision. amilendra added reviewers: chill, stuij. Herald added a subscriber: kristof.beyls. amilendra requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
The original warning added in D115501 <https://reviews.llvm.org/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. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D119166 Files: clang/include/clang/Basic/DiagnosticCommonKinds.td clang/lib/Driver/ToolChains/Clang.cpp clang/test/Driver/arm-security-options.c Index: clang/test/Driver/arm-security-options.c =================================================================== --- clang/test/Driver/arm-security-options.c +++ clang/test/Driver/arm-security-options.c @@ -90,4 +90,4 @@ // BAD-B-KEY-COMBINATION: invalid branch protection option 'b-key' in '-mbranch-protection={{.*}}' // BAD-LEAF-COMBINATION: invalid branch protection option 'leaf' in '-mbranch-protection={{.*}}' -// INCOMPATIBLE-ARCH: ignoring '-mbranch-protection=' option because the '{{.*}}' architecture does not support it +// INCOMPATIBLE-ARCH: '-mbranch-protection=' option incompatible with the '{{.*}}' architecture Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -1639,7 +1639,7 @@ const Driver &D = TC.getDriver(); const llvm::Triple &Triple = TC.getEffectiveTriple(); if (!(isAArch64 || (Triple.isArmT32() && Triple.isArmMClass()))) - D.Diag(diag::warn_target_unsupported_branch_protection_option) + D.Diag(diag::warn_incompatible_branch_protection_option) << Triple.getArchName(); StringRef Scope, Key; Index: clang/include/clang/Basic/DiagnosticCommonKinds.td =================================================================== --- clang/include/clang/Basic/DiagnosticCommonKinds.td +++ clang/include/clang/Basic/DiagnosticCommonKinds.td @@ -145,8 +145,8 @@ def err_nullability_conflicting : Error< "nullability specifier %0 conflicts with existing specifier %1">; -def warn_target_unsupported_branch_protection_option: Warning < - "ignoring '-mbranch-protection=' option because the '%0' architecture does not support it">, +def warn_incompatible_branch_protection_option: Warning < + "'-mbranch-protection=' option incompatible with the '%0' architecture">, InGroup<BranchProtection>; def warn_target_unsupported_branch_protection_attribute: Warning <
Index: clang/test/Driver/arm-security-options.c =================================================================== --- clang/test/Driver/arm-security-options.c +++ clang/test/Driver/arm-security-options.c @@ -90,4 +90,4 @@ // BAD-B-KEY-COMBINATION: invalid branch protection option 'b-key' in '-mbranch-protection={{.*}}' // BAD-LEAF-COMBINATION: invalid branch protection option 'leaf' in '-mbranch-protection={{.*}}' -// INCOMPATIBLE-ARCH: ignoring '-mbranch-protection=' option because the '{{.*}}' architecture does not support it +// INCOMPATIBLE-ARCH: '-mbranch-protection=' option incompatible with the '{{.*}}' architecture Index: clang/lib/Driver/ToolChains/Clang.cpp =================================================================== --- clang/lib/Driver/ToolChains/Clang.cpp +++ clang/lib/Driver/ToolChains/Clang.cpp @@ -1639,7 +1639,7 @@ const Driver &D = TC.getDriver(); const llvm::Triple &Triple = TC.getEffectiveTriple(); if (!(isAArch64 || (Triple.isArmT32() && Triple.isArmMClass()))) - D.Diag(diag::warn_target_unsupported_branch_protection_option) + D.Diag(diag::warn_incompatible_branch_protection_option) << Triple.getArchName(); StringRef Scope, Key; Index: clang/include/clang/Basic/DiagnosticCommonKinds.td =================================================================== --- clang/include/clang/Basic/DiagnosticCommonKinds.td +++ clang/include/clang/Basic/DiagnosticCommonKinds.td @@ -145,8 +145,8 @@ def err_nullability_conflicting : Error< "nullability specifier %0 conflicts with existing specifier %1">; -def warn_target_unsupported_branch_protection_option: Warning < - "ignoring '-mbranch-protection=' option because the '%0' architecture does not support it">, +def warn_incompatible_branch_protection_option: Warning < + "'-mbranch-protection=' option incompatible with the '%0' architecture">, InGroup<BranchProtection>; def warn_target_unsupported_branch_protection_attribute: Warning <
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits