summaryrefslogtreecommitdiff
path: root/lib/Support/ErrorHandling.cpp
Commit message (Collapse)AuthorAge
* Merge lib/Support/WindowsError.cpp into ib/Support/ErrorHandling.cpp.Rafael Espindola2014-06-17
| | | | | | | The OSX ranlib warns on files with no symbols, and lib/Support/WindowsError.cpp was empty when building on non-windows. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211118 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the error-handling functions thread-safe.Zachary Turner2014-06-13
| | | | | | | | | | | | | Prior to this change, error handling functions must be installed and removed only inside of an llvm_[start/stop]_multithreading pair. This change allows error handling functions to be installed any time, and from any thread. Reviewed by: chandlerc Differential Revision: http://reviews.llvm.org/D4140 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210937 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Remove support for runtime multi-threading."Zachary Turner2014-06-10
| | | | | | This reverts revision r210600. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210603 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove support for runtime multi-threading.Zachary Turner2014-06-10
| | | | | | | | | | | | | | | | | | | | | This patch removes the functions llvm_start_multithreaded() and llvm_stop_multithreaded(), and changes llvm_is_multithreaded() to return a constant value based on the value of the compile-time definition LLVM_ENABLE_THREADS. Previously, it was possible to have compile-time support for threads on, and runtime support for threads off, in which case certain mutexes were not allocated or ever acquired. Now, if the build is created with threads enabled, mutexes are always acquired. A test before/after patch of compiling a very large TU showed no noticeable performance impact of this change. Reviewers: rnk Differential Revision: http://reviews.llvm.org/D4076 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210600 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Make use of 'nullptr' in the Support library.Craig Topper2014-04-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205697 91177308-0d34-0410-b5e6-96231b3b80d8
* Roll back the ConstStringRef change for nowAlp Toker2014-01-27
| | | | | | | | | | | There are a couple of interesting things here that we want to check over (particularly the expecting asserts in StringRef) and get right for general use in ADT so hold back on this one. For clang we have a workable templated solution to use in the meanwhile. This reverts commit r200187. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200194 91177308-0d34-0410-b5e6-96231b3b80d8
* StringRef: Extend constexpr capabilities and introduce ConstStringRefAlp Toker2014-01-27
| | | | | | | | | | | | | | | | | | | (1) Add llvm_expect(), an asserting macro that can be evaluated as a constexpr expression as well as a runtime assert or compiler hint in release builds. This technique can be used to construct functions that are both unevaluated and compiled depending on usage. (2) Update StringRef using llvm_expect() to preserve runtime assertions while extending the same checks to static asserts in C++11 builds that support the feature. (3) Introduce ConstStringRef, a strong subclass of StringRef that references compile-time constant strings. It's convertible to, but not from, ordinary StringRef and thus can be used to add compile-time safety to various interfaces in LLVM and clang that only accept fixed inputs such as diagnostic format strings that tend to get misused. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200187 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-07
| | | | | | | | | | subsequent changes are easier to review. About to fix some layering issues, and wanted to separate out the necessary churn. Also comment and sink the include of "Windows.h" in three .inc files to match the usage in Memory.inc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198685 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r194865 and r194874.Alexey Samsonov2013-11-18
| | | | | | | | | | | | | This change is incorrect. If you delete virtual destructor of both a base class and a subclass, then the following code: Base *foo = new Child(); delete foo; will not cause the destructor for members of Child class. As a result, I observe plently of memory leaks. Notable examples I investigated are: ObjectBuffer and ObjectBufferStream, AttributeImpl and StringSAttributeImpl. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194997 91177308-0d34-0410-b5e6-96231b3b80d8
* [weak vtables] Remove a bunch of weak vtablesJuergen Ributzka2013-11-15
| | | | | | | | | | | This patch removes most of the trivial cases of weak vtables by pinning them to a single object file. Differential Revision: http://llvm-reviews.chandlerc.com/D2068 Reviewed by Andy git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194865 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the -Werror -Wpedantic clang selfhost buildAlp Toker2013-10-22
| | | | | | | | This is a stopgap fix for cast warnings introduced in r192864. A proper fix should be investigated by the author when possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193160 91177308-0d34-0410-b5e6-96231b3b80d8
* Expose install_fatal_error_handler() through the C API.Filip Pizlo2013-10-17
| | | | | | | | | | | | | | | | | | | I expose the API with some caveats: - The C++ API involves a traditional void* opaque pointer for the fatal error callback. The C API doesn’t do this. I don’t think that the void* opaque pointer makes any sense since this is a global callback - there will only be one of them. So if you need to pass some data to your callback, just put it in a global variable. - The bindings will ignore the gen_crash_diag boolean. I ignore it because (1) I don’t know what it does, (2) it’s not documented AFAIK, and (3) I couldn’t imagine any use for it. I made the gut call that it probably wasn’t important enough to expose through the C API. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192864 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support] Fix some warnings when self-hosting clang on WindowsReid Kleckner2013-07-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186413 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a boolean parameter to the llvm::report_fatal_error() function to indicatedChad Rosier2013-03-27
| | | | | | | | if crash diagnostics should be generated. By default this is enabled. Part of rdar://13296693 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178161 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-03
| | | | | | | | | | | | | | | | | 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. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 167755/167760. We don't want to emit crash diagnostics on ↵Chad Rosier2012-11-13
| | | | | | command-line syntax errors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167849 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r167620; this can be implemented using an existing CL option.Chad Rosier2012-11-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167755 91177308-0d34-0410-b5e6-96231b3b80d8
* Like the coding standards say, do not use "using namespace std".Jay Foad2011-04-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130054 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
* report_fatal_error: Simplify a possible ambiguity.Daniel Dunbar2010-11-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118972 91177308-0d34-0410-b5e6-96231b3b80d8
* Some versions of gcc still warn about "ignoring return value ... declaredDuncan Sands2010-09-16
| | | | | | | with attribute warn_unused_result" here - suppress the warning harder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114072 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy.Dan Gohman2010-08-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111432 91177308-0d34-0410-b5e6-96231b3b80d8
* include config.h to get config params, hopefully unbreaking mingw builder.Chris Lattner2010-08-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111325 91177308-0d34-0410-b5e6-96231b3b80d8
* report_fatal_error can't use errs(), because errs() can call Chris Lattner2010-08-17
| | | | | | | | into report_fatal_error. Just blast the string to stderr with write(2) and hope for the best! Part of rdar://8318441 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111320 91177308-0d34-0410-b5e6-96231b3b80d8
* Run interrupt routines as part of report_fatal_error, since we are failingDaniel Dunbar2010-05-08
| | | | | | ungracefully. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103334 91177308-0d34-0410-b5e6-96231b3b80d8
* rename llvm_install_error_handler -> install_fatal_error_handlerChris Lattner2010-04-07
| | | | | | | and friends. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100717 91177308-0d34-0410-b5e6-96231b3b80d8
* rename llvm::llvm_report_error -> llvm::report_fatal_errorChris Lattner2010-04-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100709 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix minor style issues.Dan Gohman2010-03-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99414 91177308-0d34-0410-b5e6-96231b3b80d8
* Change errs() to dbgs().David Greene2010-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92637 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a comment explaining why llvm_unreachable_internal doesn't callDan Gohman2009-08-20
| | | | | | | the ErrorHandler callback. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79541 91177308-0d34-0410-b5e6-96231b3b80d8
* This void is implicit in C++.Dan Gohman2009-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78848 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for a user supplied pointer argument to llvm_install_error_handler.Daniel Dunbar2009-08-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78553 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow llvm_report_error to accept a Twine.Daniel Dunbar2009-07-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76961 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-14
| | | | | | | | | | This adds location info for all llvm_unreachable calls (which is a macro now) in !NDEBUG builds. In NDEBUG builds location info and the message is off (it only prints "UREACHABLE executed"). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75640 91177308-0d34-0410-b5e6-96231b3b80d8
* After converting assert(0) to LLVM_UNREACHABLE we lost file/line location.Torok Edwin2009-07-14
| | | | | | | | Fix by making the LLVM_UNREACHABLE pass __FILE__ and __LINE__ to llvm_unreachable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75631 91177308-0d34-0410-b5e6-96231b3b80d8
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-11
| | | | | | | | | | Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix braces.Torok Edwin2009-07-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74923 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce new error handling API.Torok Edwin2009-07-07
This will replace exit()/abort() style error handling with an API that allows clients to register custom error handling hooks. The default is to call exit(1) when no error handler is provided. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74922 91177308-0d34-0410-b5e6-96231b3b80d8