Add support for __declspec(guard(nocf))
authorAndrew Paverd <andrew.paverd@microsoft.com>
Fri, 10 Jan 2020 11:08:18 +0000 (11:08 +0000)
committerDavid Chisnall <David.Chisnall@microsoft.com>
Fri, 10 Jan 2020 16:04:12 +0000 (16:04 +0000)
commitbdd88b7ed3956534a0a71b1ea2bc88c69d48f9b7
tree4f0a7aeaf0f6eb0a34d373c6c74c93763669d6c4
parentd864d93496c5fd0cc473953ab825f07e3d4c4e86
Add support for __declspec(guard(nocf))

Summary:
Avoid using the `nocf_check` attribute with Control Flow Guard. Instead, use a
new `"guard_nocf"` function attribute to indicate that checks should not be
added on indirect calls within that function. Add support for
`__declspec(guard(nocf))` following the same syntax as MSVC.

Reviewers: rnk, dmajor, pcc, hans, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: aaron.ballman, tomrittervg, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D72167
clang/include/clang/Basic/Attr.td
clang/include/clang/Basic/AttrDocs.td
clang/lib/CodeGen/CGCall.cpp
clang/lib/Sema/SemaDeclAttr.cpp
clang/test/CodeGen/guard_nocf.c [new file with mode: 0644]
clang/test/CodeGenCXX/guard_nocf.cpp [new file with mode: 0644]
clang/test/Sema/attr-guard_nocf.c [new file with mode: 0644]
llvm/lib/Transforms/CFGuard/CFGuard.cpp
llvm/test/CodeGen/AArch64/cfguard-checks.ll
llvm/test/CodeGen/ARM/cfguard-checks.ll
llvm/test/CodeGen/X86/cfguard-checks.ll