<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 25, 2013 at 7:14 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On Mon, Mar 25, 2013 at 3:31 AM, Alexey Samsonov <<a href="mailto:samsonov@google.com">samsonov@google.com</a>> wrote:<br>

> Author: samsonov<br>
> Date: Mon Mar 25 05:31:49 2013<br>
> New Revision: 177860<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=177860&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=177860&view=rev</a><br>
> Log:<br>
> [Sanitizer] Compile sanitizer runtimes with -Wno-non-virtual-dtor. Virtual dtors may be a problem for us, as sanitizer runtime should not generally assume libstdc++ presence.<br>
<br>
</div>I'm not sure I understand the correlation between virtual dtors and<br>
the use (or not) of libstdc++. Could you explain it?<br></blockquote><div><br></div><div style>The compiler emits the call to "operator delete(void*)" while generating a destructor.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div><div class="h5"><br>
><br>
> Modified:<br>
>     compiler-rt/trunk/CMakeLists.txt<br>
>     compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.cc<br>
>     compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.h<br>
><br>
> Modified: compiler-rt/trunk/CMakeLists.txt<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=177860&r1=177859&r2=177860&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=177860&r1=177859&r2=177860&view=diff</a><br>

> ==============================================================================<br>
> --- compiler-rt/trunk/CMakeLists.txt (original)<br>
> +++ compiler-rt/trunk/CMakeLists.txt Mon Mar 25 05:31:49 2013<br>
> @@ -147,6 +147,12 @@ check_cxx_compiler_flag(-Wno-c99-extensi<br>
>  if(SUPPORTS_NO_C99_EXTENSIONS_FLAG)<br>
>    list(APPEND SANITIZER_COMMON_CFLAGS -Wno-c99-extensions)<br>
>  endif()<br>
> +# Sanitizer may not have libstdc++, so we can have problems with virtual<br>
> +# destructors.<br>
> +check_cxx_compiler_flag(-Wno-non-virtual-dtor SUPPORTS_NO_NON_VIRTUAL_DTOR_FLAG)<br>
> +if (SUPPORTS_NO_NON_VIRTUAL_DTOR_FLAG)<br>
> +  list(APPEND SANITIZER_COMMON_CFLAGS -Wno-non-virtual-dtor)<br>
> +endif()<br>
><br>
>  # Setup min Mac OS X version.<br>
>  if(APPLE)<br>
><br>
> Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.cc?rev=177860&r1=177859&r2=177860&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.cc?rev=177860&r1=177859&r2=177860&view=diff</a><br>

> ==============================================================================<br>
> --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.cc (original)<br>
> +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.cc Mon Mar 25 05:31:49 2013<br>
> @@ -22,11 +22,10 @@ ThreadContextBase::ThreadContextBase(u32<br>
>    name[0] = '\0';<br>
>  }<br>
><br>
> -#ifndef SANITIZER_GO<br>
>  ThreadContextBase::~ThreadContextBase() {<br>
> +  // ThreadContextBase should never be deleted.<br>
>    CHECK(0);<br>
>  }<br>
> -#endif<br>
><br>
>  void ThreadContextBase::SetName(const char *new_name) {<br>
>    name[0] = '\0';<br>
><br>
> Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.h?rev=177860&r1=177859&r2=177860&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.h?rev=177860&r1=177859&r2=177860&view=diff</a><br>

> ==============================================================================<br>
> --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.h (original)<br>
> +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_thread_registry.h Mon Mar 25 05:31:49 2013<br>
> @@ -34,10 +34,7 @@ enum ThreadStatus {<br>
>  class ThreadContextBase {<br>
>   public:<br>
>    explicit ThreadContextBase(u32 tid);<br>
> -#ifndef SANITIZER_GO  // Go does not have libstdc++<br>
> -  virtual<br>
> -#endif<br>
> -  ~ThreadContextBase();<br>
> +  ~ThreadContextBase();  // Should never be called.<br>
<br>
</div></div>You could replace this comment with a use of the LLVM_DELETED_FUNCTION<br>
macro that will help the compiler provide better diagnostics when this<br>
code is compiled as C++11<br></blockquote><div><br></div><div style>We don't include any LLVM headers in compiler-rt libs. Do you think there is a value in porting this macro?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class=""><div class="h5">
><br>
>    const u32 tid;  // Thread ID. Main thread should have tid = 0.<br>
>    u64 unique_id;  // Unique thread ID.<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>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</div></div>