Hello, <div><br></div><div>The proposed patch is the first step towards race detection built into LLVM/Clang. </div><div>The tool will be similar to AddressSanitizer in the way it works: </div><div>   1. A simple instrumentation module in lib/Transforms/Instrumentation/ThreadSanitizer.cpp (this patch)</div>
<div>   2. -fthread-sanitizer flag in clang (next patch)</div><div>   3. A run-time library in projects/compiler-rt/lib/tsan (patches will follow).</div><div><br></div><div>The patch: <a href="http://codereview.appspot.com/5545054/">http://codereview.appspot.com/5545054/</a> (also attached). </div>
<div><br></div><div>Here are some links about the previous versions of ThreadSanitizer</div><div>- <a href="http://code.google.com/p/data-race-test/">http://code.google.com/p/data-race-test/</a> -- main project page</div>
<div>- <a href="http://code.google.com/p/data-race-test/wiki/CompileTimeInstrumentation">http://code.google.com/p/data-race-test/wiki/CompileTimeInstrumentation</a> - description of the LLVM-based prototype (we are not going to reuse that code, but will reuse the ideas). </div>
<div>- <a href="http://code.google.com/p/data-race-test/wiki/GccInstrumentation">http://code.google.com/p/data-race-test/wiki/GccInstrumentation</a> - description of the GCC-based prototype. </div><div>- <a href="http://dev.chromium.org/developers/how-tos/using-valgrind/threadsanitizer">http://dev.chromium.org/developers/how-tos/using-valgrind/threadsanitizer</a> - ThreadSanitizer for Chromium </div>
<div><div>- <a href="http://data-race-test.googlecode.com/files/ThreadSanitizer.pdf">http://data-race-test.googlecode.com/files/ThreadSanitizer.pdf</a> -- paper about Valgrind-based tool published at WBIA'09 </div>- <a href="http://data-race-test.googlecode.com/files/ThreadSanitizerLLVM.pdf">http://data-race-test.googlecode.com/files/ThreadSanitizerLLVM.pdf</a> -- paper about LLVM-based tool published at RV'2011<br>
<div> <br><div>Thanks, </div></div></div><div><br></div><div>--kcc </div>