[llvm-commits] [compiler-rt] r162822 - in /compiler-rt/trunk: ./ include/ include/sanitizer/ lib/asan/ lib/asan/lit_tests/ lib/asan/output_tests/ lib/asan/tests/ lib/sanitizer_common/ make/

Kostya Serebryany kcc at google.com
Wed Aug 29 01:02:26 PDT 2012


Thanks Chandler!
This may cause us some minor headache (e.g. the Makefile.old is now
broken), but overall the change is useful.

--kcc

On Wed, Aug 29, 2012 at 6:27 AM, Chandler Carruth <chandlerc at gmail.com>wrote:

> Author: chandlerc
> Date: Tue Aug 28 21:27:54 2012
> New Revision: 162822
>
> URL: http://llvm.org/viewvc/llvm-project?rev=162822&view=rev
> Log:
> Relocate the external headers provided by ASan and the common sanitizer
> library.
>
> These headers are intended to be available to user code when built with
> AddressSanitizer (or one of the other sanitizer's in the future) to
> interface with the runtime library. As such, they form stable external
> C interfaces, and the headers shouldn't be located within the
> implementation.
>
> I've pulled them out into what seem like fairly obvious locations and
> names, but I'm wide open to further bikeshedding of these names and
> locations.
>
> I've updated the code and the build system to cope with the new
> locations, both CMake and Makefile. Please let me know if this breaks
> anyone's build.
>
> The eventual goal is to install these headers along side the Clang
> builtin headers when we build the ASan runtime and install it. My
> current thinking is to locate them at:
>
>   <prefix>/lib/clang/X.Y/include/sanitizer/common_interface_defs.h
>   <prefix>/lib/clang/X.Y/include/sanitizer/asan_interface.h
>   <prefix>/lib/clang/X.Y/include/sanitizer/...
>
> But maybe others have different suggestions?
>
> Fixing the style of the #include between these headers at least unblocks
> experimentation with installing them as they now should work when
> installed in these locations.
>
> Added:
>     compiler-rt/trunk/include/
>     compiler-rt/trunk/include/sanitizer/
>     compiler-rt/trunk/include/sanitizer/asan_interface.h
>       - copied, changed from r162809,
> compiler-rt/trunk/lib/asan/asan_interface.h
>     compiler-rt/trunk/include/sanitizer/common_interface_defs.h
>       - copied, changed from r162809,
> compiler-rt/trunk/lib/sanitizer_common/sanitizer_interface_defs.h
> Removed:
>     compiler-rt/trunk/lib/asan/asan_interface.h
>     compiler-rt/trunk/lib/sanitizer_common/sanitizer_interface_defs.h
> Modified:
>     compiler-rt/trunk/CMakeLists.txt
>     compiler-rt/trunk/lib/asan/asan_allocator.cc
>     compiler-rt/trunk/lib/asan/asan_flags.h
>     compiler-rt/trunk/lib/asan/asan_globals.cc
>     compiler-rt/trunk/lib/asan/asan_interceptors.cc
>     compiler-rt/trunk/lib/asan/asan_poisoning.cc
>     compiler-rt/trunk/lib/asan/asan_report.h
>     compiler-rt/trunk/lib/asan/asan_rtl.cc
>     compiler-rt/trunk/lib/asan/asan_stack.cc
>     compiler-rt/trunk/lib/asan/asan_stats.cc
>     compiler-rt/trunk/lib/asan/lit_tests/interface_symbols.c
>     compiler-rt/trunk/lib/asan/output_tests/test_output.sh
>     compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc
>     compiler-rt/trunk/lib/sanitizer_common/sanitizer_internal_defs.h
>     compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.h
>     compiler-rt/trunk/make/config.mk
>
> Modified: compiler-rt/trunk/CMakeLists.txt
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=162822&r1=162821&r2=162822&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/CMakeLists.txt (original)
> +++ compiler-rt/trunk/CMakeLists.txt Tue Aug 28 21:27:54 2012
> @@ -100,6 +100,9 @@
>    set_property(TARGET ${target} PROPERTY COMPILE_FLAGS "${argstring}")
>  endfunction()
>
> +# Add the public header's directory to the includes for all of
> compiler-rt.
> +include_directories(include)
> +
>  add_subdirectory(lib)
>
>  if(LLVM_INCLUDE_TESTS)
>
> Copied: compiler-rt/trunk/include/sanitizer/asan_interface.h (from
> r162809, compiler-rt/trunk/lib/asan/asan_interface.h)
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/include/sanitizer/asan_interface.h?p2=compiler-rt/trunk/include/sanitizer/asan_interface.h&p1=compiler-rt/trunk/lib/asan/asan_interface.h&r1=162809&r2=162822&rev=162822&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/asan/asan_interface.h (original)
> +++ compiler-rt/trunk/include/sanitizer/asan_interface.h Tue Aug 28
> 21:27:54 2012
> @@ -1,4 +1,4 @@
> -//===-- asan_interface.h ----------------------------------------*- C++
> -*-===//
> +//===-- sanitizer/asan_interface.h ------------------------------*- C++
> -*-===//
>  //
>  //                     The LLVM Compiler Infrastructure
>  //
> @@ -12,10 +12,11 @@
>  // This header can be included by the instrumented program to fetch
>  // data (mostly allocator statistics) from ASan runtime library.
>
>  //===----------------------------------------------------------------------===//
> -#ifndef ASAN_INTERFACE_H
> -#define ASAN_INTERFACE_H
> +#ifndef SANITIZER_ASAN_INTERFACE_H
> +#define SANITIZER_ASAN_INTERFACE_H
> +
> +#include <sanitizer/common_interface_defs.h>
>
> -#include "sanitizer_common/sanitizer_interface_defs.h"
>  // ----------- ATTENTION -------------
>  // This header should NOT include any other headers from ASan runtime.
>  // All functions in this header are extern "C" and start with __asan_.
> @@ -198,4 +199,4 @@
>        SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE;
>  }  // extern "C"
>
> -#endif  // ASAN_INTERFACE_H
> +#endif  // SANITIZER_ASAN_INTERFACE_H
>
> Copied: compiler-rt/trunk/include/sanitizer/common_interface_defs.h (from
> r162809, compiler-rt/trunk/lib/sanitizer_common/sanitizer_interface_defs.h)
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/include/sanitizer/common_interface_defs.h?p2=compiler-rt/trunk/include/sanitizer/common_interface_defs.h&p1=compiler-rt/trunk/lib/sanitizer_common/sanitizer_interface_defs.h&r1=162809&r2=162822&rev=162822&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_interface_defs.h
> (original)
> +++ compiler-rt/trunk/include/sanitizer/common_interface_defs.h Tue Aug 28
> 21:27:54 2012
> @@ -1,4 +1,4 @@
> -//===-- sanitizer_interface_defs.h -----------------------------*- C++
> -*-===//
> +//===-- sanitizer/common_interface_defs.h -----------------------*- C++
> -*-===//
>  //
>  //                     The LLVM Compiler Infrastructure
>  //
> @@ -12,8 +12,8 @@
>  // NOTE: This file may be included into user code.
>
>  //===----------------------------------------------------------------------===//
>
> -#ifndef SANITIZER_INTERFACE_DEFS_H
> -#define SANITIZER_INTERFACE_DEFS_H
> +#ifndef SANITIZER_COMMON_INTERFACE_DEFS_H
> +#define SANITIZER_COMMON_INTERFACE_DEFS_H
>
>  // ----------- ATTENTION -------------
>  // This header should NOT include any other headers to avoid portability
> issues.
> @@ -53,4 +53,4 @@
>
>  }  // namespace __sanitizer
>
> -#endif  // SANITIZER_INTERFACE_DEFS_H
> +#endif  // SANITIZER_COMMON_INTERFACE_DEFS_H
>
> Modified: compiler-rt/trunk/lib/asan/asan_allocator.cc
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_allocator.cc?rev=162822&r1=162821&r2=162822&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/asan/asan_allocator.cc (original)
> +++ compiler-rt/trunk/lib/asan/asan_allocator.cc Tue Aug 28 21:27:54 2012
> @@ -27,7 +27,6 @@
>
>  #include "asan_allocator.h"
>  #include "asan_interceptors.h"
> -#include "asan_interface.h"
>  #include "asan_internal.h"
>  #include "asan_lock.h"
>  #include "asan_mapping.h"
> @@ -35,6 +34,7 @@
>  #include "asan_report.h"
>  #include "asan_thread.h"
>  #include "asan_thread_registry.h"
> +#include "sanitizer/asan_interface.h"
>  #include "sanitizer_common/sanitizer_atomic.h"
>
>  #if defined(_WIN32) && !defined(__clang__)
>
> Modified: compiler-rt/trunk/lib/asan/asan_flags.h
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_flags.h?rev=162822&r1=162821&r2=162822&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/asan/asan_flags.h (original)
> +++ compiler-rt/trunk/lib/asan/asan_flags.h Tue Aug 28 21:27:54 2012
> @@ -15,7 +15,7 @@
>  #ifndef ASAN_FLAGS_H
>  #define ASAN_FLAGS_H
>
> -#include "sanitizer_common/sanitizer_interface_defs.h"
> +#include "sanitizer/common_interface_defs.h"
>
>  // ASan flag values can be defined in three ways:
>  // 1) initialized with default values at startup.
>
> Modified: compiler-rt/trunk/lib/asan/asan_globals.cc
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_globals.cc?rev=162822&r1=162821&r2=162822&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/asan/asan_globals.cc (original)
> +++ compiler-rt/trunk/lib/asan/asan_globals.cc Tue Aug 28 21:27:54 2012
> @@ -12,7 +12,6 @@
>  // Handle globals.
>
>  //===----------------------------------------------------------------------===//
>  #include "asan_interceptors.h"
> -#include "asan_interface.h"
>  #include "asan_internal.h"
>  #include "asan_lock.h"
>  #include "asan_mapping.h"
> @@ -20,6 +19,7 @@
>  #include "asan_stack.h"
>  #include "asan_stats.h"
>  #include "asan_thread.h"
> +#include "sanitizer/asan_interface.h"
>
>  namespace __asan {
>
>
> Modified: compiler-rt/trunk/lib/asan/asan_interceptors.cc
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interceptors.cc?rev=162822&r1=162821&r2=162822&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/asan/asan_interceptors.cc (original)
> +++ compiler-rt/trunk/lib/asan/asan_interceptors.cc Tue Aug 28 21:27:54
> 2012
> @@ -15,7 +15,6 @@
>
>  #include "asan_allocator.h"
>  #include "asan_intercepted_functions.h"
> -#include "asan_interface.h"
>  #include "asan_internal.h"
>  #include "asan_mapping.h"
>  #include "asan_report.h"
> @@ -23,6 +22,7 @@
>  #include "asan_stats.h"
>  #include "asan_thread_registry.h"
>  #include "interception/interception.h"
> +#include "sanitizer/asan_interface.h"
>  #include "sanitizer_common/sanitizer_libc.h"
>
>  namespace __asan {
>
> Removed: compiler-rt/trunk/lib/asan/asan_interface.h
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interface.h?rev=162821&view=auto
>
> ==============================================================================
> --- compiler-rt/trunk/lib/asan/asan_interface.h (original)
> +++ compiler-rt/trunk/lib/asan/asan_interface.h (removed)
> @@ -1,201 +0,0 @@
> -//===-- asan_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 AddressSanitizer, an address sanity checker.
> -//
> -// This header can be included by the instrumented program to fetch
> -// data (mostly allocator statistics) from ASan runtime library.
>
> -//===----------------------------------------------------------------------===//
> -#ifndef ASAN_INTERFACE_H
> -#define ASAN_INTERFACE_H
> -
> -#include "sanitizer_common/sanitizer_interface_defs.h"
> -// ----------- ATTENTION -------------
> -// This header should NOT include any other headers from ASan runtime.
> -// All functions in this header are extern "C" and start with __asan_.
> -
> -using __sanitizer::uptr;
> -
> -extern "C" {
> -  // This function should be called at the very beginning of the process,
> -  // before any instrumented code is executed and before any call to
> malloc.
> -  void __asan_init() SANITIZER_INTERFACE_ATTRIBUTE;
> -
> -  // This function should be called by the instrumented code.
> -  // 'addr' is the address of a global variable called 'name' of 'size'
> bytes.
> -  void __asan_register_global(uptr addr, uptr size, const char *name)
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -
> -  // This structure describes an instrumented global variable.
> -  struct __asan_global {
> -    uptr beg;                // The address of the global.
> -    uptr size;               // The original size of the global.
> -    uptr size_with_redzone;  // The size with the redzone.
> -    const char *name;        // Name as a C string.
> -    uptr has_dynamic_init;   // Non-zero if the global has dynamic
> initializer.
> -  };
> -
> -  // These two functions should be called by the instrumented code.
> -  // 'globals' is an array of structures describing 'n' globals.
> -  void __asan_register_globals(__asan_global *globals, uptr n)
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -  void __asan_unregister_globals(__asan_global *globals, uptr n)
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -
> -  // These two functions should be called before and after dynamic
> initializers
> -  // run, respectively.  They should be called with parameters describing
> all
> -  // dynamically initialized globals defined in the calling TU.
> -  void __asan_before_dynamic_init(uptr first_addr, uptr last_addr)
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -  void __asan_after_dynamic_init()
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -
> -  // These two functions are used by the instrumented code in the
> -  // use-after-return mode. __asan_stack_malloc allocates size bytes of
> -  // fake stack and __asan_stack_free poisons it. real_stack is a pointer
> to
> -  // the real stack region.
> -  uptr __asan_stack_malloc(uptr size, uptr real_stack)
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -  void __asan_stack_free(uptr ptr, uptr size, uptr real_stack)
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -
> -  // Marks memory region [addr, addr+size) as unaddressable.
> -  // This memory must be previously allocated by the user program.
> Accessing
> -  // addresses in this region from instrumented code is forbidden until
> -  // this region is unpoisoned. This function is not guaranteed to poison
> -  // the whole region - it may poison only subregion of [addr, addr+size)
> due
> -  // to ASan alignment restrictions.
> -  // Method is NOT thread-safe in the sense that no two threads can
> -  // (un)poison memory in the same memory region simultaneously.
> -  void __asan_poison_memory_region(void const volatile *addr, uptr size)
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -  // Marks memory region [addr, addr+size) as addressable.
> -  // This memory must be previously allocated by the user program.
> Accessing
> -  // addresses in this region is allowed until this region is poisoned
> again.
> -  // This function may unpoison a superregion of [addr, addr+size) due to
> -  // ASan alignment restrictions.
> -  // Method is NOT thread-safe in the sense that no two threads can
> -  // (un)poison memory in the same memory region simultaneously.
> -  void __asan_unpoison_memory_region(void const volatile *addr, uptr size)
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -
> -  // Performs cleanup before a NoReturn function. Must be called before
> things
> -  // like _exit and execl to avoid false positives on stack.
> -  void __asan_handle_no_return() SANITIZER_INTERFACE_ATTRIBUTE;
> -
> -// User code should use macro instead of functions.
> -#if __has_feature(address_sanitizer)
> -#define ASAN_POISON_MEMORY_REGION(addr, size) \
> -  __asan_poison_memory_region((addr), (size))
> -#define ASAN_UNPOISON_MEMORY_REGION(addr, size) \
> -  __asan_unpoison_memory_region((addr), (size))
> -#else
> -#define ASAN_POISON_MEMORY_REGION(addr, size) \
> -  ((void)(addr), (void)(size))
> -#define ASAN_UNPOISON_MEMORY_REGION(addr, size) \
> -  ((void)(addr), (void)(size))
> -#endif
> -
> -  // Returns true iff addr is poisoned (i.e. 1-byte read/write access to
> this
> -  // address will result in error report from AddressSanitizer).
> -  bool __asan_address_is_poisoned(void const volatile *addr)
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -
> -  // This is an internal function that is called to report an error.
> -  // However it is still a part of the interface because users may want to
> -  // set a breakpoint on this function in a debugger.
> -  void __asan_report_error(uptr pc, uptr bp, uptr sp,
> -                           uptr addr, bool is_write, uptr access_size)
> -    SANITIZER_INTERFACE_ATTRIBUTE;
> -
> -  // Sets the exit code to use when reporting an error.
> -  // Returns the old value.
> -  int __asan_set_error_exit_code(int exit_code)
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -
> -  // Sets the callback to be called right before death on error.
> -  // Passing 0 will unset the callback.
> -  void __asan_set_death_callback(void (*callback)(void))
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -
> -  void __asan_set_error_report_callback(void (*callback)(const char*))
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -
> -  // Sets the callback to be called right when ASan detects an error.
> -  // This can be used to notice cases when ASan detects an error, but the
> -  // program crashes before ASan report is printed.
> -  // Passing 0 unsets the callback.
> -  void __asan_set_on_error_callback(void (*callback)(void))
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -
> -  // User may register its own symbolization function. It should print
> -  // the description of instruction at address "pc" to "out_buffer".
> -  // Description should be at most "out_size" bytes long.
> -  // User-specified function should return true if symbolization was
> -  // successful.
> -  typedef bool (*__asan_symbolize_callback)(const void *pc, char
> *out_buffer,
> -                                            int out_size);
> -  void __asan_set_symbolize_callback(__asan_symbolize_callback callback)
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -
> -  // Returns the estimated number of bytes that will be reserved by
> allocator
> -  // for request of "size" bytes. If ASan allocator can't allocate that
> much
> -  // memory, returns the maximal possible allocation size, otherwise
> returns
> -  // "size".
> -  uptr __asan_get_estimated_allocated_size(uptr size)
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -  // Returns true if p was returned by the ASan allocator and
> -  // is not yet freed.
> -  bool __asan_get_ownership(const void *p)
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -  // Returns the number of bytes reserved for the pointer p.
> -  // Requires (get_ownership(p) == true) or (p == 0).
> -  uptr __asan_get_allocated_size(const void *p)
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -  // Number of bytes, allocated and not yet freed by the application.
> -  uptr __asan_get_current_allocated_bytes()
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -  // Number of bytes, mmaped by asan allocator to fulfill allocation
> requests.
> -  // Generally, for request of X bytes, allocator can reserve and add to
> free
> -  // lists a large number of chunks of size X to use them for future
> requests.
> -  // All these chunks count toward the heap size. Currently, allocator
> never
> -  // releases memory to OS (instead, it just puts freed chunks to free
> lists).
> -  uptr __asan_get_heap_size()
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -  // Number of bytes, mmaped by asan allocator, which can be used to
> fulfill
> -  // allocation requests. When a user program frees memory chunk, it can
> first
> -  // fall into quarantine and will count toward __asan_get_free_bytes()
> later.
> -  uptr __asan_get_free_bytes()
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -  // Number of bytes in unmapped pages, that are released to OS.
> Currently,
> -  // always returns 0.
> -  uptr __asan_get_unmapped_bytes()
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -  // Prints accumulated stats to stderr. Used for debugging.
> -  void __asan_print_accumulated_stats()
> -      SANITIZER_INTERFACE_ATTRIBUTE;
> -
> -  // This function may be overriden by user to provide a string containing
> -  // ASan runtime options. See asan_flags.h for details.
> -  const char* __asan_default_options()
> -      SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE;
> -
> -  // Malloc hooks that may be overriden by user.
> -  // __asan_malloc_hook(ptr, size) is called immediately after
> -  //   allocation of "size" bytes, which returned "ptr".
> -  // __asan_free_hook(ptr) is called immediately before
> -  //   deallocation of "ptr".
> -  // If user doesn't provide implementations of these hooks, they are
> no-op.
> -  void __asan_malloc_hook(void *ptr, uptr size)
> -      SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE;
> -  void __asan_free_hook(void *ptr)
> -      SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE;
> -}  // extern "C"
> -
> -#endif  // ASAN_INTERFACE_H
>
> Modified: compiler-rt/trunk/lib/asan/asan_poisoning.cc
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_poisoning.cc?rev=162822&r1=162821&r2=162822&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/asan/asan_poisoning.cc (original)
> +++ compiler-rt/trunk/lib/asan/asan_poisoning.cc Tue Aug 28 21:27:54 2012
> @@ -13,9 +13,9 @@
>
>  //===----------------------------------------------------------------------===//
>
>  #include "asan_interceptors.h"
> -#include "asan_interface.h"
>  #include "asan_internal.h"
>  #include "asan_mapping.h"
> +#include "sanitizer/asan_interface.h"
>
>  namespace __asan {
>
>
> Modified: compiler-rt/trunk/lib/asan/asan_report.h
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_report.h?rev=162822&r1=162821&r2=162822&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/asan/asan_report.h (original)
> +++ compiler-rt/trunk/lib/asan/asan_report.h Tue Aug 28 21:27:54 2012
> @@ -12,8 +12,8 @@
>  // ASan-private header for error reporting functions.
>
>  //===----------------------------------------------------------------------===//
>
> -#include "asan_interface.h"
>  #include "asan_internal.h"
> +#include "sanitizer/asan_interface.h"
>
>  namespace __asan {
>
>
> Modified: compiler-rt/trunk/lib/asan/asan_rtl.cc
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_rtl.cc?rev=162822&r1=162821&r2=162822&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/asan/asan_rtl.cc (original)
> +++ compiler-rt/trunk/lib/asan/asan_rtl.cc Tue Aug 28 21:27:54 2012
> @@ -13,7 +13,6 @@
>
>  //===----------------------------------------------------------------------===//
>  #include "asan_allocator.h"
>  #include "asan_interceptors.h"
> -#include "asan_interface.h"
>  #include "asan_internal.h"
>  #include "asan_lock.h"
>  #include "asan_mapping.h"
> @@ -22,6 +21,7 @@
>  #include "asan_stats.h"
>  #include "asan_thread.h"
>  #include "asan_thread_registry.h"
> +#include "sanitizer/asan_interface.h"
>  #include "sanitizer_common/sanitizer_atomic.h"
>  #include "sanitizer_common/sanitizer_flags.h"
>  #include "sanitizer_common/sanitizer_libc.h"
>
> Modified: compiler-rt/trunk/lib/asan/asan_stack.cc
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_stack.cc?rev=162822&r1=162821&r2=162822&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/asan/asan_stack.cc (original)
> +++ compiler-rt/trunk/lib/asan/asan_stack.cc Tue Aug 28 21:27:54 2012
> @@ -12,8 +12,8 @@
>  // Code for ASan stack trace.
>
>  //===----------------------------------------------------------------------===//
>  #include "asan_flags.h"
> -#include "asan_interface.h"
>  #include "asan_stack.h"
> +#include "sanitizer/asan_interface.h"
>
>  namespace __asan {
>
>
> Modified: compiler-rt/trunk/lib/asan/asan_stats.cc
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_stats.cc?rev=162822&r1=162821&r2=162822&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/asan/asan_stats.cc (original)
> +++ compiler-rt/trunk/lib/asan/asan_stats.cc Tue Aug 28 21:27:54 2012
> @@ -12,11 +12,11 @@
>  // Code related to statistics collected by AddressSanitizer.
>
>  //===----------------------------------------------------------------------===//
>  #include "asan_interceptors.h"
> -#include "asan_interface.h"
>  #include "asan_internal.h"
>  #include "asan_lock.h"
>  #include "asan_stats.h"
>  #include "asan_thread_registry.h"
> +#include "sanitizer/asan_interface.h"
>
>  namespace __asan {
>
>
> Modified: compiler-rt/trunk/lib/asan/lit_tests/interface_symbols.c
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/interface_symbols.c?rev=162822&r1=162821&r2=162822&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/asan/lit_tests/interface_symbols.c (original)
> +++ compiler-rt/trunk/lib/asan/lit_tests/interface_symbols.c Tue Aug 28
> 21:27:54 2012
> @@ -3,7 +3,8 @@
>  // RUN: %clang -faddress-sanitizer -dead_strip -O2 %s -o %t.exe
>  // RUN: nm %t.exe | egrep " [TW] " | sed "s/.* T //" | sed "s/.* W //" \
>  // RUN:    | grep "__asan_" | sed "s/___asan_/__asan_/" > %t.symbols
> -// RUN: cat %p/../asan_interface.h | sed "s/\/\/.*//" | sed
> "s/typedef.*//" \
> +// RUN: cat %p/../../../include/sanitizer/asan_interface.h \
> +// RUN:    | sed "s/\/\/.*//" | sed "s/typedef.*//" \
>  // RUN:    | grep "__asan_.*(" | sed "s/.* __asan_/__asan_/;s/(.*//" \
>  // RUN:    > %t.interface
>  // RUN: echo __asan_report_load1 >> %t.interface
>
> Modified: compiler-rt/trunk/lib/asan/output_tests/test_output.sh
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/output_tests/test_output.sh?rev=162822&r1=162821&r2=162822&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/asan/output_tests/test_output.sh (original)
> +++ compiler-rt/trunk/lib/asan/output_tests/test_output.sh Tue Aug 28
> 21:27:54 2012
> @@ -8,7 +8,7 @@
>  FILE_CHECK=$3
>  CXXFLAGS="-mno-omit-leaf-frame-pointer -fno-omit-frame-pointer
> -fno-optimize-sibling-calls -g"
>  SYMBOLIZER=../scripts/asan_symbolize.py
> -ASAN_INTERFACE_H=../asan_interface.h
> +ASAN_INTERFACE_H=../../../include/sanitizer/asan_interface.h
>  TMP_ASAN_REPORT=asan_report.tmp
>
>  run_program() {
>
> Modified: compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc?rev=162822&r1=162821&r2=162822&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc (original)
> +++ compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc Tue Aug 28
> 21:27:54 2012
> @@ -11,13 +11,14 @@
>  //
>  // This test file should be compiled w/o asan instrumentation.
>
>  //===----------------------------------------------------------------------===//
> +
>  #include "asan_allocator.h"
> -#include "asan_interface.h"
>  #include "asan_internal.h"
>  #include "asan_mapping.h"
>  #include "asan_stack.h"
>  #include "asan_test_utils.h"
>  #include "asan_test_config.h"
> +#include "sanitizer/asan_interface.h"
>
>  #include <assert.h>
>  #include <stdio.h>
>
> Removed: compiler-rt/trunk/lib/sanitizer_common/sanitizer_interface_defs.h
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_interface_defs.h?rev=162821&view=auto
>
> ==============================================================================
> --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_interface_defs.h
> (original)
> +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_interface_defs.h
> (removed)
> @@ -1,56 +0,0 @@
> -//===-- sanitizer_interface_defs.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 shared between AddressSanitizer and ThreadSanitizer.
> -// It contains basic macro and types.
> -// NOTE: This file may be included into user code.
>
> -//===----------------------------------------------------------------------===//
> -
> -#ifndef SANITIZER_INTERFACE_DEFS_H
> -#define SANITIZER_INTERFACE_DEFS_H
> -
> -// ----------- ATTENTION -------------
> -// This header should NOT include any other headers to avoid portability
> issues.
> -
> -#if defined(_WIN32)
> -// FIXME find out what we need on Windows. __declspec(dllexport) ?
> -# define SANITIZER_INTERFACE_ATTRIBUTE
> -# define SANITIZER_WEAK_ATTRIBUTE
> -#elif defined(SANITIZER_GO)
> -# define SANITIZER_INTERFACE_ATTRIBUTE
> -# define SANITIZER_WEAK_ATTRIBUTE
> -#else
> -# define SANITIZER_INTERFACE_ATTRIBUTE
> __attribute__((visibility("default")))
> -# define SANITIZER_WEAK_ATTRIBUTE  __attribute__((weak))
> -#endif
> -
> -// __has_feature
> -#if !defined(__has_feature)
> -# define __has_feature(x) 0
> -#endif
> -
> -// For portability reasons we do not include stddef.h, stdint.h or any
> other
> -// system header, but we do need some basic types that are not defined
> -// in a portable way by the language itself.
> -namespace __sanitizer {
> -
> -typedef unsigned long uptr;  // NOLINT
> -typedef signed   long sptr;  // NOLINT
> -typedef unsigned char u8;
> -typedef unsigned short u16;  // NOLINT
> -typedef unsigned int u32;
> -typedef unsigned long long u64;  // NOLINT
> -typedef signed   char s8;
> -typedef signed   short s16;  // NOLINT
> -typedef signed   int s32;
> -typedef signed   long long s64;  // NOLINT
> -
> -}  // namespace __sanitizer
> -
> -#endif  // SANITIZER_INTERFACE_DEFS_H
>
> Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_internal_defs.h
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_internal_defs.h?rev=162822&r1=162821&r2=162822&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_internal_defs.h
> (original)
> +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_internal_defs.h Tue
> Aug 28 21:27:54 2012
> @@ -13,7 +13,7 @@
>  #ifndef SANITIZER_DEFS_H
>  #define SANITIZER_DEFS_H
>
> -#include "sanitizer_interface_defs.h"
> +#include "sanitizer/common_interface_defs.h"
>  using namespace __sanitizer;  // NOLINT
>  // ----------- ATTENTION -------------
>  // This header should NOT include any other headers to avoid portability
> issues.
>
> Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.h
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.h?rev=162822&r1=162821&r2=162822&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.h (original)
> +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.h Tue Aug 28
> 21:27:54 2012
> @@ -18,7 +18,7 @@
>
>  // ----------- ATTENTION -------------
>  // This header should NOT include any other headers from sanitizer
> runtime.
> -#include "sanitizer_interface_defs.h"
> +#include "sanitizer/common_interface_defs.h"
>
>  namespace __sanitizer {
>
>
> Modified: compiler-rt/trunk/make/config.mk
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/make/config.mk?rev=162822&r1=162821&r2=162822&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/make/config.mk (original)
> +++ compiler-rt/trunk/make/config.mk Tue Aug 28 21:27:54 2012
> @@ -42,5 +42,5 @@
>
>  ###
>  # Common compiler options
> -COMMON_CXXFLAGS=-fno-exceptions -fPIC -funwind-tables -I${ProjSrcRoot}/lib
> +COMMON_CXXFLAGS=-fno-exceptions -fPIC -funwind-tables
> -I${ProjSrcRoot}/lib -I${ProjSrcRoot}/include
>  COMMON_CFLAGS=-fPIC
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120829/63001537/attachment.html>


More information about the llvm-commits mailing list