summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/PrettyStackTrace.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix the preprocessor checks used to determine if backtraces have been enabled.Owen Anderson2015-01-291-6/+6
| | | | llvm-svn: 227424
* Use the existing build configuration parameter ENABLE_BACKTRACE to compile ↵Owen Anderson2015-01-291-0/+16
| | | | | | | | | | out all pretty stack trace support when backtraces are disabled. This has the nice secondary effect of allowing LLVM to continue to build for targets without __thread or thread_local support to continue to work so long as they build without support for backtraces. llvm-svn: 227423
* [LPM] Clean up the use of TLS in pretty stack trace and disable itChandler Carruth2015-01-291-20/+2
| | | | | | | | | | | | | | | | | | | | | entirely when threads are not enabled. This should allow anyone who needs to bootstrap or cope with a host loader without TLS support to limp along without threading support. There is still some bug in the PPC TLS stuff that is not worked around. I'm getting access to a machine to reproduce and debug this further. There is some chance that I'll have to add a terrible workaround for PPC. There is also some problem with iOS, but I have no ability to really evaluate what the issue is there. I'm leaving it to folks maintaining that platform to suggest a path forward -- personally I don't see any useful path forward that supports threading in LLVM but does so without support for *very basic* TLS. Note that we don't need more than some pointers, and we don't need constructors, destructors, or any of the other fanciness which remains widely unimplemented. llvm-svn: 227411
* [LPM] Fix the PPC attribute to be spelled 'global-dynamic'. This shouldChandler Carruth2015-01-281-2/+2
| | | | | | let the build bot make finish compiling stage2. llvm-svn: 227391
* [LPM] Try to work around a bug with local-dynamic TLS on PowerPC 64.Chandler Carruth2015-01-281-5/+18
| | | | | | | | | | | | | | | | Sadly, this precludes optimizing it down to initial-exec or local-exec when statically linking, and in general makes the code slower on PPC 64, but there's nothing else for it until we can arrange to produce the correct bits for the linker. Lots of thanks to Ulirch for tracking this down and Bill for working on the long-term fix to LLVM so that we can relegate this to old host clang versions. I'll be watching the PPC build bots to make sure this effectively revives them. llvm-svn: 227352
* [LPM] Rip all of ManagedStatic and ThreadLocal out of the pretty stackChandler Carruth2015-01-281-21/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tracing code. Managed static was just insane overhead for this. We took memory fences and external function calls in every path that pushed a pretty stack frame. This includes a multitude of layers setting up and tearing down passes, the parser in Clang, everywhere. For the regression test suite or low-overhead JITs, this was contributing to really significant overhead. Even the LLVM ThreadLocal is really overkill here because it uses pthread_{set,get}_specific logic, and has careful code to both allocate and delete the thread local data. We don't actually want any of that, and this code in particular has problems coping with deallocation. What we want is a single TLS pointer that is valid to use during global construction and during global destruction, any time we want. That is exactly what every host compiler and OS we use has implemented for a long time, and what was standardized in C++11. Even though not all of our host compilers support the thread_local keyword, we can directly use the platform-specific keywords to get the minimal functionality needed. Provided this limited trial survives the build bots, I will move this to Compiler.h so it is more widely available as a light weight if limited alternative to the ThreadLocal class. Many thanks to David Majnemer for helping me think through the implications across platforms and craft the MSVC-compatible syntax. The end result is *substantially* faster. When running llc in a tight loop over a small IR file targeting the aarch64 backend, this improves its performance by over 10% for me. It also seems likely to fix the remaining regressions seen by JIT users with threading enabled. This may actually have more impact on real-world compile times due to the use of the pretty stack tracing utility throughout the rest of Clang or LLVM, but I've not collected any detailed measurements. llvm-svn: 227300
* [C++11] Replace some comparisons with 'nullptr' with simple boolean checks ↵Craig Topper2014-04-091-1/+1
| | | | | | to reduce verbosity. llvm-svn: 205829
* [C++11] Make use of 'nullptr' in the Support library.Craig Topper2014-04-071-2/+2
| | | | llvm-svn: 205697
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-071-1/+1
| | | | | | | | | | 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. llvm-svn: 198685
* Make the pretty stack trace be an opt-in, rather than opt-out, facility. ↵Filip Pizlo2013-11-041-16/+13
| | | | | | | | | Enable pretty stack traces by default if you use PrettyStackTraceProgram, so that existing LLVM-based tools will continue to get it without any changes. llvm-svn: 193971
* When LLVM is embedded in a larger application, it's not OK for LLVM to ↵Filip Pizlo2013-11-031-0/+5
| | | | | | | | intercept crashes. LLVM already has the ability to disable this functionality. This patch exposes it via the C API. llvm-svn: 193937
* Make PrettyStackTraceEntry use ManagedStatic for its ThreadLocal.Filip Pizlo2013-09-131-8/+20
| | | | | | | | | | This was somewhat tricky because ~PrettyStackTraceEntry() may run after llvm_shutdown() has been called. This is rare and only happens for a common idiom used in the main() functions of command-line tools. This works around the idiom by skipping the stack clean-up if the PrettyStackTraceHead ManagedStatic is not constructed (i.e. llvm_shutdown() has been called). llvm-svn: 190730
* Add a new watchdog timer interface. The interface does not permit handling ↵Nick Lewycky2013-03-261-1/+5
| | | | | | | | | timeouts, so it's only really useful if you're going to crash anyways. Use it in the pretty stack trace printer to kill the compiler if we hang while printing the stack trace. llvm-svn: 177962
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-3/+3
| | | | | | | | | | | | | | | | | 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
* Add more initializers to quiet a clang warning.Eric Christopher2011-10-051-1/+1
| | | | llvm-svn: 141163
* Fix a ton of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129558
* Change all self assignments X=X to (void)X, so that we can turn on aJeffrey Yasskin2010-12-231-2/+1
| | | | | | | new gcc warning that complains on self-assignments and self-initializations. llvm-svn: 122458
* Apparently OS X 10.4 doesn't have __crashreporter_info__.Eric Christopher2010-12-031-5/+5
| | | | | | Try to fix building on the wayback machine. llvm-svn: 120801
* Merge System into Support.Michael J. Spencer2010-11-291-2/+2
| | | | llvm-svn: 120298
* Fix a couple of warnings.Eric Christopher2010-08-081-2/+3
| | | | llvm-svn: 110527
* Fix thinko.Eric Christopher2010-06-281-2/+4
| | | | llvm-svn: 107042
* Pull in the libCrashReporterClient.a information with a warning comment.Eric Christopher2010-06-281-2/+9
| | | | | | Remove library check and regenerate configure. llvm-svn: 107028
* Look for and use a different darwin crash reporter library.Eric Christopher2010-06-221-1/+11
| | | | llvm-svn: 106576
* Fix __crashreport_info__ declaration.Daniel Dunbar2010-05-201-2/+2
| | | | llvm-svn: 104300
* Switch to SmallString::str from SmallString::c_str, and removeDaniel Dunbar2009-08-191-2/+2
| | | | | | SmallString::c_str. llvm-svn: 79456
* add a knob to turn off PrettyStackTrace globally. Patch by ZoltanChris Lattner2009-07-161-1/+6
| | | | | | Varga! llvm-svn: 75897
* Support thread-local pretty stack traces.Owen Anderson2009-06-251-7/+8
| | | | llvm-svn: 74227
* Now that errs() is properly non-buffered, there's no need toDan Gohman2009-03-231-1/+0
| | | | | | explicitly flush it. llvm-svn: 67526
* Use c_str() to force the string to be nul-terminated.Dan Gohman2009-03-061-1/+1
| | | | llvm-svn: 66279
* on apple systems, integrate nicely with crash reporter.Chris Lattner2009-03-061-4/+34
| | | | llvm-svn: 66264
* Daniel wanted the stack printed upside down. Perhaps heChris Lattner2009-03-051-6/+14
| | | | | | | | | | | | | feels a kinship to machine stacks that grow down. Now we get stuff like this: Stack dump: 0. Program arguments: clang clang_crash_Iw2Osj.mi 1. /Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1/include/xmmintrin.h:624:1: parsing function body '_mm_cvtpi16_ps' 2. /Developer/SDKs/MacOSX10.5.sdk/usr/lib/gcc/i686-apple-darwin9/4.0.1/include/xmmintrin.h:624:1: in compound statement ('{}') Abort llvm-svn: 66145
* indicate what the program args line is.Chris Lattner2009-03-051-1/+3
| | | | llvm-svn: 66144
* add some helper classes for building light-weight symbolic stack tracesChris Lattner2009-03-041-0/+69
that get printed when a program crashes. This is the first step of many. llvm-svn: 66076
OpenPOWER on IntegriCloud