[PATCH] D100150: [Sanitizers] Add a flag -f[no-]sanitize-merge-traps

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 8 15:56:34 PDT 2021


rnk created this revision.
rnk added reviewers: pcc, phosek, rsmith, zequanwu.
Herald added subscribers: jansvoboda11, dexonsmith, dang.
rnk requested review of this revision.
Herald added a project: clang.

Without this flag, enabling optimizations causes clang to emit a single
ubsantrap for every check failure of a particular kind. Adding this flag
allows the user to control this behavior separately, so they can choose
to have increased code size in exchange for more debuggable code.

A Chrome developer requested this feature here:
https://crbug.com/1185451

I made this change in such a way that it doesn't litter the cc1 line
with redundant flags: if the user does not pass the positive or negative
version if this flag, it is not forwarded to the cc1 invocation.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100150

Files:
  clang/include/clang/Basic/CodeGenOptions.def
  clang/include/clang/Driver/Options.td
  clang/include/clang/Driver/SanitizerArgs.h
  clang/lib/CodeGen/CGExpr.cpp
  clang/lib/Driver/SanitizerArgs.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/CodeGen/catch-undef-behavior.c
  clang/test/CodeGen/cfi-nomerge.c
  clang/test/CodeGen/trapv-nomerge.c
  clang/test/Driver/sanitize-merge-traps.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100150.336250.patch
Type: text/x-patch
Size: 8719 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210408/a0d07e19/attachment.bin>


More information about the cfe-commits mailing list