1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

31 Commits

Author SHA1 Message Date
Alexander Kornienko
12bc887fe5 Convenience/safety fix for llvm::sys::Execute(And|No)Wait
Summary:
Change the type of the Redirects parameter of llvm::sys::ExecuteAndWait,
ExecuteNoWait and other APIs that wrap them from `const StringRef **` to
`ArrayRef<Optional<StringRef>>`, which is safer and simplifies the use of these
APIs (no more local StringRef variables just to get a pointer to).

Corresponding clang changes will be posted as a separate patch.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: vsk, llvm-commits

Differential Revision: https://reviews.llvm.org/D37563

llvm-svn: 313155
2017-09-13 17:03:37 +00:00
David Blaikie
f873e2ec93 bugpoint: disabling symbolication of bugpoint-executed programs
Initial implementation - needs similar work/testing for other tools
bugpoint invokes (llc, lli I think, maybe more).

Alternatively (as suggested by chandlerc@) an environment variable could
be used. This would allow the option to pass transparently through user
scripts, pass to compilers if they happened to be LLVM-ish, etc.

I worry a bit about using cl::opt in the crash handling code - LLVM
might crash early, perhaps before the cl::opt is properly initialized?
Or at least before arguments have been parsed?

 - should be OK since it defaults to "pretty", so if the crash is very
 early in opt parsing, etc, then crash reports will still be symbolized.

I shyed away from doing this with an environment variable when I
realized that would require copying the existing environment and
appending the env variable of interest. But it seems there's no existing
LLVM API for accessing the environment (even the Support tests for
process launching have their own ifdefs for getting the environment). It
could be added, but seemed like a higher bar/untested codepath to
actually add environment variables.

Most importantly, this reduces the runtime of test/BugPoint/metadata.ll
in a split-dwarf Debug build from 1m34s to 6.5s by avoiding a lot of
symbolication. (this wasn't a problem for non-split-dwarf builds only
because the executable was too large to map into memory (due to bugpoint
setting a 400MB memory (including address space - not sure why? Going to
remove that) limit on the child process) so symbolication would fail
fast & wouldn't spend all that time parsing DWARF, etc)

Reviewers: chandlerc, dannyb

Differential Revision: https://reviews.llvm.org/D33804

llvm-svn: 305056
2017-06-09 07:29:03 +00:00
Chandler Carruth
eb66b33867 Sort the remaining #include lines in include/... and lib/....
I did this a long time ago with a janky python script, but now
clang-format has built-in support for this. I fed clang-format every
line with a #include and let it re-sort things according to the precise
LLVM rules for include ordering baked into clang-format these days.

I've reverted a number of files where the results of sorting includes
isn't healthy. Either places where we have legacy code relying on
particular include ordering (where possible, I'll fix these separately)
or where we have particular formatting around #include lines that
I didn't want to disturb in this patch.

This patch is *entirely* mechanical. If you get merge conflicts or
anything, just ignore the changes in this patch and run clang-format
over your #include lines in the files.

Sorry for any noise here, but it is important to keep these things
stable. I was seeing an increasing number of patches with irrelevant
re-ordering of #include lines because clang-format was used. This patch
at least isolates that churn, makes it easy to skip when resolving
conflicts, and gets us to a clean baseline (again).

llvm-svn: 304787
2017-06-06 11:49:48 +00:00
Kristof Beyls
2a0353c292 Remove name space pollution from Signals.cpp
llvm-svn: 299224
2017-03-31 14:58:52 +00:00
Richard Smith
f7f711ffaa Search for llvm-symbolizer binary in the same directory as argv[0], before
looking for it along $PATH. This allows installs of LLVM tools outside of
$PATH to find the symbolizer and produce pretty backtraces if they crash.

llvm-svn: 272232
2016-06-09 00:53:21 +00:00
NAKAMURA Takumi
8bac66d381 Appease hosts without HAVE_BACKTRACE nor ENABLE_BACKTRACES.
llvm/lib/Support/Signals.cpp:66:13: warning: unused function 'printSymbolizedStackTrace' [-Wunused-function]
  llvm/lib/Support/Signals.cpp:52:13: warning: function 'findModulesAndOffsets' has internal linkage but is not defined [-Wundefined-internal]

llvm-svn: 252418
2015-11-08 09:45:06 +00:00
Reid Kleckner
70302d1816 [Windows] Symbolize with llvm-symbolizer instead of dbghelp in a self-host
Summary:
llvm-symbolizer understands both PDBs and DWARF, so it is more likely to
succeed at symbolization. If llvm-symbolizer is unavailable, we will
fall back to dbghelp. This also makes our crash traces more similar
between Windows and Linux.

Reviewers: Bigcheese, zturner, chapuni

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D12884

llvm-svn: 252118
2015-11-05 01:07:54 +00:00
Yaron Keren
5a405f083b Rename RunCallBacksToRun to llvm::sys::RunSignalHandlers
And expose it in Signals.h, allowing clients to call it directly,
possibly LLVMErrorHandler which currently calls RunInterruptHandlers
but not RunSignalHandlers, thus for example not printing the stack
backtrace on Unixish OSes. On Windows it does happen because
RunInterruptHandlers ends up calling the callbacks as well via 
Cleanup(). This difference in behaviour and code structures in
*/Signals.inc should be patched in the future.

llvm-svn: 242936
2015-07-22 21:11:17 +00:00
Yaron Keren
023ce3f0ae De-duplicate Unix & Windows CallBacksToRun
Move CallBacksToRun into the common Signals.cpp, create RunCallBacksToRun()
and use these in both Unix/Signals.inc and Windows/Signals.inc.

Lots of potential code to be merged here.

llvm-svn: 242925
2015-07-22 19:01:14 +00:00
Chris Lattner
0304b82f80 Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!

llvm-svn: 129558
2011-04-15 05:18:47 +00:00
Michael J. Spencer
d5ec932c3a Merge System into Support.
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
Reid Spencer
3684d5e557 Signals support has been moved to lib/System
llvm-svn: 16097
2004-08-29 19:36:34 +00:00
Chris Lattner
0100ef2e24 It is not possible to catch SIGKILL, don't bother trying.
llvm-svn: 15496
2004-08-04 18:14:24 +00:00
Chris Lattner
a07e742087 Signals.h header moved. Eventually this should move into a lib/System library,
but not right now.

llvm-svn: 13811
2004-05-27 05:31:24 +00:00
Misha Brukman
642275dc4e `cat' is usually in /bin, not /usr/bin, at least on our systems.
llvm-svn: 11690
2004-02-21 21:51:41 +00:00
Chris Lattner
7448a9867b When printing a stack trace, demangle it if possible. Since we are potentially
in a signal handler, allocating memory or doing other unsafe things is bad,
which means we should do it in a different process.

llvm-svn: 11689
2004-02-21 21:06:19 +00:00
Brian Gaeke
688940d763 Use backtrace() and include execinfo.h, if they were detected by autoconf.
llvm-svn: 11658
2004-02-20 06:40:59 +00:00
Chris Lattner
0d3df27b4c Disable the stack trace thing until we can get an autoconf test for it. This
call breaks on sparcs

llvm-svn: 11635
2004-02-19 21:21:23 +00:00
Chris Lattner
6deffd7154 Implement new function
llvm-svn: 11631
2004-02-19 20:03:14 +00:00
Alkis Evlogimenos
fbaf7b3944 Print stacktrace in STDERR before dying on a fatal signal. Currently
the symbols are not demangled.

llvm-svn: 11620
2004-02-19 07:36:35 +00:00
Chris Lattner
2fdf5e32aa Finegrainify namespacification
llvm-svn: 10464
2003-12-14 21:35:53 +00:00
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
John Criswell
b402729b30 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.

llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Misha Brukman
ed4039f715 Fixed spelling & grammar.
llvm-svn: 8559
2003-09-16 15:31:46 +00:00
Chris Lattner
346760c6cb Move #include from a header to here
llvm-svn: 7480
2003-08-01 19:16:29 +00:00
John Criswell
258dfc0319 Merged in autoconf branch. This provides configuration via the autoconf
system.

llvm-svn: 7014
2003-06-30 21:59:07 +00:00
Chris Lattner
6796f5a374 Make _sure_ we don't go into an infinite loop if a signal happens!
llvm-svn: 6351
2003-05-27 16:25:04 +00:00
Chris Lattner
6751acb59b Add using declarations
llvm-svn: 6305
2003-05-22 21:59:35 +00:00
Chris Lattner
73f4e09752 Submitted by Casey Carter:
ISSUE: Linux doesn't have any steenking SIGEMT signal, as referred to in
lib/Support/Signals.cpp.

ACTION: Wrap the use with a #ifdef SIGEMT / #endif.
llvm-svn: 3700
2002-09-13 14:57:24 +00:00
Anand Shukla
ee7ed50bb4 changes to make it compatible with 64bit gcc
llvm-svn: 2791
2002-06-25 20:55:50 +00:00
Chris Lattner
37c9e90c89 Add new api for basic signal handling for tools
llvm-svn: 2302
2002-04-18 19:53:53 +00:00