summaryrefslogtreecommitdiff
path: root/lib/esan
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2016-09-15 21:02:18 +0000
committerAnna Zaks <ganna@apple.com>2016-09-15 21:02:18 +0000
commit074767b13f398443ad9fb441120f897997966750 (patch)
tree100678ed86288211a44ecc6b53b743c5046e719c /lib/esan
parentb5baf5bbfbd0552b2942a7d6494a4eda9eee1854 (diff)
[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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281657 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/esan')
-rw-r--r--lib/esan/esan_flags.cpp2
-rw-r--r--lib/esan/esan_interface_internal.h3
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/esan/esan_flags.cpp b/lib/esan/esan_flags.cpp
index 3b047e28b..c90bf2493 100644
--- a/lib/esan/esan_flags.cpp
+++ b/lib/esan/esan_flags.cpp
@@ -17,6 +17,8 @@
#include "sanitizer_common/sanitizer_flag_parser.h"
#include "sanitizer_common/sanitizer_flags.h"
+using namespace __sanitizer;
+
namespace __esan {
static const char EsanOptsEnv[] = "ESAN_OPTIONS";
diff --git a/lib/esan/esan_interface_internal.h b/lib/esan/esan_interface_internal.h
index 3b915d03e..df51aa609 100644
--- a/lib/esan/esan_interface_internal.h
+++ b/lib/esan/esan_interface_internal.h
@@ -21,6 +21,9 @@
// This header should NOT include any other headers.
// All functions in this header are extern "C" and start with __esan_.
+using __sanitizer::uptr;
+using __sanitizer::u32;
+
extern "C" {
// This should be kept consistent with LLVM's EfficiencySanitizerOptions.