From e7e67c930ae59151affcd57bd49d650e4dac3468 Mon Sep 17 00:00:00 2001 From: "Wang, Pengfei" Date: Wed, 3 Mar 2021 10:38:21 +0800 Subject: Add Windows ehcont section support (/guard:ehcont). Add option /guard:ehcont Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D96709 --- clang/lib/CodeGen/CodeGenModule.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 802a13fb41fc..b23d995683bf 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -552,6 +552,10 @@ void CodeGenModule::Release() { // Function ID tables for Control Flow Guard (cfguard=1). getModule().addModuleFlag(llvm::Module::Warning, "cfguard", 1); } + if (CodeGenOpts.EHContGuard) { + // Function ID tables for EH Continuation Guard. + getModule().addModuleFlag(llvm::Module::Warning, "ehcontguard", 1); + } if (CodeGenOpts.OptimizationLevel > 0 && CodeGenOpts.StrictVTablePointers) { // We don't support LTO with 2 with different StrictVTablePointers // FIXME: we could support it by stripping all the information introduced -- cgit v1.2.3