summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/CrashRecoveryContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use array_lengthof. NFCCraig Topper2015-10-181-1/+1
| | | | llvm-svn: 250643
* Add a comment.Nico Weber2015-08-071-0/+4
| | | | llvm-svn: 244337
* Fix nested CrashRecoveryContexts with LLVM_ENABLE_THREADS=OFF, allow them.Nico Weber2015-08-061-6/+14
| | | | | | | | | | | | | | | | | | libclang uses a CrashRecoveryContext, and building a module does too. If a module gets built through libclang, nested CrashRecoveryContexts are used. They work fine with threads as things are stored in ThreadLocal variables, but in LLVM_ENABLE_THREADS=OFF builds the two recovery contexts would write to the same globals. To fix, keep active CrashRecoveryContextImpls in a list and have the global point to the innermost one, and do something similar for tlIsRecoveringFromCrash. Necessary (but not sufficient) for PR11974 and PR20325 http://reviews.llvm.org/D11770 llvm-svn: 244251
* Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)Alexander Kornienko2015-06-231-1/+1
| | | | | | Apparently, the style needs to be agreed upon first. llvm-svn: 240390
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-191-1/+1
| | | | | | | | | | | | | The patch is generated using this command: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/ Thanks to Eugene Kosov for the original patch! llvm-svn: 240137
* Purge unused includes throughout libSupport.Benjamin Kramer2015-03-231-2/+0
| | | | | | NFC. llvm-svn: 232976
* For CrashRecoveryContext::RunSafelyOnThread, propagate Darwin's ↵Argyrios Kyrtzidis2014-06-251-2/+21
| | | | | | | | | | | | PRIO_DARWIN_BG to the new thread if it is set on the calling thread. This allows libclang's indexing threads to propagate their priority to the clang module building threads. rdar://17459872 llvm-svn: 211747
* Test commit, wraps some lines to fit in 80 columns.Zachary Turner2014-06-101-2/+4
| | | | llvm-svn: 210551
* Re-commit r208025, reverted in r208030, with a fix for a conformance issueRichard Smith2014-05-061-7/+6
| | | | | | which GCC detects and Clang does not! llvm-svn: 208033
* Revert r208025, which made buildbots unhappy for unknown reasons.Richard Smith2014-05-061-6/+7
| | | | llvm-svn: 208030
* Add llvm::function_ref (and a couple of uses of it), representing a ↵Richard Smith2014-05-061-7/+6
| | | | | | type-erased reference to a callable object. llvm-svn: 208025
* [C++11] Make use of 'nullptr' in the Support library.Craig Topper2014-04-071-6/+6
| | | | llvm-svn: 205697
* Remove dependence on std::function.Richard Smith2014-03-041-15/+6
| | | | llvm-svn: 202902
* Add support for arbitrary functors to CrashRecoveryContext.Richard Smith2014-03-041-6/+15
| | | | llvm-svn: 202895
* Rename Windows.h to WindowsSupport.h to avoid ambiguityReid Kleckner2014-02-121-1/+1
| | | | llvm-svn: 201258
* This switches CrashRecoveryContext to using ManagedStatic for its global ↵Filip Pizlo2013-09-121-16/+17
| | | | | | | | | | Mutex and global ThreadLocals, thereby getting rid of the load-time initialization of those objects and also getting rid of their destruction unless the LLVM client calls llvm_shutdown. llvm-svn: 190617
* [Support/CrashRecoveryContext] Make sure CrashRecoveryContext does not clear ↵Argyrios Kyrtzidis2013-06-191-2/+11
| | | | | | | | | | | | | | | | | the thread-local "CurrentContext" in the "parent" thread, when we are using CrashRecoveryContext::RunSafelyOnThread. When using CrashRecoveryContext::RunSafelyOnThread, we would set a CrashRecoveryContextImpl* to a thread-local variable for the "child" thread, but CrashRecoveryContext would erroneously clear it in the "parent" thread. The result was that if CrashRecoveryContext::RunSafelyOnThread was called again in the "child" thread it would mess up crash-recovery for its parent. A test for this will be added in the clang repository. rdar://14204560 llvm-svn: 184380
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-2/+2
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* move Signals to .rodataNuno Lopes2012-04-211-1/+1
| | | | llvm-svn: 155283
* Remove dead code. Improve llvm_unreachable text. Simplify some control flow.Ahmed Charles2012-02-191-1/+0
| | | | llvm-svn: 150918
* lib/Support/CrashRecoveryContext.cpp: Add Win32 support to ↵NAKAMURA Takumi2011-08-201-1/+67
| | | | | | CrashRecoveryContext. Thanks to Aaron Ballman! llvm-svn: 138199
* Properly initialize all fields in CrashReporterCleanupContext. This caused ↵Ted Kremenek2011-03-221-1/+1
| | | | | | the buildbot failure earlier. llvm-svn: 128071
* Temporarily stop recovering resources in CrashRecoveryContext while I ↵Ted Kremenek2011-03-221-1/+1
| | | | | | investigate further why this works on my machine and not on others. llvm-svn: 128065
* Provide a means for CrashRecovery clients to determine if code is currently ↵Ted Kremenek2011-03-211-0/+9
| | | | | | running while crash recovery cleanups are being processed. llvm-svn: 128008
* Tweak CrashRecoveryContextCleanup to provide an easy method for clients to ↵Ted Kremenek2011-03-191-0/+1
| | | | | | select between 'delete' and 'destructor' cleanups, and allow the destructor of CrashRecoveryContextCleanupRegister to be pseudo re-entrant. llvm-svn: 127929
* Tweak CrashRecoveryContext::GetCurrent() to return quickly if ↵Ted Kremenek2011-03-191-0/+3
| | | | | | | | 'gCrsahRecoveryEnabled' is false. This avoids us needing to go to thread local storage for the performance sensitive case where we are compiling code. llvm-svn: 127928
* Augment CrashRecoveryContext to have registered "cleanup" objects that can ↵Ted Kremenek2011-03-181-0/+38
| | | | | | be used to release resources during a crash. llvm-svn: 127849
* Merge System into Support.Michael J. Spencer2010-11-291-2/+2
| | | | llvm-svn: 120298
* CrashRecoveryContext: Add RunSafelyOnThread helper function.Daniel Dunbar2010-11-051-0/+23
| | | | llvm-svn: 118272
* CrashRecoveryContext: Add missing return, so that the signal fires after we ourDaniel Dunbar2010-10-181-0/+3
| | | | | | | routine is off the stack. Otherwise we show up rather confusingly in the stack trace. llvm-svn: 116755
* CrashRecovery: Clear the current context on the first crash, to avoid ↵Daniel Dunbar2010-08-171-0/+4
| | | | | | re-entering it if the cleanup code crashes. llvm-svn: 111309
* CrashRecovery: Add CrashRecoveryContext::GetCurrent(), so clients can find ↵Daniel Dunbar2010-08-171-2/+12
| | | | | | the active context from anywhere. llvm-svn: 111308
* CrashRecovery: Make CrashRecoveryContext static methods thread safe.Daniel Dunbar2010-08-171-0/+10
| | | | llvm-svn: 111307
* Fix -Wmissing-field-initializers warnings.Daniel Dunbar2010-07-301-15/+5
| | | | llvm-svn: 109872
* CrashRecovery: Use ThreadLocal::erase() instead of set(0).Daniel Dunbar2010-07-291-1/+1
| | | | llvm-svn: 109752
* Make sure to include config.h, to pickup LLVM_ON_WIN32.Daniel Dunbar2010-07-291-0/+1
| | | | llvm-svn: 109721
* CrashRecoveryContext: Add a simple POSIX implementation.Daniel Dunbar2010-07-291-1/+102
| | | | | | | | - This works, but won't handle crashes on stack overflow, or signals delivered to a thread other than the one that crashed. The latter is particular annoying on Darwin, because SIGABRT tends to go to the main thread. llvm-svn: 109717
* Support: Add CrashRecoveryContext helper object.Daniel Dunbar2010-07-281-0/+88
- Designed as a simple wrapper to allow clients to attempt to catch crashes (memory errors, assertion violations, etc.) and do some kind of recovery. - Currently doesn't actually attempt to catch crashes. llvm-svn: 109586
OpenPOWER on IntegriCloud