[compiler-rt] r182372 - [nolibc] Move symbolizer to RTSanitizerCommonLibc, and make it optional using a weak symbol.

Alexey Samsonov samsonov at google.com
Mon May 27 06:59:57 PDT 2013


On Mon, May 27, 2013 at 5:41 PM, Peter Collingbourne <peter at pcc.me.uk>wrote:

> On Thu, May 23, 2013 at 06:21:33PM +0400, Alexey Samsonov wrote:
> > Can we use existing SANITIZER_SUPPORTS_WEAK_HOOKS macro to fix this?
>
> We could enclose the "&& SymbolizeCode" part in an ifdef, but I think this
> would be kind of ugly.
>
> One idea I had was to define a macro like this:
>
> #if SANITIZER_WINDOWS
> # define SANITIZER_HAS_WEAK_SYMBOL(s) 1
> #else
> # define SANITIZER_HAS_WEAK_SYMBOL(s) (&(s))
> #endif
>

I like this idea.


>
> Then we can just write:
>
> if (symbolize && addr_frames_num == 0 &&
>     SANITIZER_HAS_WEAK_SYMBOL(SymbolizeCode)) {
>
> which would probably be more readable.  There are a few more places
> where we'd be able to use this macro, I believe.
>
> Thanks,
> --
> Peter
>



-- 
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130527/7faabb4e/attachment.html>


More information about the llvm-commits mailing list