diff options
| author | Bill Wendling <isanbard@gmail.com> | 2009-06-28 07:36:13 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2009-06-28 07:36:13 +0000 |
| commit | d63bbadbef6d8b1b9dbc9a5e024c275b0a9897e9 (patch) | |
| tree | 1b5305469985b27a4317fd886765b1ffbdea5424 /clang/include | |
| parent | bd956c429040a41c7e9e4fdd3063ec0ab98457cb (diff) | |
| download | bcm5719-llvm-d63bbadbef6d8b1b9dbc9a5e024c275b0a9897e9.tar.gz bcm5719-llvm-d63bbadbef6d8b1b9dbc9a5e024c275b0a9897e9.zip | |
Add stack protector support to clang. This generates the 'ssp' and 'sspreq'
function attributes. There are predefined macros that are defined when stack
protectors are used: __SSP__=1 with -fstack-protector and __SSP_ALL__=2 with
-fstack-protector-all.
llvm-svn: 74405
Diffstat (limited to 'clang/include')
| -rw-r--r-- | clang/include/clang/Basic/LangOptions.h | 6 | ||||
| -rw-r--r-- | clang/include/clang/Driver/ArgList.h | 2 | ||||
| -rw-r--r-- | clang/include/clang/Driver/Options.def | 5 |
3 files changed, 10 insertions, 3 deletions
diff --git a/clang/include/clang/Basic/LangOptions.h b/clang/include/clang/Basic/LangOptions.h index 543a0fff8e7..9b308e1b322 100644 --- a/clang/include/clang/Basic/LangOptions.h +++ b/clang/include/clang/Basic/LangOptions.h @@ -84,6 +84,10 @@ public: unsigned OpenCL : 1; // OpenCL C99 language extensions. + unsigned StackProtector : 2; // Whether stack protectors are on: + // 0 - None + // 1 - On + // 2 - All private: unsigned GC : 2; // Objective-C Garbage Collection modes. We declare @@ -116,7 +120,7 @@ public: Exceptions = NeXTRuntime = Freestanding = NoBuiltin = 0; LaxVectorConversions = 1; HeinousExtensions = 0; - AltiVec = OpenCL = 0; + AltiVec = OpenCL = StackProtector = 0; SymbolVisibility = (unsigned) Default; diff --git a/clang/include/clang/Driver/ArgList.h b/clang/include/clang/Driver/ArgList.h index 84e0329a375..a9c890b0b89 100644 --- a/clang/include/clang/Driver/ArgList.h +++ b/clang/include/clang/Driver/ArgList.h @@ -83,6 +83,8 @@ namespace driver { /// \arg Claim Whether the argument should be claimed, if it exists. Arg *getLastArg(options::ID Id, bool Claim=true) const; Arg *getLastArg(options::ID Id0, options::ID Id1, bool Claim=true) const; + Arg *getLastArg(options::ID Id0, options::ID Id1, options::ID Id2, + bool Claim=true) const; /// getArgString - Return the input argument string at \arg Index. virtual const char *getArgString(unsigned Index) const = 0; diff --git a/clang/include/clang/Driver/Options.def b/clang/include/clang/Driver/Options.def index abd07a92b1a..af108a85ebd 100644 --- a/clang/include/clang/Driver/Options.def +++ b/clang/include/clang/Driver/Options.def @@ -420,7 +420,7 @@ OPTION("-fno-math-errno", fno_math_errno, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-pascal-strings", fno_pascal_strings, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-show-column", fno_show_column, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-show-source-location", fno_show_source_location, Flag, f_Group, INVALID, "", 0, 0, 0) -OPTION("-fno-stack-protector", fno_stack_protector, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0) +OPTION("-fno-stack-protector", fno_stack_protector, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-strict-aliasing", fno_strict_aliasing, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-unit-at-a-time", fno_unit_at_a_time, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fno-unwind-tables", fno_unwind_tables, Flag, f_Group, INVALID, "", 0, 0, 0) @@ -450,7 +450,8 @@ OPTION("-framework", framework, Separate, INVALID, INVALID, "l", 0, 0, 0) OPTION("-fshow-source-location", fshow_source_location, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fsigned-bitfields", fsigned_bitfields, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fsigned-char", fsigned_char, Flag, f_Group, INVALID, "", 0, 0, 0) -OPTION("-fstack-protector", fstack_protector, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0) +OPTION("-fstack-protector-all", fstack_protector_all, Flag, f_Group, INVALID, "", 0, 0, 0) +OPTION("-fstack-protector", fstack_protector, Flag, f_Group, INVALID, "", 0, 0, 0) OPTION("-fstrict-aliasing", fstrict_aliasing, Flag, clang_ignored_f_Group, INVALID, "", 0, 0, 0) OPTION("-fsyntax-only", fsyntax_only, Flag, INVALID, INVALID, "d", 0, 0, 0) OPTION("-ftemplate-depth-", ftemplate_depth_, Joined, f_Group, INVALID, "", 0, 0, 0) |

