(resending to correct list)

Alexey Samsonov <vonosmas@gmail.com> writes:
> ================
> Comment at: include/llvm/Support/Allocator.h:229
> @@ +228,3 @@
> +      // Similarly, tell ASan about this space.
> +#if LLVM_ADDRESS_SANITIZER_BUILD
> +      ASAN_UNPOISON_MEMORY_REGION(AlignedPtr, Size);
> ----------------
> kcc wrote:
>> I don't like so many ifdefs. 
>> Maybe like this? 
>> 
>> #if LLVM_ADDRESS_SANITIZER_BUILD
>> # include ... 
>> #else
>>   #define ASAN_POISON_MEMORY_REGION(a,b)  /*empty*/
>> #endif
> In fact, it's worth defining this macro in llvm/Support/Compiler.h,
> similar to what we do for MSan interface function
> `__msan_allocated_memory`

I was trying this out to see if it would catch a bug I saw, and happened
to clean it up to be more like we do the msan annotations. Okay to
commit the attached version?

