aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2022-09-16 18:59:15 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2022-09-16 19:39:48 +0000
commit8a868d8859f9da23ee051848863045208c17ab47 (patch)
treeadb8c407c34b9587105b1ed162f025302c1c03d8 /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
parente0bc76eb23f82bbe3abae9d17544d9cc515a5ca0 (diff)
downloadllvm-8a868d8859f9da23ee051848863045208c17ab47.zip
llvm-8a868d8859f9da23ee051848863045208c17ab47.tar.gz
llvm-8a868d8859f9da23ee051848863045208c17ab47.tar.bz2
Revert "Revert "[clang, llvm] Add __declspec(safebuffers), support it in CodeView""
This reverts commit cd20a1828605887699579789b5433111d5bc0319 and adds a "let Heading" to NoStackProtectorDocs.
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index 16213af..a97eb9f 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -1498,8 +1498,16 @@ void CodeViewDebug::beginFunctionImpl(const MachineFunction *MF) {
FPO |= FrameProcedureOptions::MarkedInline;
if (GV.hasFnAttribute(Attribute::Naked))
FPO |= FrameProcedureOptions::Naked;
- if (MFI.hasStackProtectorIndex())
+ if (MFI.hasStackProtectorIndex()) {
FPO |= FrameProcedureOptions::SecurityChecks;
+ if (GV.hasFnAttribute(Attribute::StackProtectStrong) ||
+ GV.hasFnAttribute(Attribute::StackProtectReq)) {
+ FPO |= FrameProcedureOptions::StrictSecurityChecks;
+ }
+ } else if (!GV.hasStackProtectorFnAttr()) {
+ // __declspec(safebuffers) disables stack guards.
+ FPO |= FrameProcedureOptions::SafeBuffers;
+ }
FPO |= FrameProcedureOptions(uint32_t(CurFn->EncodedLocalFramePtrReg) << 14U);
FPO |= FrameProcedureOptions(uint32_t(CurFn->EncodedParamFramePtrReg) << 16U);
if (Asm->TM.getOptLevel() != CodeGenOpt::None &&