1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00
Commit Graph

467 Commits

Author SHA1 Message Date
Chris Lattner
0743280d7a move some code to gracefully handle the case when a handler crashes.
llvm-svn: 66171
2009-03-05 18:22:14 +00:00
Chris Lattner
faf39c40d4 Add a new 'AddSignalHandler' function to Signals.h that allows
arbitrary functions to be run when a crash happens.  Delete 
RemoveDirectoryOnSignal as it is dead and has never had clients.

Change PrintStackTraceOnErrorSignal to be implemented in terms of
AddSignalHandler.

I updated the Win32 versions of these APIs, but can't test them.
If there are any problems, I'd be happy to fix them as well.

llvm-svn: 66072
2009-03-04 21:21:36 +00:00
Chris Lattner
492d973ba0 Fix main executable path name resolution on FreeBSD, patch by
Ed Schouten!

llvm-svn: 65882
2009-03-02 22:17:15 +00:00
Chris Lattner
2683c5bc9a If an executable is run through a symlink, dladdr will return the
symlink.  We really want the ultimate executable being run, not
the symlink.  This lets clang find its headers when invoked through
a symlink. rdar://6602012

llvm-svn: 65017
2009-02-19 05:34:35 +00:00
Mikhail Glushenkov
5310c3cd6e Fix warning on gcc 4.3.
"system() declared with attribute warn_unused_result."

llvm-svn: 64574
2009-02-15 03:20:32 +00:00
Mikhail Glushenkov
95811401b0 Whitespace fixes.
llvm-svn: 64573
2009-02-15 03:20:03 +00:00
Cedric Venet
48be6b5e15 Unbreak the build on win32.
Cleanup some warning.

Remark: when struct/class are declared differently than they are defined, this make problem for VC++ since it seems to mangle class differently that struct. These error are very hard to understand and find. So please, try to keep your definition/declaration in sync.

Only tested with VS2008. hope it does not break anything. feel free to revert.

llvm-svn: 64554
2009-02-14 16:06:42 +00:00
Julien Lerouge
37d198e8f9 Fix MingW build, patch by Kenneth Boyd!
llvm-svn: 64366
2009-02-12 07:39:10 +00:00
Dan Gohman
6a9be2e4ea Use const, to support platforms where strrchr returns a const char *.
This fixes PR3535.

llvm-svn: 64224
2009-02-10 17:56:28 +00:00
Mikhail Glushenkov
d9f64e601f Add a Sleep() function.
llvm-svn: 64101
2009-02-08 22:47:39 +00:00
Mikhail Glushenkov
ef0291beda Add Emacs hints to Alarm.inc.
Also removes some trailing whitespace and fixes one 80-column violation.

llvm-svn: 64094
2009-02-08 21:10:57 +00:00
Chris Lattner
0478798632 Fix windows build, patch by Marius Wachtler!
llvm-svn: 63325
2009-01-29 18:53:28 +00:00
Chris Lattner
d5591247d1 Fix PR3424, a static constructor ordering issue. Patch by Robert Schuster!
llvm-svn: 63269
2009-01-29 04:43:42 +00:00
Chris Lattner
da545d3918 rename methods in System/Host to be more consistent.
llvm-svn: 62776
2009-01-22 19:53:00 +00:00
Misha Brukman
71c7e40966 Removed trailing whitespace from Makefiles.
llvm-svn: 61991
2009-01-09 16:44:42 +00:00
Dan Gohman
e2ee41d1d1 Don't use plain %x to print pointer values. I had changed it from %p
since %p isn't formatted consistently, but obviously plain %x is wrong.
PRIxPTR with a cast to uintptr_t would work here, but that requires
inconvenient build-system changes. %lu works on all current and
foreseable future hosts.

llvm-svn: 60616
2008-12-05 23:39:24 +00:00
Dan Gohman
5e30c5b83b Demangle and pretty-print symbols in internal backtraces. Patch by
Wesley Peck, with a few fixes by me.

llvm-svn: 60605
2008-12-05 20:12:48 +00:00
Evan Cheng
c6f581034a ARM / Mac OS X also wants to invalidate icache after jitting.
llvm-svn: 59291
2008-11-14 02:33:17 +00:00
Oscar Fuentes
dc2008cb1a CMake: when bulding shared libraries on non-WIN32 systems, link dl to
LLVMSystem.

llvm-svn: 59159
2008-11-12 20:40:56 +00:00
Nuno Lopes
e5fb2e4d84 plug leakage of mutex data. pthread_mutex_destroy() doesnt free our malloc'ed memory.
llvm-svn: 58805
2008-11-06 16:21:49 +00:00
Evan Cheng
0369860450 hasDisassembler should return false if disassembler isn't available.
llvm-svn: 58682
2008-11-04 06:09:38 +00:00
Anton Korobeynikov
9e3342fcdf Silence a warning
llvm-svn: 58563
2008-11-02 11:47:11 +00:00
Jim Grosbach
1de8b23129 Update the stub and callback code to handle lazy compilation. The stub
is re-written by the callback to branch directly to the compiled code
in future invocations.

Added back in range-based memory permission functions for the updating of
the stub on Darwin.

llvm-svn: 57846
2008-10-20 21:39:23 +00:00
Duncan Sands
8f296a3788 Add <cstdio> include where needed by gcc-4.4.
Patch by Samuel Tardieu.

llvm-svn: 57291
2008-10-08 07:23:46 +00:00
Argyrios Kyrtzidis
8614f628d2 Add implementations for sys::Memory::setWritable and sys::Memory::setExecutable on Win32 platform.
llvm-svn: 57047
2008-10-04 08:15:32 +00:00
Jim Grosbach
a49386d8e7 On Darwin ARM, memory needs special handling to do JIT. This patch expands
this handling to work properly for modifying stub functions, relocations
back to entry points after JIT compilation, etc..

llvm-svn: 57013
2008-10-03 16:17:20 +00:00
Oscar Fuentes
c1d88c3b68 CMake: Added Host.cpp to lib/System/CMakeLists.txt.
llvm-svn: 56957
2008-10-02 17:39:29 +00:00
Daniel Dunbar
1fab10702e Add llvm::sys::{osName,osVersion} for retrieving operating system name
& version as strings.
 - Win32 code is untested.

llvm-svn: 56942
2008-10-02 01:17:28 +00:00
Oscar Fuentes
0f25988689 Initial support for the CMake build system.
llvm-svn: 56419
2008-09-22 01:08:49 +00:00
Evan Cheng
a0459a1c5a Preliminary support for systems which require changing JIT memory regions privilege from read / write to read / executable.
llvm-svn: 56303
2008-09-18 07:54:21 +00:00
Evan Cheng
f80fc084ef AllocateRWXMemory -> AllocateRWX.
llvm-svn: 56244
2008-09-16 17:28:18 +00:00
Chris Lattner
0e03352a9f add a helper method to sys::Path for clang, patch by
Kovarththanan Rajaratnam!

llvm-svn: 54655
2008-08-11 23:39:47 +00:00
Devang Patel
fb1364b2b5 Create temp. file in current path.
llvm-svn: 53973
2008-07-24 00:35:38 +00:00
Devang Patel
4057e8691a While creating temp. file on disk, if the current filename points to a existing directory then create new temp. file inside the directory.
llvm-svn: 53929
2008-07-22 20:02:39 +00:00
Devang Patel
86c593ff1d Handle bitcode wrappers.
llvm-svn: 53924
2008-07-22 18:00:36 +00:00
Chris Lattner
5e57a12a80 open plugins with RTLD_GLOBAL, pointed out by Bram Adams.
llvm-svn: 53385
2008-07-10 00:52:20 +00:00
Chris Lattner
b650adae49 Add a little wrapper header that is put around bc files when emitting
bc files for modules with a target triple that indicates they are for
darwin.  The reader unconditionally handles this, and the writer could
turn this on for more targets if we care.

This change has two benefits for darwin:

1) it allows us to encode the cpu type of the file in an easy to read
   place that doesn't require decoding the bc file.
2) it works around a bug (IMO) in darwin's AR where it is incapable of
   handling files that are not a multiple of 8 bytes long.  BC files
   are only guaranteed to be multiples of 4 bytes long.

llvm-svn: 53275
2008-07-09 05:14:23 +00:00
Seo Sanghyeon
12944690d5 Fix GetMainExecutable. Patch by Sam Bishop.
llvm-svn: 52847
2008-06-27 22:55:30 +00:00
Matthijs Kooijman
b1217bdbb0 Make LLVM compile on DragonFly BSD (PR2499).
Patch by Hasso Tepper!

llvm-svn: 52781
2008-06-26 10:36:58 +00:00
Bill Wendling
2d9397ea16 Cleanup for unitialized types. Patch by Jean-Daniel Dupas!
llvm-svn: 52775
2008-06-26 08:32:05 +00:00
Chris Lattner
d67c47bc62 "An improved Mach-O file type detection for sys::IdentifyFileType()
This patch add supports for single architecture mach-o files (the current implementation only support Universal Binary), and solve the signature conflict between java class and Universal Binary magics.

Note that this function will always returned dynamic library for Universal Binaries (like the current implementation) because the binary type is not include in the file header."

Patch by Jean-Daniel Dupas!

llvm-svn: 52766
2008-06-26 05:17:18 +00:00
Chris Lattner
a42eed01e2 fix compilation errors in my previous patch
llvm-svn: 52733
2008-06-25 17:17:53 +00:00
Chris Lattner
24c59453f6 Add a new InvalidateInstructionCache method to sys::Memory.
llvm-svn: 52731
2008-06-25 17:14:10 +00:00
Dan Gohman
9b9cf4cf9c Use static_cast instead of reinterpret_cast for casting void*.
llvm-svn: 52592
2008-06-21 20:17:03 +00:00
Argyrios Kyrtzidis
65f671fd74 Minor comment fix.
llvm-svn: 52312
2008-06-16 10:14:09 +00:00
Wojciech Matyjewicz
0f03682725 Add a missing semicolon.
llvm-svn: 52290
2008-06-15 18:02:47 +00:00
Argyrios Kyrtzidis
6f81329b15 Fix the sys::Path::getSuffix() implementation.
llvm-svn: 52288
2008-06-15 15:15:19 +00:00
Argyrios Kyrtzidis
121cf54264 Fix the environment block that is passed to the CreateProcess function.
This bug made llvm-ld unable to function with "-native" option, since the process that was used to call 'gcc' was crashing.

llvm-svn: 52284
2008-06-15 03:54:39 +00:00
Matthijs Kooijman
43eae10af6 Fix redirection of stderr in sys::Program::ExecuteAndWait. There was logic
error that caused it to redirect stderr to stdout too often.

This fix is applied identically to the win32 code as well, but that is
untested.
--Thi line, and those below, will be ignored--

M    System/Unix/Program.inc
M    System/Win32/Program.inc

llvm-svn: 52233
2008-06-12 12:53:35 +00:00
Matthijs Kooijman
f2d854e34b Make I/O redirection handling in sys::Program a bit more consistent. No
functional changes. Win32 code is untested, but should work fine.

In the unix variant, rename RedirectFD to RedirectIO and let that function
handle empty and null paths instead of doing that in the caller 3 times. This
is the same as win32 already does it.

In the win32 variant, use Path::isEmpty() instead of checking the resulting
c_str() manually. This is the same as unix already does it.

llvm-svn: 52230
2008-06-12 10:47:18 +00:00