diff options
author | Oren Ben Simhon <oren.ben.simhon@intel.com> | 2018-03-17 13:31:35 +0000 |
---|---|---|
committer | Oren Ben Simhon <oren.ben.simhon@intel.com> | 2018-03-17 13:31:35 +0000 |
commit | 220671a0806426051a5b565cd525bce56dc2d142 (patch) | |
tree | 12c7cf206645be6194b6185a218c42d53675be14 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | fdd72fd5225dedb4431473fb3ac7b3d45fc8ed00 (diff) | |
download | bcm5719-llvm-220671a0806426051a5b565cd525bce56dc2d142.tar.gz bcm5719-llvm-220671a0806426051a5b565cd525bce56dc2d142.zip |
Adding nocf_check attribute for cf-protection fine tuning
The patch adds nocf_check target independent attribute for disabling checks that were enabled by cf-protection flag.
The attribute can be appertained to functions and function pointers.
Attribute name follows GCC's similar attribute name.
Differential Revision: https://reviews.llvm.org/D41880
llvm-svn: 327768
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index ff8db474e18..330212a6d97 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -2042,6 +2042,12 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, } } + if (const Arg *A = Args.getLastArg(OPT_fcf_protection_EQ)) { + StringRef Name = A->getValue(); + if (Name == "full" || Name == "branch") { + Opts.CFProtectionBranch = 1; + } + } // -cl-std only applies for OpenCL language standards. // Override the -std option in this case. if (const Arg *A = Args.getLastArg(OPT_cl_std_EQ)) { |