May I ask you to add tests for these? <div>afaict, you need a .so that will use all of these functions, right? <br><br><div class="gmail_quote">On Tue, Feb 14, 2012 at 5:46 AM, Evgeniy Stepanov <span dir="ltr"><<a href="mailto:eugeni.stepanov@gmail.com">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: Tue Feb 14 07:46:06 2012<br>
New Revision: 150479<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=150479&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=150479&view=rev</a><br>
Log:<br>
[asan] Add lots of missing visibility attributes.<br>
<br>
Modified:<br>
    compiler-rt/trunk/lib/asan/asan_interface.h<br>
<br>
Modified: compiler-rt/trunk/lib/asan/asan_interface.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interface.h?rev=150479&r1=150478&r2=150479&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interface.h?rev=150479&r1=150478&r2=150479&view=diff</a><br>

==============================================================================<br>
--- compiler-rt/trunk/lib/asan/asan_interface.h (original)<br>
+++ compiler-rt/trunk/lib/asan/asan_interface.h Tue Feb 14 07:46:06 2012<br>
@@ -69,7 +69,8 @@<br>
   // to ASan alignment restrictions.<br>
   // Method is NOT thread-safe in the sense that no two threads can<br>
   // (un)poison memory in the same memory region simultaneously.<br>
-  void __asan_poison_memory_region(void const volatile *addr, size_t size);<br>
+  void __asan_poison_memory_region(void const volatile *addr, size_t size)<br>
+      ASAN_INTERFACE_FUNCTION_ATTRIBUTE;<br>
   // Marks memory region [addr, addr+size) as addressable.<br>
   // This memory must be previously allocated by the user program. Accessing<br>
   // addresses in this region is allowed until this region is poisoned again.<br>
@@ -77,7 +78,8 @@<br>
   // ASan alignment restrictions.<br>
   // Method is NOT thread-safe in the sense that no two threads can<br>
   // (un)poison memory in the same memory region simultaneously.<br>
-  void __asan_unpoison_memory_region(void const volatile *addr, size_t size);<br>
+  void __asan_unpoison_memory_region(void const volatile *addr, size_t size)<br>
+      ASAN_INTERFACE_FUNCTION_ATTRIBUTE;<br>
<br>
   // Performs cleanup before a NoReturn function. Must be called before things<br>
   // like _exit and execl to avoid false positives on stack.<br>
@@ -98,7 +100,8 @@<br>
<br>
   // Returns true iff addr is poisoned (i.e. 1-byte read/write access to this<br>
   // address will result in error report from AddressSanitizer).<br>
-  bool __asan_address_is_poisoned(void const volatile *addr);<br>
+  bool __asan_address_is_poisoned(void const volatile *addr)<br>
+      ASAN_INTERFACE_FUNCTION_ATTRIBUTE;<br>
<br>
   // This is an internal function that is called to report an error.<br>
   // However it is still a part of the interface because users may want to<br>
@@ -121,30 +124,38 @@<br>
   // for request of "size" bytes. If ASan allocator can't allocate that much<br>
   // memory, returns the maximal possible allocation size, otherwise returns<br>
   // "size".<br>
-  size_t __asan_get_estimated_allocated_size(size_t size);<br>
+  size_t __asan_get_estimated_allocated_size(size_t size)<br>
+      ASAN_INTERFACE_FUNCTION_ATTRIBUTE;<br>
   // Returns true if p was returned by the ASan allocator and<br>
   // is not yet freed.<br>
-  bool __asan_get_ownership(const void *p);<br>
+  bool __asan_get_ownership(const void *p)<br>
+      ASAN_INTERFACE_FUNCTION_ATTRIBUTE;<br>
   // Returns the number of bytes reserved for the pointer p.<br>
   // Requires (get_ownership(p) == true) or (p == NULL).<br>
-  size_t __asan_get_allocated_size(const void *p);<br>
+  size_t __asan_get_allocated_size(const void *p)<br>
+      ASAN_INTERFACE_FUNCTION_ATTRIBUTE;<br>
   // Number of bytes, allocated and not yet freed by the application.<br>
-  size_t __asan_get_current_allocated_bytes();<br>
+  size_t __asan_get_current_allocated_bytes()<br>
+      ASAN_INTERFACE_FUNCTION_ATTRIBUTE;<br>
   // Number of bytes, mmaped by asan allocator to fulfill allocation requests.<br>
   // Generally, for request of X bytes, allocator can reserve and add to free<br>
   // lists a large number of chunks of size X to use them for future requests.<br>
   // All these chunks count toward the heap size. Currently, allocator never<br>
   // releases memory to OS (instead, it just puts freed chunks to free lists).<br>
-  size_t __asan_get_heap_size();<br>
+  size_t __asan_get_heap_size()<br>
+      ASAN_INTERFACE_FUNCTION_ATTRIBUTE;<br>
   // Number of bytes, mmaped by asan allocator, which can be used to fulfill<br>
   // allocation requests. When a user program frees memory chunk, it can first<br>
   // fall into quarantine and will count toward __asan_get_free_bytes() later.<br>
-  size_t __asan_get_free_bytes();<br>
+  size_t __asan_get_free_bytes()<br>
+      ASAN_INTERFACE_FUNCTION_ATTRIBUTE;<br>
   // Number of bytes in unmapped pages, that are released to OS. Currently,<br>
   // always returns 0.<br>
-  size_t __asan_get_unmapped_bytes();<br>
+  size_t __asan_get_unmapped_bytes()<br>
+      ASAN_INTERFACE_FUNCTION_ATTRIBUTE;<br>
   // Prints accumulated stats to stderr. Used for debugging.<br>
-  void __asan_print_accumulated_stats();<br>
+  void __asan_print_accumulated_stats()<br>
+      ASAN_INTERFACE_FUNCTION_ATTRIBUTE;<br>
 }  // namespace<br>
<br>
 #undef ASAN_INTERFACE_FUNCTION_ATTRIBUTE<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></div>