summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorFilipe Cabecinhas <me@filcab.net>2016-05-12 16:51:36 +0000
committerFilipe Cabecinhas <me@filcab.net>2016-05-12 16:51:36 +0000
commitab731f7e86c052c9ebec3a2acaca7a500caec1c0 (patch)
tree1930bdf4cb30cb191932bd35a65200e52340b118 /clang/lib/Frontend/CompilerInvocation.cpp
parentb61f01d0a5fcbc83341acadcbe1f77cac28f3ca2 (diff)
downloadbcm5719-llvm-ab731f7e86c052c9ebec3a2acaca7a500caec1c0.tar.gz
bcm5719-llvm-ab731f7e86c052c9ebec3a2acaca7a500caec1c0.zip
[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 llvm-svn: 269309
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index f11188d0ff9..8e93ff1a4b4 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud