[LLVMdev] Unreachable code in Mutex.cpp

Chris Lattner clattner at apple.com
Fri Jan 13 22:24:39 PST 2012


On Jan 13, 2012, at 4:43 PM, David Blaikie wrote:

> It looks like for a while now (5 years) some code that was meant to do
> smart things in Mutex.cpp hasn't been doing such smart things:
> 
> https://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Mutex.cpp?r1=29287&r2=29932&diff_format=h
> 
> I don't know if this change was even deliberate since it came in with
> another change & the description doesn't mention it. Should we do away
> with this logic if it hasn't been needed all this time? Reinstate it
> (with the old logic? or with a configure-based preprocessor variable
> instead)?

On some (linux?) implementations, various pthread APIs are defined as "weak extern" symbols in libc and strong definitions in libpthreads.  The idea of this check is thus to detect if pthreads is linked into the app and enable threads if so.

-Chris




More information about the llvm-dev mailing list