summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorVlad Tsyrklevich <vlad@tsyrklevich.net>2018-04-03 22:33:53 +0000
committerVlad Tsyrklevich <vlad@tsyrklevich.net>2018-04-03 22:33:53 +0000
commit2da4adbc5fc5989126208a90b4acd0e3ae9afeff (patch)
tree8713fa2bb93368dc85b1698d3cfa6cc2f3739326 /lib/CodeGen/CodeGenFunction.cpp
parentc35631a920b1a25fb3d77387430857d90e1ea657 (diff)
downloadclang-2da4adbc5fc5989126208a90b4acd0e3ae9afeff.tar.gz
Add the -fsanitize=shadow-call-stack flag
Summary: Add support for the -fsanitize=shadow-call-stack flag which causes clang to add ShadowCallStack attribute to functions compiled with that flag enabled. Reviewers: pcc, kcc Reviewed By: pcc, kcc Subscribers: cryptoad, cfe-commits, kcc Differential Revision: https://reviews.llvm.org/D44801 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329122 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index 3d7b906587..e5db4e52b4 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -861,6 +861,8 @@ void CodeGenFunction::StartFunction(GlobalDecl GD,
Fn->addFnAttr(llvm::Attribute::SanitizeMemory);
if (SanOpts.has(SanitizerKind::SafeStack))
Fn->addFnAttr(llvm::Attribute::SafeStack);
+ if (SanOpts.has(SanitizerKind::ShadowCallStack))
+ Fn->addFnAttr(llvm::Attribute::ShadowCallStack);
// Apply fuzzing attribute to the function.
if (SanOpts.hasOneOf(SanitizerKind::Fuzzer | SanitizerKind::FuzzerNoLink))