aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorJosh Magee <joshua_magee@playstation.sony.com>2014-02-11 01:35:14 +0000
committerJosh Magee <joshua_magee@playstation.sony.com>2014-02-11 01:35:14 +0000
commite0fc1a80cba8b91e3943f3287e7dcf68c6bb9b7f (patch)
tree93c65c12a462c05648e3fef2b32203a7e13f4ff8 /clang/lib/Frontend/InitPreprocessor.cpp
parenta47009dbd3085dab76d95280a8327a0c987c03d1 (diff)
downloadllvm-e0fc1a80cba8b91e3943f3287e7dcf68c6bb9b7f.zip
llvm-e0fc1a80cba8b91e3943f3287e7dcf68c6bb9b7f.tar.gz
llvm-e0fc1a80cba8b91e3943f3287e7dcf68c6bb9b7f.tar.bz2
[stackprotector] Add command line option -fstack-protector-strong
This option has the following effects: * It adds the sspstrong IR attribute to each function within the CU. * It defines the macro __SSP_STRONG__ with the value of 2. Differential Revision: http://llvm-reviews.chandlerc.com/D2717 llvm-svn: 201120
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 7b3166d..f975c9f 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -695,8 +695,10 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
if (LangOpts.getStackProtector() == LangOptions::SSPOn)
Builder.defineMacro("__SSP__");
+ else if (LangOpts.getStackProtector() == LangOptions::SSPStrong)
+ Builder.defineMacro("__SSP_STRONG__", "2");
else if (LangOpts.getStackProtector() == LangOptions::SSPReq)
- Builder.defineMacro("__SSP_ALL__", "2");
+ Builder.defineMacro("__SSP_ALL__", "3");
if (FEOpts.ProgramAction == frontend::RewriteObjC)
Builder.defineMacro("__weak", "__attribute__((objc_gc(weak)))");