I'd prefer to have as few ifdefs as possible, I guess we can have no ifdefs in this patch.<div><br></div><div>Also, you are adding some code to a CTOR which should be LinkerInitialized: </div><div><br></div><div><div>@@ -29,7 +29,11 @@ AsanThreadRegistry::AsanThreadRegistry(LinkerInitialized x)</div>
<div> : main_thread_(x),</div><div> main_thread_summary_(x),</div><div> accumulated_stats_(x),</div><div>- mu_(x) { }</div><div>+ mu_(x) {</div><div>+#ifdef ANDROID</div><div>+ main_thread_tid_ = AsanGetTid();</div>
<div>+#endif</div><div>+}</div></div><div><br></div><div><br></div><div>--kcc </div><div><br><div><br></div><div><br><br><div class="gmail_quote">On Mon, Jan 16, 2012 at 5:32 AM, Alexander Potapenko <span dir="ltr"><<a href="mailto:glider@google.com">glider@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mon, Jan 16, 2012 at 5:24 PM, Evgeniy Stepanov<br>
<<a href="mailto:eugeni.stepanov@gmail.com">eugeni.stepanov@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> this ugly, but efficient patch lets us restore the main thread's<br>
> AsanThread which gets overwritten in the libc constructor.<br>
><br>
> Please review.<br>
<br>
</div></div>This looks good to me.<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></div>