<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Wed, Jan 30, 2013 at 5:12 PM, Evgeniy Stepanov <span dir="ltr"><<a href="mailto:eugeni.stepanov@gmail.com" target="_blank">eugeni.stepanov@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: eugenis<br>
Date: Wed Jan 30 07:12:08 2013<br>
New Revision: 173928<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=173928&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=173928&view=rev</a><br>
Log:<br>
[sanitizer] Further split private and public sanitizer headers.<br>
<br>
And make msan_interface.h C-compatible.<br>
<br>
Modified:<br>
    compiler-rt/trunk/include/sanitizer/common_interface_defs.h<br>
    compiler-rt/trunk/include/sanitizer/msan_interface.h<br>
    compiler-rt/trunk/lib/asan/asan_flags.h<br>
    compiler-rt/trunk/lib/interception/interception.h<br>
    compiler-rt/trunk/lib/msan/msan_interface_internal.h<br>
    compiler-rt/trunk/lib/msan/tests/msan_test.cc<br>
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_internal_defs.h<br>
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.h<br>
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_stackdepot.h<br>
    compiler-rt/trunk/lib/tsan/rtl/tsan_interface.h<br>
    compiler-rt/trunk/lib/tsan/rtl/tsan_interface_ann.h<br>
<br>
Modified: compiler-rt/trunk/include/sanitizer/common_interface_defs.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/include/sanitizer/common_interface_defs.h?rev=173928&r1=173927&r2=173928&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/include/sanitizer/common_interface_defs.h?rev=173928&r1=173927&r2=173928&view=diff</a><br>

==============================================================================<br>
--- compiler-rt/trunk/include/sanitizer/common_interface_defs.h (original)<br>
+++ compiler-rt/trunk/include/sanitizer/common_interface_defs.h Wed Jan 30 07:12:08 2013<br>
@@ -7,86 +7,32 @@<br>
 //<br>
 //===----------------------------------------------------------------------===//<br>
 //<br>
-// This file is shared between AddressSanitizer and ThreadSanitizer.<br>
-// It contains basic macro and types.<br>
-// NOTE: This file may be included into user code.<br>
+// Common part of the public sanitizer interface.<br>
 //===----------------------------------------------------------------------===//<br>
<br>
 #ifndef SANITIZER_COMMON_INTERFACE_DEFS_H<br>
 #define SANITIZER_COMMON_INTERFACE_DEFS_H<br>
<br>
-// ----------- ATTENTION -------------<br>
-// This header should NOT include any other headers to avoid portability issues.<br>
-<br>
-#if defined(_WIN32)<br>
-// FIXME find out what we need on Windows. __declspec(dllexport) ?<br>
-# define SANITIZER_INTERFACE_ATTRIBUTE<br>
-# define SANITIZER_WEAK_ATTRIBUTE<br>
-#elif defined(SANITIZER_GO)<br>
-# define SANITIZER_INTERFACE_ATTRIBUTE<br>
-# define SANITIZER_WEAK_ATTRIBUTE<br>
-#else<br>
-# define SANITIZER_INTERFACE_ATTRIBUTE __attribute__((visibility("default")))<br>
-# define SANITIZER_WEAK_ATTRIBUTE  __attribute__((weak))<br>
-#endif<br>
-<br>
-#ifdef __linux__<br>
-# define SANITIZER_SUPPORTS_WEAK_HOOKS 1<br>
-#else<br>
-# define SANITIZER_SUPPORTS_WEAK_HOOKS 0<br>
-#endif<br>
-<br>
-// __has_feature<br>
-#if !defined(__has_feature)<br>
-# define __has_feature(x) 0<br>
-#endif<br>
-<br>
-// For portability reasons we do not include stddef.h, stdint.h or any other<br>
-// system header, but we do need some basic types that are not defined<br>
-// in a portable way by the language itself.<br>
-namespace __sanitizer {<br>
-<br>
-#if defined(_WIN64)<br>
-// 64-bit Windows uses LLP64 data model.<br>
-typedef unsigned long long uptr;  // NOLINT<br>
-typedef signed   long long sptr;  // NOLINT<br>
-#else<br>
-typedef unsigned long uptr;  // NOLINT<br>
-typedef signed   long sptr;  // NOLINT<br>
-#endif  // defined(_WIN64)<br>
-#if defined(__x86_64__)<br>
-// Since x32 uses ILP32 data model in 64-bit hardware mode,  we must use<br>
-// 64-bit pointer to unwind stack frame.<br>
-typedef unsigned long long uhwptr;  // NOLINT<br>
-#else<br>
-typedef uptr uhwptr;   // NOLINT<br>
-#endif<br>
-typedef unsigned char u8;<br>
-typedef unsigned short u16;  // NOLINT<br>
-typedef unsigned int u32;<br>
-typedef unsigned long long u64;  // NOLINT<br>
-typedef signed   char s8;<br>
-typedef signed   short s16;  // NOLINT<br>
-typedef signed   int s32;<br>
-typedef signed   long long s64;  // NOLINT<br>
-<br>
-}  // namespace __sanitizer<br>
+#include <stddef.h><br>
+#include <stdint.h><br>
<br>
+#ifdef __cplusplus<br>
 extern "C" {<br>
+#endif<br>
   // Tell the tools to write their reports to "path.<pid>" instead of stderr.<br>
-  void __sanitizer_set_report_path(const char *path)<br>
-      SANITIZER_INTERFACE_ATTRIBUTE;<br>
+  void __sanitizer_set_report_path(const char *path);<br>
<br>
   // Tell the tools to write their reports to given file descriptor instead of<br>
   // stderr.<br>
-  void __sanitizer_set_report_fd(int fd)<br>
-      SANITIZER_INTERFACE_ATTRIBUTE;<br>
+  void __sanitizer_set_report_fd(int fd);<br>
<br>
   // Notify the tools that the sandbox is going to be turned on. The reserved<br>
   // parameter will be used in the future to hold a structure with functions<br>
   // that the tools may call to bypass the sandbox.<br>
-  void __sanitizer_sandbox_on_notify(void *reserved)<br>
-      SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE;<br>
+  void __sanitizer_sandbox_on_notify(void *reserved);<br>
+<br>
+#ifdef __cplusplus<br>
 }  // extern "C"<br>
+#endif<br>
<br>
 #endif  // SANITIZER_COMMON_INTERFACE_DEFS_H<br>
<br>
Modified: compiler-rt/trunk/include/sanitizer/msan_interface.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/include/sanitizer/msan_interface.h?rev=173928&r1=173927&r2=173928&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/include/sanitizer/msan_interface.h?rev=173928&r1=173927&r2=173928&view=diff</a><br>

==============================================================================<br>
--- compiler-rt/trunk/include/sanitizer/msan_interface.h (original)<br>
+++ compiler-rt/trunk/include/sanitizer/msan_interface.h Wed Jan 30 07:12:08 2013<br>
@@ -16,10 +16,6 @@<br>
<br>
 #include <sanitizer/common_interface_defs.h><br>
<br>
-using __sanitizer::uptr;<br>
-using __sanitizer::sptr;<br>
-using __sanitizer::u32;<br>
-<br>
 #ifdef __cplusplus<br>
 extern "C" {<br>
 #endif<br>
@@ -27,47 +23,37 @@ extern "C" {<br>
 #if __has_feature(memory_sanitizer)<br>
   /* Returns a string describing a stack origin.<br>
      Return NULL if the origin is invalid, or is not a stack origin. */<br>
-  SANITIZER_INTERFACE_ATTRIBUTE<br>
-  const char *__msan_get_origin_descr_if_stack(u32 id);<br>
+  const char *__msan_get_origin_descr_if_stack(uint32_t id);<br>
<br>
<br>
   /* Set raw origin for the memory range. */<br>
-  SANITIZER_INTERFACE_ATTRIBUTE<br>
-  void __msan_set_origin(void *a, uptr size, u32 origin);<br>
+  void __msan_set_origin(void *a, size_t size, uint32_t origin);<br>
<br>
   /* Get raw origin for an address. */<br>
-  SANITIZER_INTERFACE_ATTRIBUTE<br>
-  u32 __msan_get_origin(void *a);<br>
+  uint32_t __msan_get_origin(void *a);<br>
<br>
   /* Returns non-zero if tracking origins. */<br>
-  SANITIZER_INTERFACE_ATTRIBUTE<br>
   int __msan_get_track_origins();<br>
<br>
   /* Returns the origin id of the latest UMR in the calling thread. */<br>
-  SANITIZER_INTERFACE_ATTRIBUTE<br>
-  u32 __msan_get_umr_origin();<br>
+  uint32_t __msan_get_umr_origin();<br>
<br>
   /* Make memory region fully initialized (without changing its contents). */<br>
-  SANITIZER_INTERFACE_ATTRIBUTE<br>
-  void __msan_unpoison(void *a, uptr size);<br>
+  void __msan_unpoison(void *a, size_t size);<br>
<br>
   /* Make memory region fully uninitialized (without changing its contents). */<br>
-  SANITIZER_INTERFACE_ATTRIBUTE<br>
-  void __msan_poison(void *a, uptr size);<br>
+  void __msan_poison(void *a, size_t size);<br>
<br>
   /* Make memory region partially uninitialized (without changing its contents).<br>
    */<br>
-  SANITIZER_INTERFACE_ATTRIBUTE<br>
-  void __msan_partial_poison(void* data, void* shadow, uptr size);<br>
+  void __msan_partial_poison(void* data, void* shadow, size_t size);<br>
<br>
   /* Returns the offset of the first (at least partially) poisoned byte in the<br>
      memory range, or -1 if the whole range is good. */<br>
-  SANITIZER_INTERFACE_ATTRIBUTE<br>
-  sptr __msan_test_shadow(const void *x, uptr size);<br>
+  intptr_t __msan_test_shadow(const void *x, size_t size);<br>
<br>
   /* Set exit code when error(s) were detected.<br>
      Value of 0 means don't change the program exit code. */<br>
-  SANITIZER_INTERFACE_ATTRIBUTE<br>
   void __msan_set_exit_code(int exit_code);<br>
<br>
   /* For testing:<br>
@@ -75,42 +61,37 @@ extern "C" {<br>
      ... some buggy code ...<br>
      __msan_set_expect_umr(0);<br>
      The last line will verify that a UMR happened. */<br>
-  SANITIZER_INTERFACE_ATTRIBUTE<br>
   void __msan_set_expect_umr(int expect_umr);<br>
<br>
   /* Print shadow and origin for the memory range to stdout in a human-readable<br>
      format. */<br>
-  SANITIZER_INTERFACE_ATTRIBUTE<br>
-  void __msan_print_shadow(const void *x, uptr size);<br>
+  void __msan_print_shadow(const void *x, size_t size);<br>
<br>
   /* Print current function arguments shadow and origin to stdout in a<br>
      human-readable format. */<br>
-  SANITIZER_INTERFACE_ATTRIBUTE<br>
   void __msan_print_param_shadow();<br>
<br>
   /* Returns true if running under a dynamic tool (DynamoRio-based). */<br>
-  SANITIZER_INTERFACE_ATTRIBUTE<br>
   int  __msan_has_dynamic_component();<br>
<br>
   /* Tell MSan about newly allocated memory (ex.: custom allocator).<br>
      Memory will be marked uninitialized, with origin at the call site. */<br>
-  SANITIZER_INTERFACE_ATTRIBUTE<br>
-  void __msan_allocated_memory(void* data, uptr size);<br>
+  void __msan_allocated_memory(void* data, size_t size);<br>
<br>
 #else  // __has_feature(memory_sanitizer)<br>
<br>
-#define __msan_get_origin_descr_if_stack(u32 id) ((const char*)0)<br>
-#define __msan_set_origin(void *a, uptr size, u32 origin)<br>
-#define __msan_get_origin(void *a) ((u32)-1)<br>
+#define __msan_get_origin_descr_if_stack(id) ((const char*)0)<br>
+#define __msan_set_origin(a, size, origin)<br>
+#define __msan_get_origin(a) ((uint32_t)-1)<br>
 #define __msan_get_track_origins() (0)<br>
-#define __msan_get_umr_origin() ((u32)-1)<br>
-#define __msan_unpoison(void *a, uptr size)<br>
-#define __msan_poison(void *a, uptr size)<br>
-#define __msan_partial_poison(void* data, void* shadow, uptr size)<br>
-#define __msan_test_shadow(const void *x, uptr size) ((sptr)-1)<br>
-#define __msan_set_exit_code(int exit_code)<br>
-#define __msan_set_expect_umr(int expect_umr)<br>
-#define __msan_print_shadow(const void *x, uptr size)<br>
+#define __msan_get_umr_origin() ((uint32_t)-1)<br>
+#define __msan_unpoison(a, size)<br>
+#define __msan_poison(a, size)<br>
+#define __msan_partial_poison(data, shadow, size)<br>
+#define __msan_test_shadow(x, size) ((intptr_t)-1)<br>
+#define __msan_set_exit_code(exit_code)<br>
+#define __msan_set_expect_umr(expect_umr)<br>
+#define __msan_print_shadow(x, size)<br>
 #define __msan_print_param_shadow()<br>
 #define __msan_has_dynamic_component() (0)<br>
 #define __msan_allocated_memory(data, size)<br>
<br>
Modified: compiler-rt/trunk/lib/asan/asan_flags.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_flags.h?rev=173928&r1=173927&r2=173928&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_flags.h?rev=173928&r1=173927&r2=173928&view=diff</a><br>

==============================================================================<br>
--- compiler-rt/trunk/lib/asan/asan_flags.h (original)<br>
+++ compiler-rt/trunk/lib/asan/asan_flags.h Wed Jan 30 07:12:08 2013<br>
@@ -15,7 +15,7 @@<br>
 #ifndef ASAN_FLAGS_H<br>
 #define ASAN_FLAGS_H<br>
<br>
-#include "sanitizer/common_interface_defs.h"<br>
+#include "sanitizer_common/sanitizer_internal_defs.h"<br>
<br>
 // ASan flag values can be defined in three ways:<br>
 // 1) initialized with default values at startup.<br>
<br>
Modified: compiler-rt/trunk/lib/interception/interception.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/interception/interception.h?rev=173928&r1=173927&r2=173928&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/interception/interception.h?rev=173928&r1=173927&r2=173928&view=diff</a><br>

==============================================================================<br>
--- compiler-rt/trunk/lib/interception/interception.h (original)<br>
+++ compiler-rt/trunk/lib/interception/interception.h Wed Jan 30 07:12:08 2013<br>
@@ -19,7 +19,7 @@<br>
 # error "Interception doesn't work on this operating system."<br>
 #endif<br>
<br>
-#include "sanitizer/common_interface_defs.h"<br>
+#include "../sanitizer_common/sanitizer_internal_defs.h"<br></blockquote><div><br></div><div style>Can we set include directories instead of "#include "../" ?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
 // These typedefs should be used only in the interceptor definitions to replace<br>
 // the standard system types (e.g. SSIZE_T instead of ssize_t)<br>
<br>
Modified: compiler-rt/trunk/lib/msan/msan_interface_internal.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_interface_internal.h?rev=173928&r1=173927&r2=173928&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_interface_internal.h?rev=173928&r1=173927&r2=173928&view=diff</a><br>

==============================================================================<br>
--- compiler-rt/trunk/lib/msan/msan_interface_internal.h (original)<br>
+++ compiler-rt/trunk/lib/msan/msan_interface_internal.h Wed Jan 30 07:12:08 2013<br>
@@ -15,7 +15,7 @@<br>
 #ifndef MSAN_INTERFACE_INTERNAL_H<br>
 #define MSAN_INTERFACE_INTERNAL_H<br>
<br>
-#include <sanitizer/common_interface_defs.h><br>
+#include "sanitizer_common/sanitizer_internal_defs.h"<br>
<br>
 extern "C" {<br>
 // FIXME: document all interface functions.<br>
<br>
Modified: compiler-rt/trunk/lib/msan/tests/msan_test.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/tests/msan_test.cc?rev=173928&r1=173927&r2=173928&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/tests/msan_test.cc?rev=173928&r1=173927&r2=173928&view=diff</a><br>

==============================================================================<br>
--- compiler-rt/trunk/lib/msan/tests/msan_test.cc (original)<br>
+++ compiler-rt/trunk/lib/msan/tests/msan_test.cc Wed Jan 30 07:12:08 2013<br>
@@ -56,7 +56,7 @@ typedef   signed long long S8;  // NOLIN<br>
 static bool TrackingOrigins() {<br>
   S8 x;<br>
   __msan_set_origin(&x, sizeof(x), 0x1234);<br>
-  u32 origin = __msan_get_origin(&x);<br>
+  U4 origin = __msan_get_origin(&x);<br>
   __msan_set_origin(&x, sizeof(x), 0);<br>
   return origin == 0x1234;<br>
 }<br>
@@ -82,7 +82,7 @@ static bool TrackingOrigins() {<br>
       __msan_set_expect_umr(1);                     \<br>
       action;                                       \<br>
       __msan_set_expect_umr(0);                     \<br>
-      u32 id = __msan_get_umr_origin();             \<br>
+      U4 id = __msan_get_umr_origin();             \<br>
       const char *str = __msan_get_origin_descr_if_stack(id); \<br>
       if (!str || strcmp(str, stack_origin)) {      \<br>
         fprintf(stderr, "EXPECT_POISONED_S: id=%u %s, %s", \<br>
@@ -114,7 +114,7 @@ void ExpectPoisonedWithOrigin(const T& t<br>
 template<typename T><br>
 void ExpectPoisonedWithStackOrigin(const T& t, const char *stack_origin) {<br>
   EXPECT_NE(-1, __msan_test_shadow((void*)&t, sizeof(t)));<br>
-  u32 id = __msan_get_origin((void*)&t);<br>
+  U4 id = __msan_get_origin((void*)&t);<br>
   const char *str = __msan_get_origin_descr_if_stack(id);<br>
   if (!str || strcmp(str, stack_origin)) {<br>
     fprintf(stderr, "EXPECT_POISONED_S: id=%u %s, %s",<br>
@@ -140,7 +140,7 @@ T *GetPoisoned(int i = 0, T val = 0) {<br>
 }<br>
<br>
 template<class T><br>
-T *GetPoisonedO(int i, u32 origin, T val = 0) {<br>
+T *GetPoisonedO(int i, U4 origin, T val = 0) {<br>
   T *res = (T*)&poisoned_array[i];<br>
   *res = val;<br>
   __msan_poison(&poisoned_array[i], sizeof(T));<br>
@@ -853,11 +853,11 @@ TEST(MemorySanitizer, ptrtoint) {<br>
   // Test that shadow is propagated through pointer-to-integer conversion.<br>
   void* p = (void*)0xABCD;<br>
   __msan_poison(((char*)&p) + 1, sizeof(p));<br>
-  EXPECT_NOT_POISONED((((uptr)p) & 0xFF) == 0);<br>
+  EXPECT_NOT_POISONED((((uintptr_t)p) & 0xFF) == 0);<br>
<br>
   void* q = (void*)0xABCD;<br>
   __msan_poison(&q, sizeof(q) - 1);<br>
-  EXPECT_POISONED((((uptr)q) & 0xFF) == 0);<br>
+  EXPECT_POISONED((((uintptr_t)q) & 0xFF) == 0);<br>
 }<br>
<br>
 static void vaargsfn2(int guard, ...) {<br>
@@ -1490,7 +1490,7 @@ TEST(MemorySanitizerOrigins, DISABLED_In<br>
   if (!TrackingOrigins()) return;<br>
<br>
   S s;<br>
-  u32 origin = rand();  // NOLINT<br>
+  U4 origin = rand();  // NOLINT<br>
   s.a = *GetPoisonedO<U2>(0, origin);<br>
   EXPECT_EQ(origin, __msan_get_origin(&s.a));<br>
   EXPECT_EQ(origin, __msan_get_origin(&s.b));<br>
@@ -1504,14 +1504,14 @@ TEST(MemorySanitizerOrigins, DISABLED_In<br>
 template<class T, class BinaryOp><br>
 INLINE<br>
 void BinaryOpOriginTest(BinaryOp op) {<br>
-  u32 ox = rand();  //NOLINT<br>
-  u32 oy = rand();  //NOLINT<br>
+  U4 ox = rand();  //NOLINT<br>
+  U4 oy = rand();  //NOLINT<br>
   T *x = GetPoisonedO<T>(0, ox, 0);<br>
   T *y = GetPoisonedO<T>(1, oy, 0);<br>
   T *z = GetPoisonedO<T>(2, 0, 0);<br>
<br>
   *z = op(*x, *y);<br>
-  u32 origin = __msan_get_origin(z);<br>
+  U4 origin = __msan_get_origin(z);<br>
   EXPECT_POISONED_O(*z, origin);<br>
   EXPECT_EQ(true, origin == ox || origin == oy);<br>
<br>
@@ -1675,7 +1675,7 @@ TEST(MemorySanitizerOrigins, DISABLED_Al<br>
   EXPECT_DEATH(AllocaTO(), "ORIGIN: stack allocation: ar@AllocaTO");<br>
 }<br>
<br>
-NOINLINE int RetvalOriginTest(u32 origin) {<br>
+NOINLINE int RetvalOriginTest(U4 origin) {<br>
   int *a = new int;<br>
   break_optimization(a);<br>
   __msan_set_origin(a, sizeof(*a), origin);<br>
@@ -<a href="tel:1689" value="+491689">1689</a>,14 +1689,14 @@ TEST(MemorySanitizerOrigins, Retval) {<br>
   EXPECT_POISONED_O(RetvalOriginTest(__LINE__), __LINE__);<br>
 }<br>
<br>
-NOINLINE void ParamOriginTest(int param, u32 origin) {<br>
+NOINLINE void ParamOriginTest(int param, U4 origin) {<br>
   EXPECT_POISONED_O(param, origin);<br>
 }<br>
<br>
 TEST(MemorySanitizerOrigins, Param) {<br>
   if (!TrackingOrigins()) return;<br>
   int *a = new int;<br>
-  u32 origin = __LINE__;<br>
+  U4 origin = __LINE__;<br>
   break_optimization(a);<br>
   __msan_set_origin(a, sizeof(*a), origin);<br>
   ParamOriginTest(*a, origin);<br>
@@ -1714,14 +1714,14 @@ TEST(MemorySanitizerOrigins, strlen) {<br>
   break_optimization(&alignment);<br>
   char x[4] = {'a', 'b', 0, 0};<br>
   __msan_poison(&x[2], 1);<br>
-  u32 origin = __LINE__;<br>
+  U4 origin = __LINE__;<br>
   __msan_set_origin(x, sizeof(x), origin);<br>
   EXPECT_UMR_O(volatile unsigned y = strlen(x), origin);<br>
 }<br>
<br>
 TEST(MemorySanitizerOrigins, wcslen) {<br>
   wchar_t w[3] = {'a', 'b', 0};<br>
-  u32 origin = __LINE__;<br>
+  U4 origin = __LINE__;<br>
   __msan_set_origin(w, sizeof(w), origin);<br>
   __msan_poison(&w[2], sizeof(wchar_t));<br>
   EXPECT_UMR_O(volatile unsigned y = wcslen(w), origin);<br>
@@ -1730,7 +1730,7 @@ TEST(MemorySanitizerOrigins, wcslen) {<br>
 #if MSAN_HAS_M128<br>
 TEST(MemorySanitizerOrigins, StoreIntrinsic) {<br>
   __m128 x, y;<br>
-  u32 origin = __LINE__;<br>
+  U4 origin = __LINE__;<br>
   __msan_set_origin(&x, sizeof(x), origin);<br>
   __msan_poison(&x, sizeof(x));<br>
   __builtin_ia32_storeups((float*)&y, x);<br>
<br>
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_internal_defs.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_internal_defs.h?rev=173928&r1=173927&r2=173928&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_internal_defs.h?rev=173928&r1=173927&r2=173928&view=diff</a><br>

==============================================================================<br>
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_internal_defs.h (original)<br>
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_internal_defs.h Wed Jan 30 07:12:08 2013<br>
@@ -13,7 +13,78 @@<br>
 #ifndef SANITIZER_DEFS_H<br>
 #define SANITIZER_DEFS_H<br>
<br>
-#include "sanitizer/common_interface_defs.h"<br>
+#if defined(_WIN32)<br>
+// FIXME find out what we need on Windows. __declspec(dllexport) ?<br>
+# define SANITIZER_INTERFACE_ATTRIBUTE<br>
+# define SANITIZER_WEAK_ATTRIBUTE<br>
+#elif defined(SANITIZER_GO)<br>
+# define SANITIZER_INTERFACE_ATTRIBUTE<br>
+# define SANITIZER_WEAK_ATTRIBUTE<br>
+#else<br>
+# define SANITIZER_INTERFACE_ATTRIBUTE __attribute__((visibility("default")))<br>
+# define SANITIZER_WEAK_ATTRIBUTE  __attribute__((weak))<br>
+#endif<br>
+<br>
+#ifdef __linux__<br>
+# define SANITIZER_SUPPORTS_WEAK_HOOKS 1<br>
+#else<br>
+# define SANITIZER_SUPPORTS_WEAK_HOOKS 0<br>
+#endif<br>
+<br>
+// __has_feature<br>
+#if !defined(__has_feature)<br>
+# define __has_feature(x) 0<br>
+#endif<br>
+<br>
+// For portability reasons we do not include stddef.h, stdint.h or any other<br>
+// system header, but we do need some basic types that are not defined<br>
+// in a portable way by the language itself.<br>
+namespace __sanitizer {<br>
+<br>
+#if defined(_WIN64)<br>
+// 64-bit Windows uses LLP64 data model.<br>
+typedef unsigned long long uptr;  // NOLINT<br>
+typedef signed   long long sptr;  // NOLINT<br>
+#else<br>
+typedef unsigned long uptr;  // NOLINT<br>
+typedef signed   long sptr;  // NOLINT<br>
+#endif  // defined(_WIN64)<br>
+#if defined(__x86_64__)<br>
+// Since x32 uses ILP32 data model in 64-bit hardware mode,  we must use<br>
+// 64-bit pointer to unwind stack frame.<br>
+typedef unsigned long long uhwptr;  // NOLINT<br>
+#else<br>
+typedef uptr uhwptr;   // NOLINT<br>
+#endif<br>
+typedef unsigned char u8;<br>
+typedef unsigned short u16;  // NOLINT<br>
+typedef unsigned int u32;<br>
+typedef unsigned long long u64;  // NOLINT<br>
+typedef signed   char s8;<br>
+typedef signed   short s16;  // NOLINT<br>
+typedef signed   int s32;<br>
+typedef signed   long long s64;  // NOLINT<br>
+<br>
+}  // namespace __sanitizer<br>
+<br>
+extern "C" {<br>
+  // Tell the tools to write their reports to "path.<pid>" instead of stderr.<br>
+  void __sanitizer_set_report_path(const char *path)<br>
+      SANITIZER_INTERFACE_ATTRIBUTE;<br>
+<br>
+  // Tell the tools to write their reports to given file descriptor instead of<br>
+  // stderr.<br>
+  void __sanitizer_set_report_fd(int fd)<br>
+      SANITIZER_INTERFACE_ATTRIBUTE;<br>
+<br>
+  // Notify the tools that the sandbox is going to be turned on. The reserved<br>
+  // parameter will be used in the future to hold a structure with functions<br>
+  // that the tools may call to bypass the sandbox.<br>
+  void __sanitizer_sandbox_on_notify(void *reserved)<br>
+      SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE;<br>
+}  // extern "C"<br>
+<br>
+<br>
 using namespace __sanitizer;  // NOLINT<br>
 // ----------- ATTENTION -------------<br>
 // This header should NOT include any other headers to avoid portability issues.<br>
<br>
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.h?rev=173928&r1=173927&r2=173928&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.h?rev=173928&r1=173927&r2=173928&view=diff</a><br>

==============================================================================<br>
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.h (original)<br>
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.h Wed Jan 30 07:12:08 2013<br>
@@ -11,14 +11,13 @@<br>
 // run-time libraries.<br>
 // These tools can not use some of the libc functions directly because those<br>
 // functions are intercepted. Instead, we implement a tiny subset of libc here.<br>
-// NOTE: This file may be included into user code.<br>
 //===----------------------------------------------------------------------===//<br>
 #ifndef SANITIZER_LIBC_H<br>
 #define SANITIZER_LIBC_H<br>
<br>
 // ----------- ATTENTION -------------<br>
 // This header should NOT include any other headers from sanitizer runtime.<br>
-#include "sanitizer/common_interface_defs.h"<br>
+#include "sanitizer_internal_defs.h"<br>
<br>
 namespace __sanitizer {<br>
<br>
<br>
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_stackdepot.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_stackdepot.h?rev=173928&r1=173927&r2=173928&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_stackdepot.h?rev=173928&r1=173927&r2=173928&view=diff</a><br>

==============================================================================<br>
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_stackdepot.h (original)<br>
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_stackdepot.h Wed Jan 30 07:12:08 2013<br>
@@ -13,7 +13,7 @@<br>
 #ifndef SANITIZER_STACKDEPOT_H<br>
 #define SANITIZER_STACKDEPOT_H<br>
<br>
-#include "sanitizer/common_interface_defs.h"<br>
+#include "sanitizer_internal_defs.h"<br>
<br>
 namespace __sanitizer {<br>
<br>
<br>
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interface.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interface.h?rev=173928&r1=173927&r2=173928&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interface.h?rev=173928&r1=173927&r2=173928&view=diff</a><br>

==============================================================================<br>
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interface.h (original)<br>
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interface.h Wed Jan 30 07:12:08 2013<br>
@@ -16,7 +16,7 @@<br>
 #ifndef TSAN_INTERFACE_H<br>
 #define TSAN_INTERFACE_H<br>
<br>
-#include <sanitizer/common_interface_defs.h><br>
+#include <sanitizer_common/sanitizer_internal_defs.h><br>
<br>
 // This header should NOT include any other headers.<br>
 // All functions in this header are extern "C" and start with __tsan_.<br>
<br>
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interface_ann.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interface_ann.h?rev=173928&r1=173927&r2=173928&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interface_ann.h?rev=173928&r1=173927&r2=173928&view=diff</a><br>

==============================================================================<br>
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interface_ann.h (original)<br>
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interface_ann.h Wed Jan 30 07:12:08 2013<br>
@@ -14,7 +14,7 @@<br>
 #ifndef TSAN_INTERFACE_ANN_H<br>
 #define TSAN_INTERFACE_ANN_H<br>
<br>
-#include <sanitizer/common_interface_defs.h><br>
+#include <sanitizer_common/sanitizer_internal_defs.h><br>
<br>
 // This header should NOT include any other headers.<br>
 // All functions in this header are extern "C" and start with __tsan_.<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</div></div>