[UBSan] Introduce ScopedReport object.
authorAlexey Samsonov <vonosmas@gmail.com>
Wed, 30 Jul 2014 01:49:19 +0000 (01:49 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Wed, 30 Jul 2014 01:49:19 +0000 (01:49 +0000)
commit96591cd1f17b998c652ee05860e03134161f3de8
tree2af562898e4bf4fb873e755e59f1b88f6f758bae
parent76689d02026703c981bad39a4f5b1a5e49893c8d
[UBSan] Introduce ScopedReport object.

This object is used to encapsulate all actions that need to be
done before/after printing UBSan diagnostics. Currently these
actions are:
* locking a mutex to ensure that UBSan diagnostics from several
threads won't mix with each other and with other sanitizers'
reports
* killing a program once the report is printed (if necessary).

Use this object in all UBSan handlers. Unify the way we implement
fatal and non-fatal handlers by making all the handlers simple
one-liners that redirect __ubsan_handle_foo(_abort)? to
handleFooImpl().

llvm-svn: 214279
compiler-rt/lib/ubsan/ubsan_diag.cc
compiler-rt/lib/ubsan/ubsan_diag.h
compiler-rt/lib/ubsan/ubsan_handlers.cc
compiler-rt/lib/ubsan/ubsan_handlers_cxx.cc