[all-commits] [llvm/llvm-project] 2721e2: sanitizer_common: deduplicate CheckFailed

Dmitry Vyukov via All-commits all-commits at lists.llvm.org
Tue May 11 23:51:20 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2721e27c3aa34841db3fc0b4da25890288652d50
      https://github.com/llvm/llvm-project/commit/2721e27c3aa34841db3fc0b4da25890288652d50
  Author: Dmitry Vyukov <dvyukov at google.com>
  Date:   2021-05-12 (Wed, 12 May 2021)

  Changed paths:
    M compiler-rt/lib/asan/asan_rtl.cpp
    M compiler-rt/lib/asan/asan_stack.h
    M compiler-rt/lib/hwasan/hwasan.cpp
    M compiler-rt/lib/hwasan/hwasan.h
    M compiler-rt/lib/memprof/memprof_rtl.cpp
    M compiler-rt/lib/memprof/memprof_stack.h
    M compiler-rt/lib/msan/msan.cpp
    M compiler-rt/lib/msan/msan.h
    M compiler-rt/lib/sanitizer_common/sanitizer_common.h
    M compiler-rt/lib/sanitizer_common/sanitizer_termination.cpp
    M compiler-rt/lib/tsan/rtl/tsan_rtl.cpp
    M compiler-rt/lib/tsan/rtl/tsan_rtl.h
    M compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp
    M compiler-rt/test/msan/check-handler.cpp

  Log Message:
  -----------
  sanitizer_common: deduplicate CheckFailed

We have some significant amount of duplication around
CheckFailed functionality. Each sanitizer copy-pasted
a chunk of code. Some got random improvements like
dealing with recursive failures better. These improvements
could benefit all sanitizers, but they don't.

Deduplicate CheckFailed logic across sanitizers and let each
sanitizer only print the current stack trace.
I've tried to dedup stack printing as well,
but this got me into cmake hell. So let's keep this part
duplicated in each sanitizer for now.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D102221




More information about the All-commits mailing list