summaryrefslogtreecommitdiffstats
path: root/clang/docs
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/docs
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/docs')
-rw-r--r--clang/docs/UndefinedBehaviorSanitizer.rst20
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/docs/UndefinedBehaviorSanitizer.rst b/clang/docs/UndefinedBehaviorSanitizer.rst
index db1325cc022..7babb96a65a 100644
--- a/clang/docs/UndefinedBehaviorSanitizer.rst
+++ b/clang/docs/UndefinedBehaviorSanitizer.rst
@@ -228,6 +228,26 @@ UndefinedBehaviorSanitizer is available on selected platforms starting from LLVM
3.3. The test suite is integrated into the CMake build and can be run with
``check-ubsan`` command.
+Additional Configuration
+========================
+
+UndefinedBehaviorSanitizer adds static check data for each check unless it is
+in trap mode. This check data includes the full file name. The option
+``-fsanitize-undefined-strip-path-components=N`` can be used to trim this
+information. If ``N`` is positive, file information emitted by
+UndefinedBehaviorSanitizer will drop the first ``N`` components from the file
+path. If ``N`` is negative, the last ``N`` components will be kept.
+
+Example
+-------
+
+For a file called ``/code/library/file.cpp``, here is what would be emitted:
+* Default (No flag, or ``-fsanitize-undefined-strip-path-components=0``): ``/code/library/file.cpp``
+* ``-fsanitize-undefined-strip-path-components=1``: ``code/library/file.cpp``
+* ``-fsanitize-undefined-strip-path-components=2``: ``library/file.cpp``
+* ``-fsanitize-undefined-strip-path-components=-1``: ``file.cpp``
+* ``-fsanitize-undefined-strip-path-components=-2``: ``library/file.cpp``
+
More Information
================
OpenPOWER on IntegriCloud