svn commit: r317285 - in projects/clang500-import: contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/asan contrib/compiler-rt/lib/builtins contrib/compi...

Dimitry Andric dim at FreeBSD.org
Sat Apr 22 18:43:20 UTC 2017


Author: dim
Date: Sat Apr 22 18:43:15 2017
New Revision: 317285
URL: https://svnweb.freebsd.org/changeset/base/317285

Log:
  Merge compiler-rt trunk r300890, and update build glue.

Added:
  projects/clang500-import/contrib/compiler-rt/include/sanitizer/tsan_interface.h
     - copied unchanged from r317283, vendor/compiler-rt/dist/include/sanitizer/tsan_interface.h
  projects/clang500-import/contrib/compiler-rt/include/xray/xray_log_interface.h
     - copied unchanged from r317283, vendor/compiler-rt/dist/include/xray/xray_log_interface.h
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_interface.inc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/asan/asan_interface.inc
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_win_weak_interception.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/asan/asan_win_weak_interception.cc
  projects/clang500-import/contrib/compiler-rt/lib/builtins/arm/addsf3.S
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/builtins/arm/addsf3.S
  projects/clang500-import/contrib/compiler-rt/lib/builtins/os_version_check.c
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/builtins/os_version_check.c
  projects/clang500-import/contrib/compiler-rt/lib/lsan/lsan_common_mac.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/lsan/lsan_common_mac.cc
  projects/clang500-import/contrib/compiler-rt/lib/lsan/lsan_linux.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/lsan/lsan_linux.cc
  projects/clang500-import/contrib/compiler-rt/lib/lsan/lsan_malloc_mac.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/lsan/lsan_malloc_mac.cc
  projects/clang500-import/contrib/compiler-rt/lib/lsan/weak_symbols.txt
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/lsan/weak_symbols.txt
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_interface.inc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_interface.inc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_interface_posix.inc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_interface_posix.inc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_interface.inc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_interface.inc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_win_dll_thunk.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_win_dll_thunk.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_win_dynamic_runtime_thunk.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_win_dynamic_runtime_thunk.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_win_sections.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_win_sections.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_win_weak_interception.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_win_weak_interception.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_mac.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stoptheworld_mac.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_win.h
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win.h
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_win_defs.h
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win_defs.h
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_win_dll_thunk.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win_dll_thunk.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_win_dll_thunk.h
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win_dll_thunk.h
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_win_dynamic_runtime_thunk.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win_dynamic_runtime_thunk.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_win_weak_interception.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win_weak_interception.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_win_weak_interception.h
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win_weak_interception.h
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/symbolizer/scripts/ar_to_bc.sh
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/sanitizer_common/symbolizer/scripts/ar_to_bc.sh
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_external.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/tsan/rtl/tsan_external.cc
  projects/clang500-import/contrib/compiler-rt/lib/ubsan/ubsan_interface.inc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/ubsan/ubsan_interface.inc
  projects/clang500-import/contrib/compiler-rt/lib/ubsan/ubsan_win_dll_thunk.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/ubsan/ubsan_win_dll_thunk.cc
  projects/clang500-import/contrib/compiler-rt/lib/ubsan/ubsan_win_dynamic_runtime_thunk.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/ubsan/ubsan_win_dynamic_runtime_thunk.cc
  projects/clang500-import/contrib/compiler-rt/lib/ubsan/ubsan_win_weak_interception.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/ubsan/ubsan_win_weak_interception.cc
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_fdr_log_records.h
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/xray/xray_fdr_log_records.h
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_fdr_logging.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/xray/xray_fdr_logging.cc
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_fdr_logging.h
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/xray/xray_fdr_logging.h
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_fdr_logging_impl.h
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/xray/xray_fdr_logging_impl.h
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_log_interface.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/xray/xray_log_interface.cc
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_mips.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/xray/xray_mips.cc
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_mips64.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/xray/xray_mips64.cc
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_powerpc64.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/xray/xray_powerpc64.cc
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_powerpc64.inc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/xray/xray_powerpc64.inc
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_trampoline_mips.S
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/xray/xray_trampoline_mips.S
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_trampoline_mips64.S
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/xray/xray_trampoline_mips64.S
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_trampoline_powerpc64.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/xray/xray_trampoline_powerpc64.cc
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_trampoline_powerpc64_asm.S
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/xray/xray_trampoline_powerpc64_asm.S
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_tsc.h
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/xray/xray_tsc.h
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_utils.cc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/xray/xray_utils.cc
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_utils.h
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/xray/xray_utils.h
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_x86_64.inc
     - copied unchanged from r317283, vendor/compiler-rt/dist/lib/xray/xray_x86_64.inc
Deleted:
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_globals_win.h
  projects/clang500-import/contrib/compiler-rt/lib/scudo/scudo_crc32.h
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_emulate_tsc.h
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_x86_64.h
Modified:
  projects/clang500-import/contrib/compiler-rt/include/sanitizer/common_interface_defs.h
  projects/clang500-import/contrib/compiler-rt/include/sanitizer/coverage_interface.h
  projects/clang500-import/contrib/compiler-rt/include/xray/xray_interface.h
  projects/clang500-import/contrib/compiler-rt/include/xray/xray_records.h
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan.syms.extra
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_allocator.cc
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_descriptions.cc
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_errors.cc
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_flags.cc
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_flags.inc
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_globals_win.cc
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_interceptors.cc
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_interface_internal.h
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_internal.h
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_linux.cc
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_mac.cc
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_malloc_win.cc
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_mapping.h
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_memory_profile.cc
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_posix.cc
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_report.cc
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_report.h
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_suppressions.cc
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_thread.cc
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_thread.h
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_win.cc
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_win_dll_thunk.cc
  projects/clang500-import/contrib/compiler-rt/lib/asan/asan_win_dynamic_runtime_thunk.cc
  projects/clang500-import/contrib/compiler-rt/lib/builtins/arm/aeabi_cdcmp.S
  projects/clang500-import/contrib/compiler-rt/lib/builtins/arm/aeabi_cfcmp.S
  projects/clang500-import/contrib/compiler-rt/lib/builtins/arm/aeabi_dcmp.S
  projects/clang500-import/contrib/compiler-rt/lib/builtins/arm/aeabi_idivmod.S
  projects/clang500-import/contrib/compiler-rt/lib/builtins/arm/aeabi_ldivmod.S
  projects/clang500-import/contrib/compiler-rt/lib/builtins/arm/aeabi_memset.S
  projects/clang500-import/contrib/compiler-rt/lib/builtins/arm/aeabi_uidivmod.S
  projects/clang500-import/contrib/compiler-rt/lib/builtins/arm/aeabi_uldivmod.S
  projects/clang500-import/contrib/compiler-rt/lib/builtins/arm/comparesf2.S
  projects/clang500-import/contrib/compiler-rt/lib/builtins/arm/udivsi3.S
  projects/clang500-import/contrib/compiler-rt/lib/builtins/clear_cache.c
  projects/clang500-import/contrib/compiler-rt/lib/builtins/cpu_model.c
  projects/clang500-import/contrib/compiler-rt/lib/builtins/divtc3.c
  projects/clang500-import/contrib/compiler-rt/lib/builtins/int_lib.h
  projects/clang500-import/contrib/compiler-rt/lib/builtins/x86_64/floatdidf.c
  projects/clang500-import/contrib/compiler-rt/lib/builtins/x86_64/floatdisf.c
  projects/clang500-import/contrib/compiler-rt/lib/cfi/cfi.cc
  projects/clang500-import/contrib/compiler-rt/lib/dfsan/done_abilist.txt
  projects/clang500-import/contrib/compiler-rt/lib/esan/esan_interceptors.cpp
  projects/clang500-import/contrib/compiler-rt/lib/interception/interception_win.cc
  projects/clang500-import/contrib/compiler-rt/lib/lsan/lsan.cc
  projects/clang500-import/contrib/compiler-rt/lib/lsan/lsan.h
  projects/clang500-import/contrib/compiler-rt/lib/lsan/lsan_allocator.cc
  projects/clang500-import/contrib/compiler-rt/lib/lsan/lsan_allocator.h
  projects/clang500-import/contrib/compiler-rt/lib/lsan/lsan_common.cc
  projects/clang500-import/contrib/compiler-rt/lib/lsan/lsan_common.h
  projects/clang500-import/contrib/compiler-rt/lib/lsan/lsan_common_linux.cc
  projects/clang500-import/contrib/compiler-rt/lib/lsan/lsan_flags.inc
  projects/clang500-import/contrib/compiler-rt/lib/lsan/lsan_interceptors.cc
  projects/clang500-import/contrib/compiler-rt/lib/lsan/lsan_thread.cc
  projects/clang500-import/contrib/compiler-rt/lib/lsan/lsan_thread.h
  projects/clang500-import/contrib/compiler-rt/lib/msan/msan_interceptors.cc
  projects/clang500-import/contrib/compiler-rt/lib/profile/InstrProfData.inc
  projects/clang500-import/contrib/compiler-rt/lib/profile/InstrProfilingFile.c
  projects/clang500-import/contrib/compiler-rt/lib/profile/InstrProfilingUtil.c
  projects/clang500-import/contrib/compiler-rt/lib/profile/InstrProfilingUtil.h
  projects/clang500-import/contrib/compiler-rt/lib/profile/InstrProfilingValue.c
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sancov_flags.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sancov_flags.h
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_interface.h
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator_local_cache.h
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common.h
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_flags.inc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_interface_internal.h
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux_s390.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_list.h
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_malloc_mac.inc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_mutex.h
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_posix.h
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_printf.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_common.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_mac.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_quarantine.h
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld.h
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_thread_registry.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_thread_registry.h
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_tls_get_addr.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_tls_get_addr.h
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_win.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_wrappers.cc
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/symbolizer/scripts/global_symbols.txt
  projects/clang500-import/contrib/compiler-rt/lib/sanitizer_common/weak_symbols.txt
  projects/clang500-import/contrib/compiler-rt/lib/scudo/scudo_allocator.cpp
  projects/clang500-import/contrib/compiler-rt/lib/scudo/scudo_allocator.h
  projects/clang500-import/contrib/compiler-rt/lib/scudo/scudo_allocator_secondary.h
  projects/clang500-import/contrib/compiler-rt/lib/scudo/scudo_crc32.cpp
  projects/clang500-import/contrib/compiler-rt/lib/scudo/scudo_flags.cpp
  projects/clang500-import/contrib/compiler-rt/lib/scudo/scudo_flags.inc
  projects/clang500-import/contrib/compiler-rt/lib/scudo/scudo_utils.cpp
  projects/clang500-import/contrib/compiler-rt/lib/scudo/scudo_utils.h
  projects/clang500-import/contrib/compiler-rt/lib/tsan/go/tsan_go.cc
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan.syms.extra
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_debugging.cc
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_defs.h
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_flags.cc
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_flags.h
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_flags.inc
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cc
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_interface.h
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_interface_ann.cc
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_interface_atomic.cc
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_interface_java.cc
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_libdispatch_mac.cc
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_platform_mac.cc
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_report.cc
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_report.h
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl.cc
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl.h
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cc
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_stat.cc
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_stat.h
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_suppressions.cc
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_sync.cc
  projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_sync.h
  projects/clang500-import/contrib/compiler-rt/lib/ubsan/ubsan_diag.cc
  projects/clang500-import/contrib/compiler-rt/lib/ubsan/ubsan_flags.cc
  projects/clang500-import/contrib/compiler-rt/lib/ubsan/ubsan_handlers.cc
  projects/clang500-import/contrib/compiler-rt/lib/ubsan/ubsan_handlers.h
  projects/clang500-import/contrib/compiler-rt/lib/ubsan/ubsan_init.cc
  projects/clang500-import/contrib/compiler-rt/lib/ubsan/ubsan_init.h
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_AArch64.cc
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_arm.cc
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_buffer_queue.cc
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_buffer_queue.h
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_flags.cc
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_flags.h
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_flags.inc
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_init.cc
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_inmemory_log.cc
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_interface.cc
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_interface_internal.h
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_trampoline_AArch64.S
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_trampoline_arm.S
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_trampoline_x86_64.S
  projects/clang500-import/contrib/compiler-rt/lib/xray/xray_x86_64.cc
  projects/clang500-import/lib/libclang_rt/include/Makefile
  projects/clang500-import/lib/libcompiler_rt/Makefile.inc
Directory Properties:
  projects/clang500-import/contrib/compiler-rt/   (props changed)

Modified: projects/clang500-import/contrib/compiler-rt/include/sanitizer/common_interface_defs.h
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/include/sanitizer/common_interface_defs.h	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/include/sanitizer/common_interface_defs.h	Sat Apr 22 18:43:15 2017	(r317285)
@@ -158,8 +158,10 @@ extern "C" {
   // Prints stack traces for all live heap allocations ordered by total
   // allocation size until `top_percent` of total live heap is shown.
   // `top_percent` should be between 1 and 100.
+  // At most `max_number_of_contexts` contexts (stack traces) is printed.
   // Experimental feature currently available only with asan on Linux/x86_64.
-  void __sanitizer_print_memory_profile(size_t top_percent);
+  void __sanitizer_print_memory_profile(size_t top_percent,
+                                        size_t max_number_of_contexts);
 
   // Fiber annotation interface.
   // Before switching to a different stack, one must call

Modified: projects/clang500-import/contrib/compiler-rt/include/sanitizer/coverage_interface.h
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/include/sanitizer/coverage_interface.h	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/include/sanitizer/coverage_interface.h	Sat Apr 22 18:43:15 2017	(r317285)
@@ -35,35 +35,6 @@ extern "C" {
   // Get the number of unique covered blocks (or edges).
   // This can be useful for coverage-directed in-process fuzzers.
   uintptr_t __sanitizer_get_total_unique_coverage();
-  // Get the number of unique indirect caller-callee pairs.
-  uintptr_t __sanitizer_get_total_unique_caller_callee_pairs();
-
-  // Reset the basic-block (edge) coverage to the initial state.
-  // Useful for in-process fuzzing to start collecting coverage from scratch.
-  // Experimental, will likely not work for multi-threaded process.
-  void __sanitizer_reset_coverage();
-  // Set *data to the array of covered PCs and return the size of that array.
-  // Some of the entries in *data will be zero.
-  uintptr_t __sanitizer_get_coverage_guards(uintptr_t **data);
-
-  // The coverage instrumentation may optionally provide imprecise counters.
-  // Rather than exposing the counter values to the user we instead map
-  // the counters to a bitset.
-  // Every counter is associated with 8 bits in the bitset.
-  // We define 8 value ranges: 1, 2, 3, 4-7, 8-15, 16-31, 32-127, 128+
-  // The i-th bit is set to 1 if the counter value is in the i-th range.
-  // This counter-based coverage implementation is *not* thread-safe.
-
-  // Returns the number of registered coverage counters.
-  uintptr_t __sanitizer_get_number_of_counters();
-  // Updates the counter 'bitset', clears the counters and returns the number of
-  // new bits in 'bitset'.
-  // If 'bitset' is nullptr, only clears the counters.
-  // Otherwise 'bitset' should be at least
-  // __sanitizer_get_number_of_counters bytes long and 8-aligned.
-  uintptr_t
-  __sanitizer_update_counter_bitset_and_clear_counters(uint8_t *bitset);
-
 #ifdef __cplusplus
 }  // extern "C"
 #endif

Copied: projects/clang500-import/contrib/compiler-rt/include/sanitizer/tsan_interface.h (from r317283, vendor/compiler-rt/dist/include/sanitizer/tsan_interface.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/clang500-import/contrib/compiler-rt/include/sanitizer/tsan_interface.h	Sat Apr 22 18:43:15 2017	(r317285, copy of r317283, vendor/compiler-rt/dist/include/sanitizer/tsan_interface.h)
@@ -0,0 +1,121 @@
+//===-- tsan_interface.h ----------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file is a part of ThreadSanitizer (TSan), a race detector.
+//
+// Public interface header for TSan.
+//===----------------------------------------------------------------------===//
+#ifndef SANITIZER_TSAN_INTERFACE_H
+#define SANITIZER_TSAN_INTERFACE_H
+
+#include <sanitizer/common_interface_defs.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// __tsan_release establishes a happens-before relation with a preceding
+// __tsan_acquire on the same address.
+void __tsan_acquire(void *addr);
+void __tsan_release(void *addr);
+
+// Annotations for custom mutexes.
+// The annotations allow to get better reports (with sets of locked mutexes),
+// detect more types of bugs (e.g. mutex misuses, races between lock/unlock and
+// destruction and potential deadlocks) and improve precision and performance
+// (by ignoring individual atomic operations in mutex code). However, the
+// downside is that annotated mutex code itself is not checked for correctness.
+
+// Mutex creation flags are passed to __tsan_mutex_create annotation.
+// If mutex has no constructor and __tsan_mutex_create is not called,
+// the flags may be passed to __tsan_mutex_pre_lock/__tsan_mutex_post_lock
+// annotations.
+
+// Mutex has static storage duration and no-op constructor and destructor.
+// This effectively makes tsan ignore destroy annotation.
+const unsigned __tsan_mutex_linker_init      = 1 << 0;
+// Mutex is write reentrant.
+const unsigned __tsan_mutex_write_reentrant  = 1 << 1;
+// Mutex is read reentrant.
+const unsigned __tsan_mutex_read_reentrant   = 1 << 2;
+
+// Mutex operation flags:
+
+// Denotes read lock operation.
+const unsigned __tsan_mutex_read_lock        = 1 << 3;
+// Denotes try lock operation.
+const unsigned __tsan_mutex_try_lock         = 1 << 4;
+// Denotes that a try lock operation has failed to acquire the mutex.
+const unsigned __tsan_mutex_try_lock_failed  = 1 << 5;
+// Denotes that the lock operation acquires multiple recursion levels.
+// Number of levels is passed in recursion parameter.
+// This is useful for annotation of e.g. Java builtin monitors,
+// for which wait operation releases all recursive acquisitions of the mutex.
+const unsigned __tsan_mutex_recursive_lock   = 1 << 6;
+// Denotes that the unlock operation releases all recursion levels.
+// Number of released levels is returned and later must be passed to
+// the corresponding __tsan_mutex_post_lock annotation.
+const unsigned __tsan_mutex_recursive_unlock = 1 << 7;
+
+// Annotate creation of a mutex.
+// Supported flags: mutex creation flags.
+void __tsan_mutex_create(void *addr, unsigned flags);
+
+// Annotate destruction of a mutex.
+// Supported flags: none.
+void __tsan_mutex_destroy(void *addr, unsigned flags);
+
+// Annotate start of lock operation.
+// Supported flags:
+//   - __tsan_mutex_read_lock
+//   - __tsan_mutex_try_lock
+//   - all mutex creation flags
+void __tsan_mutex_pre_lock(void *addr, unsigned flags);
+
+// Annotate end of lock operation.
+// Supported flags:
+//   - __tsan_mutex_read_lock (must match __tsan_mutex_pre_lock)
+//   - __tsan_mutex_try_lock (must match __tsan_mutex_pre_lock)
+//   - __tsan_mutex_try_lock_failed
+//   - __tsan_mutex_recursive_lock
+//   - all mutex creation flags
+void __tsan_mutex_post_lock(void *addr, unsigned flags, int recursion);
+
+// Annotate start of unlock operation.
+// Supported flags:
+//   - __tsan_mutex_read_lock
+//   - __tsan_mutex_recursive_unlock
+int __tsan_mutex_pre_unlock(void *addr, unsigned flags);
+
+// Annotate end of unlock operation.
+// Supported flags:
+//   - __tsan_mutex_read_lock (must match __tsan_mutex_pre_unlock)
+void __tsan_mutex_post_unlock(void *addr, unsigned flags);
+
+// Annotate start/end of notify/signal/broadcast operation.
+// Supported flags: none.
+void __tsan_mutex_pre_signal(void *addr, unsigned flags);
+void __tsan_mutex_post_signal(void *addr, unsigned flags);
+
+// Annotate start/end of a region of code where lock/unlock/signal operation
+// diverts to do something else unrelated to the mutex. This can be used to
+// annotate, for example, calls into cooperative scheduler or contention
+// profiling code.
+// These annotations must be called only from within
+// __tsan_mutex_pre/post_lock, __tsan_mutex_pre/post_unlock,
+// __tsan_mutex_pre/post_signal regions.
+// Supported flags: none.
+void __tsan_mutex_pre_divert(void *addr, unsigned flags);
+void __tsan_mutex_post_divert(void *addr, unsigned flags);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif  // SANITIZER_TSAN_INTERFACE_H

Modified: projects/clang500-import/contrib/compiler-rt/include/xray/xray_interface.h
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/include/xray/xray_interface.h	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/include/xray/xray_interface.h	Sat Apr 22 18:43:15 2017	(r317285)
@@ -18,7 +18,13 @@
 
 extern "C" {
 
-enum XRayEntryType { ENTRY = 0, EXIT = 1, TAIL = 2 };
+// Synchronize this with AsmPrinter::SledKind in LLVM.
+enum XRayEntryType {
+  ENTRY = 0,
+  EXIT = 1,
+  TAIL = 2,
+  LOG_ARGS_ENTRY = 3,
+};
 
 // Provide a function to invoke for when instrumentation points are hit. This is
 // a user-visible control surface that overrides the default implementation. The
@@ -60,6 +66,17 @@ extern XRayPatchingStatus __xray_patch()
 // Reverses the effect of __xray_patch(). See XRayPatchingStatus for possible
 // result values.
 extern XRayPatchingStatus __xray_unpatch();
+
+// Use XRay to log the first argument of each (instrumented) function call.
+// When this function exits, all threads will have observed the effect and
+// start logging their subsequent affected function calls (if patched).
+//
+// Returns 1 on success, 0 on error.
+extern int __xray_set_handler_arg1(void (*)(int32_t, XRayEntryType, uint64_t));
+
+// Disables the XRay handler used to log first arguments of function calls.
+// Returns 1 on success, 0 on error.
+extern int __xray_remove_handler_arg1();
 }
 
 #endif

Copied: projects/clang500-import/contrib/compiler-rt/include/xray/xray_log_interface.h (from r317283, vendor/compiler-rt/dist/include/xray/xray_log_interface.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/clang500-import/contrib/compiler-rt/include/xray/xray_log_interface.h	Sat Apr 22 18:43:15 2017	(r317285, copy of r317283, vendor/compiler-rt/dist/include/xray/xray_log_interface.h)
@@ -0,0 +1,60 @@
+//===-- xray_log_interface.h ----------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file is a part of XRay, a function call tracing system.
+//
+// APIs for installing a new logging implementation.
+//===----------------------------------------------------------------------===//
+#ifndef XRAY_XRAY_LOG_INTERFACE_H
+#define XRAY_XRAY_LOG_INTERFACE_H
+
+#include "xray/xray_interface.h"
+#include <stddef.h>
+
+extern "C" {
+
+enum XRayLogInitStatus {
+  XRAY_LOG_UNINITIALIZED = 0,
+  XRAY_LOG_INITIALIZING = 1,
+  XRAY_LOG_INITIALIZED = 2,
+  XRAY_LOG_FINALIZING = 3,
+  XRAY_LOG_FINALIZED = 4,
+};
+
+enum XRayLogFlushStatus {
+  XRAY_LOG_NOT_FLUSHING = 0,
+  XRAY_LOG_FLUSHING = 1,
+  XRAY_LOG_FLUSHED = 2,
+};
+
+struct XRayLogImpl {
+  XRayLogInitStatus (*log_init)(size_t, size_t, void *, size_t);
+  XRayLogInitStatus (*log_finalize)();
+  void (*handle_arg0)(int32_t, XRayEntryType);
+  XRayLogFlushStatus (*flush_log)();
+};
+
+void __xray_set_log_impl(XRayLogImpl Impl);
+XRayLogInitStatus __xray_log_init(size_t BufferSize, size_t MaxBuffers,
+                                  void *Args, size_t ArgsSize);
+XRayLogInitStatus __xray_log_finalize();
+XRayLogFlushStatus __xray_log_flushLog();
+
+} // extern "C"
+
+namespace __xray {
+// Options used by the LLVM XRay FDR implementation.
+struct FDRLoggingOptions {
+  bool ReportErrors = false;
+  int Fd = -1;
+};
+
+} // namespace __xray
+
+#endif // XRAY_XRAY_LOG_INTERFACE_H

Modified: projects/clang500-import/contrib/compiler-rt/include/xray/xray_records.h
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/include/xray/xray_records.h	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/include/xray/xray_records.h	Sat Apr 22 18:43:15 2017	(r317285)
@@ -21,8 +21,17 @@ namespace __xray {
 
 enum FileTypes {
   NAIVE_LOG = 0,
+  FDR_LOG = 1,
 };
 
+// FDR mode use of the union field in the XRayFileHeader.
+struct alignas(16) FdrAdditionalHeaderData {
+  uint64_t ThreadBufferSize;
+};
+
+static_assert(sizeof(FdrAdditionalHeaderData) == 16,
+              "FdrAdditionalHeaderData != 16 bytes");
+
 // This data structure is used to describe the contents of the file. We use this
 // for versioning the supported XRay file formats.
 struct alignas(32) XRayFileHeader {
@@ -40,6 +49,16 @@ struct alignas(32) XRayFileHeader {
 
   // The frequency by which TSC increases per-second.
   alignas(8) uint64_t CycleFrequency = 0;
+
+  union {
+    char FreeForm[16];
+    // The current civiltime timestamp, as retrived from 'clock_gettime'. This
+    // allows readers of the file to determine when the file was created or
+    // written down.
+    struct timespec TS;
+
+    struct FdrAdditionalHeaderData FdrData;
+  };
 } __attribute__((packed));
 
 static_assert(sizeof(XRayFileHeader) == 32, "XRayFileHeader != 32 bytes");

Modified: projects/clang500-import/contrib/compiler-rt/lib/asan/asan.syms.extra
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/lib/asan/asan.syms.extra	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/lib/asan/asan.syms.extra	Sat Apr 22 18:43:15 2017	(r317285)
@@ -1,3 +1,4 @@
 __asan_*
 __lsan_*
 __ubsan_*
+__sancov_*

Modified: projects/clang500-import/contrib/compiler-rt/lib/asan/asan_allocator.cc
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/lib/asan/asan_allocator.cc	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/lib/asan/asan_allocator.cc	Sat Apr 22 18:43:15 2017	(r317285)
@@ -523,6 +523,18 @@ struct Allocator {
     AsanThread *t = GetCurrentThread();
     m->free_tid = t ? t->tid() : 0;
     m->free_context_id = StackDepotPut(*stack);
+
+    Flags &fl = *flags();
+    if (fl.max_free_fill_size > 0) {
+      // We have to skip the chunk header, it contains free_context_id.
+      uptr scribble_start = (uptr)m + kChunkHeaderSize + kChunkHeader2Size;
+      if (m->UsedSize() >= kChunkHeader2Size) {  // Skip Header2 in user area.
+        uptr size_to_fill = m->UsedSize() - kChunkHeader2Size;
+        size_to_fill = Min(size_to_fill, (uptr)fl.max_free_fill_size);
+        REAL(memset)((void *)scribble_start, fl.free_fill_byte, size_to_fill);
+      }
+    }
+
     // Poison the region.
     PoisonShadow(m->Beg(),
                  RoundUpTo(m->UsedSize(), SHADOW_GRANULARITY),
@@ -554,7 +566,17 @@ struct Allocator {
     uptr chunk_beg = p - kChunkHeaderSize;
     AsanChunk *m = reinterpret_cast<AsanChunk *>(chunk_beg);
 
+    // On Windows, uninstrumented DLLs may allocate memory before ASan hooks
+    // malloc. Don't report an invalid free in this case.
+    if (SANITIZER_WINDOWS &&
+        !get_allocator().PointerIsMine(ptr)) {
+      if (!IsSystemHeapAddress(p))
+        ReportFreeNotMalloced(p, stack);
+      return;
+    }
+
     ASAN_FREE_HOOK(ptr);
+
     // Must mark the chunk as quarantined before any changes to its metadata.
     // Do not quarantine given chunk if we failed to set CHUNK_QUARANTINE flag.
     if (!AtomicallySetQuarantineFlagIfAllocated(m, ptr, stack)) return;
@@ -790,8 +812,12 @@ void *asan_realloc(void *p, uptr size, B
   if (!p)
     return instance.Allocate(size, 8, stack, FROM_MALLOC, true);
   if (size == 0) {
-    instance.Deallocate(p, 0, stack, FROM_MALLOC);
-    return nullptr;
+    if (flags()->allocator_frees_and_returns_null_on_realloc_zero) {
+      instance.Deallocate(p, 0, stack, FROM_MALLOC);
+      return nullptr;
+    }
+    // Allocate a size of 1 if we shouldn't free() on Realloc to 0
+    size = 1;
   }
   return instance.Reallocate(p, size, stack);
 }
@@ -958,15 +984,13 @@ uptr __sanitizer_get_allocated_size(cons
 
 #if !SANITIZER_SUPPORTS_WEAK_HOOKS
 // Provide default (no-op) implementation of malloc hooks.
-extern "C" {
-SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
-void __sanitizer_malloc_hook(void *ptr, uptr size) {
+SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_malloc_hook,
+                             void *ptr, uptr size) {
   (void)ptr;
   (void)size;
 }
-SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
-void __sanitizer_free_hook(void *ptr) {
+
+SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_free_hook, void *ptr) {
   (void)ptr;
 }
-} // extern "C"
 #endif

Modified: projects/clang500-import/contrib/compiler-rt/lib/asan/asan_descriptions.cc
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/lib/asan/asan_descriptions.cc	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/lib/asan/asan_descriptions.cc	Sat Apr 22 18:43:15 2017	(r317285)
@@ -252,6 +252,9 @@ static void PrintAccessAndVarIntersectio
     str.append("%c", var.name_pos[i]);
   }
   str.append("'");
+  if (var.line > 0) {
+    str.append(" (line %d)", var.line);
+  }
   if (pos_descr) {
     Decorator d;
     // FIXME: we may want to also print the size of the access here,

Modified: projects/clang500-import/contrib/compiler-rt/lib/asan/asan_errors.cc
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/lib/asan/asan_errors.cc	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/lib/asan/asan_errors.cc	Sat Apr 22 18:43:15 2017	(r317285)
@@ -58,10 +58,22 @@ static void MaybeDumpRegisters(void *con
   SignalContext::DumpAllRegisters(context);
 }
 
+static void MaybeReportNonExecRegion(uptr pc) {
+#if SANITIZER_FREEBSD || SANITIZER_LINUX
+  MemoryMappingLayout proc_maps(/*cache_enabled*/ true);
+  uptr start, end, protection;
+  while (proc_maps.Next(&start, &end, nullptr, nullptr, 0, &protection)) {
+    if (pc >= start && pc < end &&
+        !(protection & MemoryMappingLayout::kProtectionExecute))
+      Report("Hint: PC is at a non-executable region. Maybe a wild jump?\n");
+  }
+#endif
+}
+
 void ErrorDeadlySignal::Print() {
   Decorator d;
   Printf("%s", d.Warning());
-  const char *description = DescribeSignalOrException(signo);
+  const char *description = __sanitizer::DescribeSignalOrException(signo);
   Report(
       "ERROR: AddressSanitizer: %s on unknown address %p (pc %p bp %p sp %p "
       "T%d)\n",
@@ -77,6 +89,7 @@ void ErrorDeadlySignal::Print() {
     if (addr < GetPageSizeCached())
       Report("Hint: address points to the zero page.\n");
   }
+  MaybeReportNonExecRegion(pc);
   scariness.Print();
   BufferedStackTrace stack;
   GetStackTraceWithPcBpAndContext(&stack, kStackTraceMax, pc, bp, context,

Modified: projects/clang500-import/contrib/compiler-rt/lib/asan/asan_flags.cc
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/lib/asan/asan_flags.cc	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/lib/asan/asan_flags.cc	Sat Apr 22 18:43:15 2017	(r317285)
@@ -61,7 +61,7 @@ void InitializeFlags() {
   {
     CommonFlags cf;
     cf.CopyFrom(*common_flags());
-    cf.detect_leaks = CAN_SANITIZE_LEAKS;
+    cf.detect_leaks = cf.detect_leaks && CAN_SANITIZE_LEAKS;
     cf.external_symbolizer_path = GetEnv("ASAN_SYMBOLIZER_PATH");
     cf.malloc_context_size = kDefaultMallocContextSize;
     cf.intercept_tls_get_addr = true;
@@ -95,6 +95,18 @@ void InitializeFlags() {
   RegisterCommonFlags(&ubsan_parser);
 #endif
 
+  if (SANITIZER_MAC) {
+    // Support macOS MallocScribble and MallocPreScribble:
+    // <https://developer.apple.com/library/content/documentation/Performance/
+    // Conceptual/ManagingMemory/Articles/MallocDebug.html>
+    if (GetEnv("MallocScribble")) {
+      f->max_free_fill_size = 0x1000;
+    }
+    if (GetEnv("MallocPreScribble")) {
+      f->malloc_fill_byte = 0xaa;
+    }
+  }
+
   // Override from ASan compile definition.
   const char *asan_compile_def = MaybeUseAsanDefaultOptionsCompileDefinition();
   asan_parser.ParseString(asan_compile_def);
@@ -186,9 +198,6 @@ void InitializeFlags() {
 
 }  // namespace __asan
 
-#if !SANITIZER_SUPPORTS_WEAK_HOOKS
-extern "C" {
-SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
-const char* __asan_default_options() { return ""; }
-}  // extern "C"
-#endif
+SANITIZER_INTERFACE_WEAK_DEF(const char*, __asan_default_options, void) {
+  return "";
+}

Modified: projects/clang500-import/contrib/compiler-rt/lib/asan/asan_flags.inc
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/lib/asan/asan_flags.inc	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/lib/asan/asan_flags.inc	Sat Apr 22 18:43:15 2017	(r317285)
@@ -63,8 +63,14 @@ ASAN_FLAG(
     int, max_malloc_fill_size, 0x1000,  // By default, fill only the first 4K.
     "ASan allocator flag. max_malloc_fill_size is the maximal amount of "
     "bytes that will be filled with malloc_fill_byte on malloc.")
+ASAN_FLAG(
+    int, max_free_fill_size, 0,
+    "ASan allocator flag. max_free_fill_size is the maximal amount of "
+    "bytes that will be filled with free_fill_byte during free.")
 ASAN_FLAG(int, malloc_fill_byte, 0xbe,
           "Value used to fill the newly allocated memory.")
+ASAN_FLAG(int, free_fill_byte, 0x55,
+          "Value used to fill deallocated memory.")
 ASAN_FLAG(bool, allow_user_poisoning, true,
           "If set, user may manually mark memory regions as poisoned or "
           "unpoisoned.")
@@ -148,3 +154,10 @@ ASAN_FLAG(bool, halt_on_error, true,
           "(WARNING: USE AT YOUR OWN RISK!)")
 ASAN_FLAG(bool, use_odr_indicator, false,
           "Use special ODR indicator symbol for ODR violation detection")
+ASAN_FLAG(bool, allocator_frees_and_returns_null_on_realloc_zero, true,
+          "realloc(p, 0) is equivalent to free(p) by default (Same as the "
+          "POSIX standard). If set to false, realloc(p, 0) will return a "
+          "pointer to an allocated space which can not be used.")
+ASAN_FLAG(bool, verify_asan_link_order, true,
+          "Check position of ASan runtime in library list (needs to be disabled"
+          " when other library has to be preloaded system-wide)")

Modified: projects/clang500-import/contrib/compiler-rt/lib/asan/asan_globals_win.cc
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/lib/asan/asan_globals_win.cc	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/lib/asan/asan_globals_win.cc	Sat Apr 22 18:43:15 2017	(r317285)
@@ -29,7 +29,7 @@ static void call_on_globals(void (*hook)
   __asan_global *end = &__asan_globals_end;
   uptr bytediff = (uptr)end - (uptr)start;
   if (bytediff % sizeof(__asan_global) != 0) {
-#ifdef ASAN_DLL_THUNK
+#ifdef SANITIZER_DLL_THUNK
     __debugbreak();
 #else
     CHECK("corrupt asan global array");

Modified: projects/clang500-import/contrib/compiler-rt/lib/asan/asan_interceptors.cc
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/lib/asan/asan_interceptors.cc	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/lib/asan/asan_interceptors.cc	Sat Apr 22 18:43:15 2017	(r317285)
@@ -228,9 +228,11 @@ DECLARE_REAL_AND_INTERCEPTOR(void, free,
 // Strict init-order checking is dlopen-hostile:
 // https://github.com/google/sanitizers/issues/178
 #define COMMON_INTERCEPTOR_ON_DLOPEN(filename, flag)                           \
-  if (flags()->strict_init_order) {                                            \
-    StopInitOrderChecking();                                                   \
-  }
+  do {                                                                         \
+    if (flags()->strict_init_order)                                            \
+      StopInitOrderChecking();                                                 \
+    CheckNoDeepBind(filename, flag);                                           \
+  } while (false)
 #define COMMON_INTERCEPTOR_ON_EXIT(ctx) OnExit()
 #define COMMON_INTERCEPTOR_LIBRARY_LOADED(filename, handle) \
   CoverageUpdateMapping()

Copied: projects/clang500-import/contrib/compiler-rt/lib/asan/asan_interface.inc (from r317283, vendor/compiler-rt/dist/lib/asan/asan_interface.inc)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/clang500-import/contrib/compiler-rt/lib/asan/asan_interface.inc	Sat Apr 22 18:43:15 2017	(r317285, copy of r317283, vendor/compiler-rt/dist/lib/asan/asan_interface.inc)
@@ -0,0 +1,167 @@
+//===-- asan_interface.inc ------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// Asan interface list.
+//===----------------------------------------------------------------------===//
+INTERFACE_FUNCTION(__asan_addr_is_in_fake_stack)
+INTERFACE_FUNCTION(__asan_address_is_poisoned)
+INTERFACE_FUNCTION(__asan_after_dynamic_init)
+INTERFACE_FUNCTION(__asan_alloca_poison)
+INTERFACE_FUNCTION(__asan_allocas_unpoison)
+INTERFACE_FUNCTION(__asan_before_dynamic_init)
+INTERFACE_FUNCTION(__asan_describe_address)
+INTERFACE_FUNCTION(__asan_exp_load1)
+INTERFACE_FUNCTION(__asan_exp_load2)
+INTERFACE_FUNCTION(__asan_exp_load4)
+INTERFACE_FUNCTION(__asan_exp_load8)
+INTERFACE_FUNCTION(__asan_exp_load16)
+INTERFACE_FUNCTION(__asan_exp_loadN)
+INTERFACE_FUNCTION(__asan_exp_store1)
+INTERFACE_FUNCTION(__asan_exp_store2)
+INTERFACE_FUNCTION(__asan_exp_store4)
+INTERFACE_FUNCTION(__asan_exp_store8)
+INTERFACE_FUNCTION(__asan_exp_store16)
+INTERFACE_FUNCTION(__asan_exp_storeN)
+INTERFACE_FUNCTION(__asan_get_alloc_stack)
+INTERFACE_FUNCTION(__asan_get_current_fake_stack)
+INTERFACE_FUNCTION(__asan_get_free_stack)
+INTERFACE_FUNCTION(__asan_get_report_access_size)
+INTERFACE_FUNCTION(__asan_get_report_access_type)
+INTERFACE_FUNCTION(__asan_get_report_address)
+INTERFACE_FUNCTION(__asan_get_report_bp)
+INTERFACE_FUNCTION(__asan_get_report_description)
+INTERFACE_FUNCTION(__asan_get_report_pc)
+INTERFACE_FUNCTION(__asan_get_report_sp)
+INTERFACE_FUNCTION(__asan_get_shadow_mapping)
+INTERFACE_FUNCTION(__asan_handle_no_return)
+INTERFACE_FUNCTION(__asan_init)
+INTERFACE_FUNCTION(__asan_load_cxx_array_cookie)
+INTERFACE_FUNCTION(__asan_load1)
+INTERFACE_FUNCTION(__asan_load2)
+INTERFACE_FUNCTION(__asan_load4)
+INTERFACE_FUNCTION(__asan_load8)
+INTERFACE_FUNCTION(__asan_load16)
+INTERFACE_FUNCTION(__asan_loadN)
+INTERFACE_FUNCTION(__asan_load1_noabort)
+INTERFACE_FUNCTION(__asan_load2_noabort)
+INTERFACE_FUNCTION(__asan_load4_noabort)
+INTERFACE_FUNCTION(__asan_load8_noabort)
+INTERFACE_FUNCTION(__asan_load16_noabort)
+INTERFACE_FUNCTION(__asan_loadN_noabort)
+INTERFACE_FUNCTION(__asan_locate_address)
+INTERFACE_FUNCTION(__asan_memcpy)
+INTERFACE_FUNCTION(__asan_memmove)
+INTERFACE_FUNCTION(__asan_memset)
+INTERFACE_FUNCTION(__asan_poison_cxx_array_cookie)
+INTERFACE_FUNCTION(__asan_poison_intra_object_redzone)
+INTERFACE_FUNCTION(__asan_poison_memory_region)
+INTERFACE_FUNCTION(__asan_poison_stack_memory)
+INTERFACE_FUNCTION(__asan_print_accumulated_stats)
+INTERFACE_FUNCTION(__asan_region_is_poisoned)
+INTERFACE_FUNCTION(__asan_register_globals)
+INTERFACE_FUNCTION(__asan_register_image_globals)
+INTERFACE_FUNCTION(__asan_report_error)
+INTERFACE_FUNCTION(__asan_report_exp_load1)
+INTERFACE_FUNCTION(__asan_report_exp_load2)
+INTERFACE_FUNCTION(__asan_report_exp_load4)
+INTERFACE_FUNCTION(__asan_report_exp_load8)
+INTERFACE_FUNCTION(__asan_report_exp_load16)
+INTERFACE_FUNCTION(__asan_report_exp_load_n)
+INTERFACE_FUNCTION(__asan_report_exp_store1)
+INTERFACE_FUNCTION(__asan_report_exp_store2)
+INTERFACE_FUNCTION(__asan_report_exp_store4)
+INTERFACE_FUNCTION(__asan_report_exp_store8)
+INTERFACE_FUNCTION(__asan_report_exp_store16)
+INTERFACE_FUNCTION(__asan_report_exp_store_n)
+INTERFACE_FUNCTION(__asan_report_load1)
+INTERFACE_FUNCTION(__asan_report_load2)
+INTERFACE_FUNCTION(__asan_report_load4)
+INTERFACE_FUNCTION(__asan_report_load8)
+INTERFACE_FUNCTION(__asan_report_load16)
+INTERFACE_FUNCTION(__asan_report_load_n)
+INTERFACE_FUNCTION(__asan_report_load1_noabort)
+INTERFACE_FUNCTION(__asan_report_load2_noabort)
+INTERFACE_FUNCTION(__asan_report_load4_noabort)
+INTERFACE_FUNCTION(__asan_report_load8_noabort)
+INTERFACE_FUNCTION(__asan_report_load16_noabort)
+INTERFACE_FUNCTION(__asan_report_load_n_noabort)
+INTERFACE_FUNCTION(__asan_report_present)
+INTERFACE_FUNCTION(__asan_report_store1)
+INTERFACE_FUNCTION(__asan_report_store2)
+INTERFACE_FUNCTION(__asan_report_store4)
+INTERFACE_FUNCTION(__asan_report_store8)
+INTERFACE_FUNCTION(__asan_report_store16)
+INTERFACE_FUNCTION(__asan_report_store_n)
+INTERFACE_FUNCTION(__asan_report_store1_noabort)
+INTERFACE_FUNCTION(__asan_report_store2_noabort)
+INTERFACE_FUNCTION(__asan_report_store4_noabort)
+INTERFACE_FUNCTION(__asan_report_store8_noabort)
+INTERFACE_FUNCTION(__asan_report_store16_noabort)
+INTERFACE_FUNCTION(__asan_report_store_n_noabort)
+INTERFACE_FUNCTION(__asan_set_death_callback)
+INTERFACE_FUNCTION(__asan_set_error_report_callback)
+INTERFACE_FUNCTION(__asan_set_shadow_00)
+INTERFACE_FUNCTION(__asan_set_shadow_f1)
+INTERFACE_FUNCTION(__asan_set_shadow_f2)
+INTERFACE_FUNCTION(__asan_set_shadow_f3)
+INTERFACE_FUNCTION(__asan_set_shadow_f5)
+INTERFACE_FUNCTION(__asan_set_shadow_f8)
+INTERFACE_FUNCTION(__asan_stack_free_0)
+INTERFACE_FUNCTION(__asan_stack_free_1)
+INTERFACE_FUNCTION(__asan_stack_free_2)
+INTERFACE_FUNCTION(__asan_stack_free_3)
+INTERFACE_FUNCTION(__asan_stack_free_4)
+INTERFACE_FUNCTION(__asan_stack_free_5)
+INTERFACE_FUNCTION(__asan_stack_free_6)
+INTERFACE_FUNCTION(__asan_stack_free_7)
+INTERFACE_FUNCTION(__asan_stack_free_8)
+INTERFACE_FUNCTION(__asan_stack_free_9)
+INTERFACE_FUNCTION(__asan_stack_free_10)
+INTERFACE_FUNCTION(__asan_stack_malloc_0)
+INTERFACE_FUNCTION(__asan_stack_malloc_1)
+INTERFACE_FUNCTION(__asan_stack_malloc_2)
+INTERFACE_FUNCTION(__asan_stack_malloc_3)
+INTERFACE_FUNCTION(__asan_stack_malloc_4)
+INTERFACE_FUNCTION(__asan_stack_malloc_5)
+INTERFACE_FUNCTION(__asan_stack_malloc_6)
+INTERFACE_FUNCTION(__asan_stack_malloc_7)
+INTERFACE_FUNCTION(__asan_stack_malloc_8)
+INTERFACE_FUNCTION(__asan_stack_malloc_9)
+INTERFACE_FUNCTION(__asan_stack_malloc_10)
+INTERFACE_FUNCTION(__asan_store1)
+INTERFACE_FUNCTION(__asan_store2)
+INTERFACE_FUNCTION(__asan_store4)
+INTERFACE_FUNCTION(__asan_store8)
+INTERFACE_FUNCTION(__asan_store16)
+INTERFACE_FUNCTION(__asan_storeN)
+INTERFACE_FUNCTION(__asan_store1_noabort)
+INTERFACE_FUNCTION(__asan_store2_noabort)
+INTERFACE_FUNCTION(__asan_store4_noabort)
+INTERFACE_FUNCTION(__asan_store8_noabort)
+INTERFACE_FUNCTION(__asan_store16_noabort)
+INTERFACE_FUNCTION(__asan_storeN_noabort)
+INTERFACE_FUNCTION(__asan_unpoison_intra_object_redzone)
+INTERFACE_FUNCTION(__asan_unpoison_memory_region)
+INTERFACE_FUNCTION(__asan_unpoison_stack_memory)
+INTERFACE_FUNCTION(__asan_unregister_globals)
+INTERFACE_FUNCTION(__asan_unregister_image_globals)
+INTERFACE_FUNCTION(__asan_version_mismatch_check_v8)
+INTERFACE_FUNCTION(__sanitizer_finish_switch_fiber)
+INTERFACE_FUNCTION(__sanitizer_print_stack_trace)
+INTERFACE_FUNCTION(__sanitizer_ptr_cmp)
+INTERFACE_FUNCTION(__sanitizer_ptr_sub)
+INTERFACE_FUNCTION(__sanitizer_start_switch_fiber)
+INTERFACE_FUNCTION(__sanitizer_unaligned_load16)
+INTERFACE_FUNCTION(__sanitizer_unaligned_load32)
+INTERFACE_FUNCTION(__sanitizer_unaligned_load64)
+INTERFACE_FUNCTION(__sanitizer_unaligned_store16)
+INTERFACE_FUNCTION(__sanitizer_unaligned_store32)
+INTERFACE_FUNCTION(__sanitizer_unaligned_store64)
+INTERFACE_WEAK_FUNCTION(__asan_default_options)
+INTERFACE_WEAK_FUNCTION(__asan_default_suppressions)
+INTERFACE_WEAK_FUNCTION(__asan_on_error)

Modified: projects/clang500-import/contrib/compiler-rt/lib/asan/asan_interface_internal.h
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/lib/asan/asan_interface_internal.h	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/lib/asan/asan_interface_internal.h	Sat Apr 22 18:43:15 2017	(r317285)
@@ -165,12 +165,12 @@ extern "C" {
   void __asan_set_error_report_callback(void (*callback)(const char*));
 
   SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
-  /* OPTIONAL */ void __asan_on_error();
+  void __asan_on_error();
 
   SANITIZER_INTERFACE_ATTRIBUTE void __asan_print_accumulated_stats();
 
   SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
-  /* OPTIONAL */ const char* __asan_default_options();
+  const char* __asan_default_options();
 
   SANITIZER_INTERFACE_ATTRIBUTE
   extern uptr __asan_shadow_memory_dynamic_address;
@@ -242,6 +242,9 @@ extern "C" {
   void __asan_alloca_poison(uptr addr, uptr size);
   SANITIZER_INTERFACE_ATTRIBUTE
   void __asan_allocas_unpoison(uptr top, uptr bottom);
+
+  SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
+  const char* __asan_default_suppressions();
 }  // extern "C"
 
 #endif  // ASAN_INTERFACE_INTERNAL_H

Modified: projects/clang500-import/contrib/compiler-rt/lib/asan/asan_internal.h
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/lib/asan/asan_internal.h	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/lib/asan/asan_internal.h	Sat Apr 22 18:43:15 2017	(r317285)
@@ -64,9 +64,9 @@ void AsanInitFromRtl();
 
 // asan_win.cc
 void InitializePlatformExceptionHandlers();
-
-// asan_win.cc / asan_posix.cc
-const char *DescribeSignalOrException(int signo);
+// Returns whether an address is a valid allocated system heap block.
+// 'addr' must point to the beginning of the block.
+bool IsSystemHeapAddress(uptr addr);
 
 // asan_rtl.cc
 void NORETURN ShowStatsAndAbort();

Modified: projects/clang500-import/contrib/compiler-rt/lib/asan/asan_linux.cc
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/lib/asan/asan_linux.cc	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/lib/asan/asan_linux.cc	Sat Apr 22 18:43:15 2017	(r317285)
@@ -70,6 +70,7 @@ namespace __asan {
 
 void InitializePlatformInterceptors() {}
 void InitializePlatformExceptionHandlers() {}
+bool IsSystemHeapAddress (uptr addr) { return false; }
 
 void *AsanDoesNotSupportStaticLinkage() {
   // This will fail to link with -static.
@@ -110,7 +111,7 @@ static void ReportIncompatibleRT() {
 }
 
 void AsanCheckDynamicRTPrereqs() {
-  if (!ASAN_DYNAMIC)
+  if (!ASAN_DYNAMIC || !flags()->verify_asan_link_order)
     return;
 
   // Ensure that dynamic RT is the first DSO in the list

Modified: projects/clang500-import/contrib/compiler-rt/lib/asan/asan_mac.cc
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/lib/asan/asan_mac.cc	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/lib/asan/asan_mac.cc	Sat Apr 22 18:43:15 2017	(r317285)
@@ -48,6 +48,7 @@ namespace __asan {
 
 void InitializePlatformInterceptors() {}
 void InitializePlatformExceptionHandlers() {}
+bool IsSystemHeapAddress (uptr addr) { return false; }
 
 // No-op. Mac does not support static linkage anyway.
 void *AsanDoesNotSupportStaticLinkage() {
@@ -138,7 +139,8 @@ void asan_register_worker_thread(int par
     t = AsanThread::Create(/* start_routine */ nullptr, /* arg */ nullptr,
                            parent_tid, stack, /* detached */ true);
     t->Init();
-    asanThreadRegistry().StartThread(t->tid(), 0, 0);
+    asanThreadRegistry().StartThread(t->tid(), GetTid(),
+                                     /* workerthread */ true, 0);
     SetCurrentThread(t);
   }
 }

Modified: projects/clang500-import/contrib/compiler-rt/lib/asan/asan_malloc_win.cc
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/lib/asan/asan_malloc_win.cc	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/lib/asan/asan_malloc_win.cc	Sat Apr 22 18:43:15 2017	(r317285)
@@ -100,7 +100,7 @@ void *realloc(void *ptr, size_t size) {
 
 ALLOCATION_FUNCTION_ATTRIBUTE
 void *_realloc_dbg(void *ptr, size_t size, int) {
-  CHECK(!"_realloc_dbg should not exist!");
+  UNREACHABLE("_realloc_dbg should not exist!");
   return 0;
 }
 

Modified: projects/clang500-import/contrib/compiler-rt/lib/asan/asan_mapping.h
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/lib/asan/asan_mapping.h	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/lib/asan/asan_mapping.h	Sat Apr 22 18:43:15 2017	(r317285)
@@ -191,7 +191,6 @@ static const u64 kWindowsShadowOffset32 
 
 #define SHADOW_GRANULARITY (1ULL << SHADOW_SCALE)
 #define MEM_TO_SHADOW(mem) (((mem) >> SHADOW_SCALE) + (SHADOW_OFFSET))
-#define SHADOW_TO_MEM(shadow) (((shadow) - SHADOW_OFFSET) << SHADOW_SCALE)
 
 #define kLowMemBeg      0
 #define kLowMemEnd      (SHADOW_OFFSET ? SHADOW_OFFSET - 1 : 0)

Modified: projects/clang500-import/contrib/compiler-rt/lib/asan/asan_memory_profile.cc
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/lib/asan/asan_memory_profile.cc	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/lib/asan/asan_memory_profile.cc	Sat Apr 22 18:43:15 2017	(r317285)
@@ -48,7 +48,7 @@ class HeapProfile {
     }
   }
 
-  void Print(uptr top_percent) {
+  void Print(uptr top_percent, uptr max_number_of_contexts) {
     InternalSort(&allocations_, allocations_.size(),
                  [](const AllocationSite &a, const AllocationSite &b) {
                    return a.total_size > b.total_size;
@@ -57,12 +57,14 @@ class HeapProfile {
     uptr total_shown = 0;
     Printf("Live Heap Allocations: %zd bytes in %zd chunks; quarantined: "
            "%zd bytes in %zd chunks; %zd other chunks; total chunks: %zd; "
-           "showing top %zd%%\n",
+           "showing top %zd%% (at most %zd unique contexts)\n",
            total_allocated_user_size_, total_allocated_count_,
            total_quarantined_user_size_, total_quarantined_count_,
            total_other_count_, total_allocated_count_ +
-           total_quarantined_count_ + total_other_count_, top_percent);
-    for (uptr i = 0; i < allocations_.size(); i++) {
+           total_quarantined_count_ + total_other_count_, top_percent,
+           max_number_of_contexts);
+    for (uptr i = 0; i < Min(allocations_.size(), max_number_of_contexts);
+         i++) {
       auto &a = allocations_[i];
       Printf("%zd byte(s) (%zd%%) in %zd allocation(s)\n", a.total_size,
              a.total_size * 100 / total_allocated_user_size_, a.count);
@@ -103,16 +105,23 @@ static void MemoryProfileCB(const Suspen
                             void *argument) {
   HeapProfile hp;
   __lsan::ForEachChunk(ChunkCallback, &hp);
-  hp.Print(reinterpret_cast<uptr>(argument));
+  uptr *Arg = reinterpret_cast<uptr*>(argument);
+  hp.Print(Arg[0], Arg[1]);
 }
 
 }  // namespace __asan
 
+#endif  // CAN_SANITIZE_LEAKS
+
 extern "C" {
 SANITIZER_INTERFACE_ATTRIBUTE
-void __sanitizer_print_memory_profile(uptr top_percent) {
-  __sanitizer::StopTheWorld(__asan::MemoryProfileCB, (void*)top_percent);
+void __sanitizer_print_memory_profile(uptr top_percent,
+                                      uptr max_number_of_contexts) {
+#if CAN_SANITIZE_LEAKS
+  uptr Arg[2];
+  Arg[0] = top_percent;
+  Arg[1] = max_number_of_contexts;
+  __sanitizer::StopTheWorld(__asan::MemoryProfileCB, Arg);
+#endif  // CAN_SANITIZE_LEAKS
 }
 }  // extern "C"
-
-#endif  // CAN_SANITIZE_LEAKS

Modified: projects/clang500-import/contrib/compiler-rt/lib/asan/asan_posix.cc
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/lib/asan/asan_posix.cc	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/lib/asan/asan_posix.cc	Sat Apr 22 18:43:15 2017	(r317285)
@@ -33,19 +33,6 @@
 
 namespace __asan {
 
-const char *DescribeSignalOrException(int signo) {
-  switch (signo) {
-    case SIGFPE:
-      return "FPE";
-    case SIGILL:
-      return "ILL";
-    case SIGABRT:
-      return "ABRT";
-    default:
-      return "SEGV";
-  }
-}
-
 void AsanOnDeadlySignal(int signo, void *siginfo, void *context) {
   ScopedDeadlySignal signal_scope(GetCurrentThread());
   int code = (int)((siginfo_t*)siginfo)->si_code;

Modified: projects/clang500-import/contrib/compiler-rt/lib/asan/asan_report.cc
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/lib/asan/asan_report.cc	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/lib/asan/asan_report.cc	Sat Apr 22 18:43:15 2017	(r317285)
@@ -88,7 +88,8 @@ bool ParseFrameDescription(const char *f
   char *p;
   // This string is created by the compiler and has the following form:
   // "n alloc_1 alloc_2 ... alloc_n"
-  // where alloc_i looks like "offset size len ObjectName".
+  // where alloc_i looks like "offset size len ObjectName"
+  // or                       "offset size len ObjectName:line".
   uptr n_objects = (uptr)internal_simple_strtoll(frame_descr, &p, 10);
   if (n_objects == 0)
     return false;
@@ -101,7 +102,14 @@ bool ParseFrameDescription(const char *f
       return false;
     }
     p++;
-    StackVarDescr var = {beg, size, p, len};
+    char *colon_pos = internal_strchr(p, ':');
+    uptr line = 0;
+    uptr name_len = len;
+    if (colon_pos != nullptr && colon_pos < p + len) {
+      name_len = colon_pos - p;
+      line = (uptr)internal_simple_strtoll(colon_pos + 1, nullptr, 10);
+    }
+    StackVarDescr var = {beg, size, p, name_len, line};
     vars->push_back(var);
     p += len;
   }
@@ -488,9 +496,6 @@ void __sanitizer_ptr_cmp(void *a, void *
 }
 } // extern "C"
 
-#if !SANITIZER_SUPPORTS_WEAK_HOOKS
 // Provide default implementation of __asan_on_error that does nothing
 // and may be overriden by user.
-SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE NOINLINE
-void __asan_on_error() {}
-#endif
+SANITIZER_INTERFACE_WEAK_DEF(void, __asan_on_error, void) {}

Modified: projects/clang500-import/contrib/compiler-rt/lib/asan/asan_report.h
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/lib/asan/asan_report.h	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/lib/asan/asan_report.h	Sat Apr 22 18:43:15 2017	(r317285)
@@ -23,6 +23,7 @@ struct StackVarDescr {
   uptr size;
   const char *name_pos;
   uptr name_len;
+  uptr line;
 };
 
 // Returns the number of globals close to the provided address and copies

Modified: projects/clang500-import/contrib/compiler-rt/lib/asan/asan_suppressions.cc
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/lib/asan/asan_suppressions.cc	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/lib/asan/asan_suppressions.cc	Sat Apr 22 18:43:15 2017	(r317285)
@@ -31,15 +31,9 @@ static const char *kSuppressionTypes[] =
     kInterceptorName, kInterceptorViaFunction, kInterceptorViaLibrary,
     kODRViolation};
 
-extern "C" {
-#if SANITIZER_SUPPORTS_WEAK_HOOKS
-SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
-const char *__asan_default_suppressions();
-#else
-// No week hooks, provide empty implementation.
-const char *__asan_default_suppressions() { return ""; }
-#endif  // SANITIZER_SUPPORTS_WEAK_HOOKS
-}  // extern "C"
+SANITIZER_INTERFACE_WEAK_DEF(const char *, __asan_default_suppressions, void) {
+  return "";
+}
 
 void InitializeSuppressions() {
   CHECK_EQ(nullptr, suppression_ctx);

Modified: projects/clang500-import/contrib/compiler-rt/lib/asan/asan_thread.cc
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/lib/asan/asan_thread.cc	Sat Apr 22 16:02:40 2017	(r317284)
+++ projects/clang500-import/contrib/compiler-rt/lib/asan/asan_thread.cc	Sat Apr 22 18:43:15 2017	(r317285)
@@ -237,9 +237,10 @@ void AsanThread::Init() {
 }
 
 thread_return_t AsanThread::ThreadStart(
-    uptr os_id, atomic_uintptr_t *signal_thread_is_registered) {
+    tid_t os_id, atomic_uintptr_t *signal_thread_is_registered) {
   Init();
-  asanThreadRegistry().StartThread(tid(), os_id, nullptr);
+  asanThreadRegistry().StartThread(tid(), os_id, /*workerthread*/ false,
+                                   nullptr);
   if (signal_thread_is_registered)
     atomic_store(signal_thread_is_registered, 1, memory_order_release);
 
@@ -299,24 +300,27 @@ bool AsanThread::GetStackFrameAccessByAd
     return true;
   }
   uptr aligned_addr = addr & ~(SANITIZER_WORDSIZE/8 - 1);  // align addr.
+  uptr mem_ptr = RoundDownTo(aligned_addr, SHADOW_GRANULARITY);
   u8 *shadow_ptr = (u8*)MemToShadow(aligned_addr);
   u8 *shadow_bottom = (u8*)MemToShadow(bottom);
 
   while (shadow_ptr >= shadow_bottom &&
          *shadow_ptr != kAsanStackLeftRedzoneMagic) {
     shadow_ptr--;
+    mem_ptr -= SHADOW_GRANULARITY;
   }
 
   while (shadow_ptr >= shadow_bottom &&
          *shadow_ptr == kAsanStackLeftRedzoneMagic) {
     shadow_ptr--;
+    mem_ptr -= SHADOW_GRANULARITY;
   }
 
   if (shadow_ptr < shadow_bottom) {
     return false;
   }
 
-  uptr* ptr = (uptr*)SHADOW_TO_MEM((uptr)(shadow_ptr + 1));
+  uptr* ptr = (uptr*)(mem_ptr + SHADOW_GRANULARITY);

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-projects mailing list