diff options
author | Filipe Cabecinhas <me@filcab.net> | 2016-05-12 16:51:36 +0000 |
---|---|---|
committer | Filipe Cabecinhas <me@filcab.net> | 2016-05-12 16:51:36 +0000 |
commit | 889fcf316bb355bf9dbd4cc33cdd78deaf6ad4e7 (patch) | |
tree | 2809312b0af0bf8a2725e03e56988cb28e7bd0de /lib/Frontend/CompilerInvocation.cpp | |
parent | 188ccfbe26070871210f8164999c1a806579b601 (diff) | |
download | clang-889fcf316bb355bf9dbd4cc33cdd78deaf6ad4e7.tar.gz |
[ubsan] Add -fsanitize-undefined-strip-path-components=N
Summary:
This option allows the user to control how much of the file name is
emitted by UBSan. Tuning this option allows one to save space in the
resulting binary, which is helpful for restricted execution
environments.
With a positive N, UBSan skips the first N path components.
With a negative N, UBSan only keeps the last N path components.
Reviewers: rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19666
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269309 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index f11188d0ff..8e93ff1a4b 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -823,6 +823,9 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, Opts.Backchain = Args.hasArg(OPT_mbackchain); + Opts.EmitCheckPathComponentsToStrip = getLastArgIntValue( + Args, OPT_fsanitize_undefined_strip_path_components_EQ, 0, Diags); + return Success; } |