summaryrefslogtreecommitdiff
path: root/lib/Support/Valgrind.cpp
Commit message (Collapse)AuthorAge
* Don't mark the declarations of the TSan annotation functions as weak.Chandler Carruth2014-03-30
| | | | | | | | | | | | | | | | | | | | | | | | | That causes references to them to be weak references which can collapse to null if no definition is provided. We call these functions unconditionally, so a definition *must* be provided. Make the definitions provided in the .cpp file weak by re-declaring them as weak just prior to defining them. This should keep compilers which cannot attach the weak attribute to the definition happy while actually resolving the symbols correctly during the link. You might ask yourself upon reading this commit log: how did *any* of this work before? Well, fun story. It turns out we have some code in Support (BumpPtrAllocator) which both uses virtual dispatch and has out-of-line vtables used by that virtual dispatch. If you move the virtual dispatch into its header in *just* the right way, the optimizer gets to devirtualize, and remove all references to the vtable. Then the sad part: the references to this one vtable were the only strong symbol uses in the support library for llvm-tblgen AFAICT. At least, after doing something just like this, these symbols stopped getting their weak definition and random calls to them would segfault instead. Yay software. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205137 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't define these unless we plan to use them.Nick Lewycky2011-11-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145289 91177308-0d34-0410-b5e6-96231b3b80d8
* Move WEAK marking to the declaration.Nick Lewycky2011-11-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144603 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix linking for some users who already have tsan enabled code and are trying toNick Lewycky2011-11-15
| | | | | | | link it against llvm code, by making our definitions weak. "Some users." git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144596 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for tsan annotations (thread sanitizer, a valgrind-based tool).Nick Lewycky2011-11-14
| | | | | | | | | | | | | These annotations are disabled entirely when either ENABLE_THREADS is off, or building a release build. When enabled, they add calls to functions with no statements to ManagedStatic's getters. Use these annotations to inform tsan that the race used inside ManagedStatic initialization is actually benign. Thanks to Kostya Serebryany for helping write this patch! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144567 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert previous commit. It seems that whether casting to voidDuncan Sands2011-07-02
| | | | | | | is valid or not depends on which system you build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134321 91177308-0d34-0410-b5e6-96231b3b80d8
* Supress gcc-4.5 warning about the result not being used.Duncan Sands2011-07-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134319 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge System into Support.Michael J. Spencer2010-11-29
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8