[all-commits] [llvm/llvm-project] 1f08b0: [clang][ARM] Emit warnings when PACBTI-M is used w...
amilendra via All-commits
all-commits at lists.llvm.org
Fri Jan 28 02:00:24 PST 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 1f08b0867412d5696ed624a2da78bdba2cc672c3
https://github.com/llvm/llvm-project/commit/1f08b0867412d5696ed624a2da78bdba2cc672c3
Author: Amilendra Kodithuwakku <Amilendra.Kodithuwakku at arm.com>
Date: 2022-01-28 (Fri, 28 Jan 2022)
Changed paths:
M clang/include/clang/Basic/DiagnosticCommonKinds.td
M clang/include/clang/Basic/TargetInfo.h
M clang/lib/Basic/Targets/AArch64.cpp
M clang/lib/Basic/Targets/AArch64.h
M clang/lib/Basic/Targets/ARM.cpp
M clang/lib/Basic/Targets/ARM.h
M clang/lib/CodeGen/CodeGenModule.cpp
M clang/lib/CodeGen/TargetInfo.cpp
M clang/lib/Driver/ToolChains/Clang.cpp
M clang/lib/Sema/SemaDeclAttr.cpp
M clang/test/CodeGen/arm-branch-protection-attr-2.c
M clang/test/CodeGen/arm_acle.c
M clang/test/Driver/aarch64-security-options.c
M clang/test/Driver/arm-security-options.c
A clang/test/Frontend/arm-branch-protection-default-arch.c
A clang/test/Frontend/arm-ignore-branch-protection-option.c
M clang/test/Frontend/arm-invalid-branch-protection.c
A clang/test/Sema/arm-branch-protection-attr-warn.c
A clang/test/Sema/arm-branch-protection.c
M llvm/include/llvm/ADT/Triple.h
M llvm/unittests/ADT/TripleTest.cpp
Log Message:
-----------
[clang][ARM] Emit warnings when PACBTI-M is used with unsupported architectures
Branch protection in M-class is supported by
- Armv8.1-M.Main
- Armv8-M.Main
- Armv7-M
Attempting to enable this for other architectures, either by
command-line (e.g -mbranch-protection=bti) or by target attribute
in source code (e.g. __attribute__((target("branch-protection=..."))) )
will generate a warning.
In both cases function attributes related to branch protection will not
be emitted. Regardless of the warning, module level attributes related to
branch protection will be emitted when it is enabled via the command-line.
The following people also contributed to this patch:
- Victor Campos
Reviewed By: chill
Differential Revision: https://reviews.llvm.org/D115501
More information about the All-commits
mailing list