[compiler-rt] Do not introduce __sanitizer namespace globally
authorAnna Zaks <ganna@apple.com>
Thu, 15 Sep 2016 21:02:18 +0000 (21:02 +0000)
committerAnna Zaks <ganna@apple.com>
Thu, 15 Sep 2016 21:02:18 +0000 (21:02 +0000)
commit691644f3ca6e7b0cd3acc0cf8ddde0e200bec2ae
tree1a0866389a84d9c65ebb5fb91501650911e317ec
parent592bc4553306b250efe82ad37a0824addc1bf4ba
[compiler-rt] Do not introduce __sanitizer namespace globally

The definitions in sanitizer_common may conflict with definitions from system headers because:

The runtime includes the system headers after the project headers (as per LLVM coding guidelines).
lib/sanitizer_common/sanitizer_internal_defs.h pollutes the namespace of everything defined after it, which is all/most of the sanitizer .h and .cc files and the included system headers with: using namespace __sanitizer; // NOLINT
This patch solves the problem by introducing the namespace only within the sanitizer namespaces as proposed by Dmitry.

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

llvm-svn: 281657
27 files changed:
compiler-rt/lib/asan/asan_interface_internal.h
compiler-rt/lib/asan/tests/asan_noinst_test.cc
compiler-rt/lib/cfi/cfi.cc
compiler-rt/lib/dfsan/dfsan.h
compiler-rt/lib/dfsan/dfsan_interceptors.cc
compiler-rt/lib/esan/esan_flags.cpp
compiler-rt/lib/esan/esan_interface_internal.h
compiler-rt/lib/interception/interception.h
compiler-rt/lib/msan/msan_interface_internal.h
compiler-rt/lib/safestack/safestack.cc
compiler-rt/lib/sanitizer_common/sanitizer_allocator_internal.h
compiler-rt/lib/sanitizer_common/sanitizer_common.h
compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cc
compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
compiler-rt/lib/sanitizer_common/sanitizer_mac.h
compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_linux.cc
compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc
compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cc
compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cc
compiler-rt/lib/sanitizer_common/tests/sanitizer_nolibc_test_main.cc
compiler-rt/lib/sanitizer_common/tests/sanitizer_test_main.cc
compiler-rt/lib/tsan/rtl/tsan_interface.h
compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cc
compiler-rt/lib/xray/xray_init.cc