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

495 Commits

Author SHA1 Message Date
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
Anton Korobeynikov
3e9eeaf6c9 Provide hooks for libgcc symbols' address resolution inside lli on mingw32.
Patch by Julien Lerouge!

llvm-svn: 52037
2008-06-06 07:20:07 +00:00
Bill Wendling
bcd38344b9 Unbreak build.
llvm-svn: 51709
2008-05-29 22:02:08 +00:00
Bill Wendling
2ba98ca60f Remove more iostream header includes. Needed to implement a "FlushStream"
function to flush a specified std::ostream.

llvm-svn: 51705
2008-05-29 21:46:33 +00:00
Bill Wendling
7ec2aad450 Follow-up to the reverting of r51218. This puts the checks out-of-line. Because
they aren't in the header file, systems with a <string> header file that isn't
64-bit clean shouldn't warn if #including Path.h and specifying
-Wshorten-64-to-32.

llvm-svn: 51393
2008-05-21 21:20:07 +00:00
Dan Gohman
fe628b229c Make PreVerifyID, IntSigsEnd, and KillSigsEnd const.
llvm-svn: 51088
2008-05-14 00:42:30 +00:00
Dan Gohman
bab18cae46 Clean up the use of static and anonymous namespaces. This turned up
several things that were neither in an anonymous namespace nor static
but not intended to be global.

llvm-svn: 51017
2008-05-13 00:00:25 +00:00
Nick Lewycky
6bc321fbdf Make constructors target-specific. This fixes problems where the path would
include backslashes on Windows. This should fix llvm-ld problems on win32.

llvm-svn: 50960
2008-05-11 17:37:40 +00:00
Nick Lewycky
2121ef05f4 Fix renamePathOnDisk on Win32, patch from David Leon. This fixes problems with
llvm-ar being unable to rename files.

llvm-svn: 50702
2008-05-06 03:42:21 +00:00
Dan Gohman
a84b75df17 Remove uses of llvm/System/IncludeFile.h that are no longer needed.
llvm-svn: 50695
2008-05-06 01:32:53 +00:00
Evan Cheng
d9353009b7 Fix more -Wshorten-64-to-32 warnings.
llvm-svn: 50659
2008-05-05 18:30:58 +00:00
Nate Begeman
17ad231324 Restore code to disable crash catcher on older OS X systems
llvm-svn: 49568
2008-04-12 00:47:46 +00:00
Dan Gohman
26c2127be9 Make several symbols static.
llvm-svn: 49496
2008-04-10 21:11:47 +00:00
Ted Kremenek
be2279d470 Make getDirnameSep a static method (not part of Path's interface).
llvm-svn: 49354
2008-04-07 22:01:32 +00:00
Ted Kremenek
82b7e8d306 Added method Path::getDirname().
llvm-svn: 49352
2008-04-07 21:53:57 +00:00
Ted Kremenek
1a9c18b50d Re-implemented Path::createDirectoryOnDisk (for Unix).
This method allows one to create a directory, and optionally create all parent
directories that do not exist.

The original implementation would require that *all* directories along a path
are writable by the user, including directories that already exist. For example,
suppose we wanted to create the directory "/tmp/foo/bar", and the directory
"/tmp" already exists, but not "/tmp/foo". Since "/tmp" is writable by all
users, the original implementation would work, and create "/tmp/foo", followed
by "/tmp/bar".

A problem occurred, however if one wanted to created the directory
"/Users/myuser/bar" (or equivalently "/home/myuser/bar"), and "/Users/myuser"
already existed and is writable by the current user. The directory
"/User/myuser" is writable by the user, but "/User" is not. The original
implementation of createDirectoryOnDisk would return with failure since "/User"
is not writable, even though "/User/mysuser" is writable.

The new implementation works by recursively creating parents as needed, and thus
doesn't need to check the permissions on every directory in a path.

llvm-svn: 49162
2008-04-03 16:11:31 +00:00
Chris Lattner
0dc7a8221d add some #includes.
llvm-svn: 49036
2008-04-01 06:25:23 +00:00
Chris Lattner
4614369b45 MappedFile is dead, remove it.
llvm-svn: 49035
2008-04-01 06:20:44 +00:00
Chris Lattner
3e9e5f498e Implement Path::MapInFilePages/UnMapFilePages on unix, which
provides fast MappedFile::getFile for large files.

llvm-svn: 49034
2008-04-01 06:16:24 +00:00
Chris Lattner
2e3d2c6ec8 Stub out some sys::Path::MapInFilePages/UnMapFilePages methods.
llvm-svn: 49030
2008-04-01 06:00:12 +00:00
Chris Lattner
0ee9b20a1b Make MappedFile::map return a const correct pointer, don't leak address space on Unix platforms.
llvm-svn: 49026
2008-04-01 03:49:38 +00:00
Chris Lattner
f2309c208a Remove MappedFile support for mapping files for write and exec
and shared.  This complicates the design, is not used, and probably
doesn't even work.

llvm-svn: 49022
2008-04-01 03:10:22 +00:00
Chris Lattner
c3d03d3f10 cleanup the MappedFile API and comments. This removes and updates
tons of out of date comments (really nothing throws here!) and fixes
some other fairly glaring issues: "size" used to return the size of 
the file *and* change it, depending on how you called it.

llvm-svn: 49009
2008-04-01 00:53:25 +00:00
Chris Lattner
a0b425c6bc remove DEFINING_FILE_FOR for MappedFile.h
llvm-svn: 49008
2008-04-01 00:35:55 +00:00
Nate Begeman
68c767cb5c Actually disable crash reporting on Mac OS X, returning bugpoint to speedy
crash miscompilations.

llvm-svn: 49000
2008-03-31 22:19:25 +00:00
Owen Anderson
e540be453a Revert r48676. I had plans for using it, but now it's just dead code.
llvm-svn: 48743
2008-03-24 21:29:58 +00:00
Owen Anderson
de2d3aca1b Add a comment, and fix a bug where AllocateRW recurred to AllocateRWX instead of itself.
llvm-svn: 48677
2008-03-22 02:59:54 +00:00
Owen Anderson
5654dda62c Add an AllocateRW to match AllocateRWX.
llvm-svn: 48676
2008-03-22 02:33:53 +00:00
Dan Gohman
63ef3bbba0 Avoid calling array_endof in a static initializer, as it incurs
dynamic initialization.

llvm-svn: 48666
2008-03-21 23:44:21 +00:00
Dan Gohman
479c8ef76d Specialize FORCE_DEFINING_FILE_TO_BE_LINKED using a GCC trick
to avoid using constructor calls for static objects. This reduces
the number of objects requiring static constructors in a typical
LLVM build by around 20%.

llvm-svn: 48665
2008-03-21 23:38:23 +00:00
Chris Lattner
c4f8df4a84 this was removed from the Unix side.
llvm-svn: 48370
2008-03-14 20:41:50 +00:00
Devang Patel
2c38efe128 Remove unused GetAddressOfSymbol()
Thanks Daniel Dunbar!

llvm-svn: 48340
2008-03-13 16:55:34 +00:00
Chris Lattner
bc18b99af2 Fix Path::GetMainExecutable on cygwin, patch by Sam Bishop.
llvm-svn: 48328
2008-03-13 05:22:05 +00:00
Chris Lattner
3220bb0859 remove extraneous namespace qualifier, PR2142
llvm-svn: 48327
2008-03-13 05:17:59 +00:00
Chris Lattner
1eca74f70e This is a simple fix for getting error messages from dlerror in
LoadLibraryPermanently. The current code modifies the value of a pointer
that is passed by value, so the caller never gets the message.

Patch by Julien Lerouge!

llvm-svn: 48270
2008-03-12 00:50:01 +00:00
Chris Lattner
5b84600196 Stub out a Path::GetMainExecutable call to find the path to the
main executable of a program.  This needs to be implemented on windows.

llvm-svn: 47835
2008-03-03 02:55:43 +00:00
Chris Lattner
d2a01e1994 Add path separator support, patch by Sam Bishop.
llvm-svn: 47662
2008-02-27 06:17:10 +00:00
Anton Korobeynikov
ca51f9e5f0 Provide __main hooks for cygwin & mingw32
llvm-svn: 47479
2008-02-22 10:08:31 +00:00
Anton Korobeynikov
9f8c4b85cf Add convenient helper to get suffix of the file
llvm-svn: 47397
2008-02-20 19:41:22 +00:00
Lauro Ramos Venancio
4fcf9513f1 It is not safe to call fork in PrintStackTrace. Sometimes it freezes the program.
llvm-svn: 47161
2008-02-15 18:05:54 +00:00
Devang Patel
8190e4fbe0 Remove use of ltdl
llvm-svn: 47065
2008-02-13 17:11:39 +00:00
Devang Patel
ab8c21f3a1 Set error message.
Patch by Shantonu Sen.

llvm-svn: 46715
2008-02-04 20:57:54 +00:00
Dan Gohman
aad233ea10 Use empty() instead of comparing size() with zero.
llvm-svn: 46514
2008-01-29 13:02:09 +00:00
Anton Korobeynikov
8f635c549c Fix potential buffer overflow
llvm-svn: 46296
2008-01-24 01:20:48 +00:00
Duncan Sands
e97a9a373a Fix compile failures with g++-4.3.
llvm-svn: 45781
2008-01-09 19:42:09 +00:00
Chris Lattner
ad9a6ccb83 Remove attribution from file headers, per discussion on llvmdev.
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Chris Lattner
8193d4af33 remove attribution from lib Makefiles.
llvm-svn: 45415
2007-12-29 20:09:26 +00:00
Anton Korobeynikov
07c828b637 Unbreak mingw build
llvm-svn: 45314
2007-12-22 14:26:49 +00:00
Ted Kremenek
b8c85efce1 Added "GetCurrentDirectory()" to sys::Path.
llvm-svn: 45182
2007-12-18 22:07:33 +00:00
Ted Kremenek
a0ff305551 Added "isDirectory" method to llvm::sys::Path.
llvm-svn: 45168
2007-12-18 19:46:22 +00:00
Chris Lattner
cb4a54fe17 remove obviously dead uses of IncludeFile.
llvm-svn: 45165
2007-12-18 19:15:48 +00:00
Chris Lattner
92a284d220 Remove dead file and directory.
llvm-svn: 44720
2007-12-08 22:17:33 +00:00
Anton Korobeynikov
ad4a61ed0b Provide hook for _alloca to make JITing on Cygwin slightly happier :)
llvm-svn: 44528
2007-12-03 05:30:41 +00:00
Chuck Rose III
b1944d8afb This change does a couple of things. First it gets the Visual Studio builds working.
I added the lexing files to the VStudio projects and removed the .l files from the 
VStudio projects.  There was a problem with use of strtoll in TGLexer.cpp and Chris
suggested switching to strtol, so that's included here.

Additionally, this checkin adds minimal x64 builds to the VStudio builds.  Build issues
related to x64 in the windows specific files for DynamicLibrary.inc and Singals.inc
are worked around, but not ultimately solved.  Binaries used to be stored in

...\win32\{Debug|Release}

but are now kept in

...\win32\bin\{win32|x64}\{Debug|Release}

intermediate files will continue to be stored in the individual project directories under 
win32.  

Some names will likely change in the future to reflect that the vstudio projects
are no longer 32-bit only, but I wanted to get things up and running today so kept away
from bigger restructuring.

llvm-svn: 44260
2007-11-21 00:37:56 +00:00
Bill Wendling
0604e0c00f Silence a warning saying that the variables always resolve to "true" in an
expression.

llvm-svn: 43610
2007-11-01 09:38:19 +00:00
Chris Lattner
920bede750 really fix PR1581, thanks to Daniel Dunbar for pointing
this out.

llvm-svn: 42448
2007-09-28 20:50:50 +00:00
Dan Gohman
53119779c2 Remove spurious consts. This fixes warnings with compilers that
are strict about such things.

llvm-svn: 41956
2007-09-14 20:08:19 +00:00
Owen Anderson
4b71e55287 Add lengthof and endof templates that hide a lot of sizeof computations.
Patch by Sterling Stein!

llvm-svn: 41758
2007-09-07 04:06:50 +00:00
Chris Lattner
eb42bcd78a Fix PR1581, patch by Timo Savola
llvm-svn: 40616
2007-07-31 06:00:51 +00:00
Gabor Greif
018330fd12 finishing touches of bytecode -> bitcode changes. also unbreak Windows
llvm-svn: 37950
2007-07-06 20:28:40 +00:00
Gabor Greif
f5e225a756 eliminate residual cruft related to recognizing bytecode
files.
bitcode files are the only LLVM format left.

llvm-svn: 37945
2007-07-06 13:38:17 +00:00
Gabor Greif
f9cf3d3440 Solaris 2.x does not have RLIMIT_RSS, check for this symbol (analog NetBSD below), should subsume Cygwin
llvm-svn: 37939
2007-07-06 10:31:27 +00:00
Gabor Greif
5f705671e4 Here is the bulk of the sanitizing.
Almost all occurrences of "bytecode" in the sources have been eliminated.

llvm-svn: 37913
2007-07-05 17:07:56 +00:00
Anton Korobeynikov
c8aa8f8ba7 Provide hook for alloca on VCPP. Patch by Scott Graham
llvm-svn: 37715
2007-06-25 07:12:14 +00:00
Devang Patel
917048baee Fix LLVM build on NetBSD. Patch by Neil Booth.
llvm-svn: 37410
2007-06-04 15:28:57 +00:00
Chris Lattner
044aaca356 Fix a bug where the bcreader could crash on .bc files that were an exact
multiple of the page size, due to a bug in MappedFile

llvm-svn: 36980
2007-05-11 00:00:27 +00:00
Chris Lattner
342010d9f3 pull some win32 code into common code, add bitcode identification support.
llvm-svn: 36846
2007-05-06 05:32:21 +00:00
Chris Lattner
1cc146e0ef silence annoying gcc 4.3 warnings
llvm-svn: 36681
2007-05-03 18:15:56 +00:00
Reid Spencer
8d2fd1bc21 Cygwin doesn't have the RSS_LIMIT for get/setrlimit.
llvm-svn: 36361
2007-04-23 07:22:51 +00:00
Chris Lattner
2e1f36a4dc Hack to get sys::Path to recognize macho dylibs.
llvm-svn: 35878
2007-04-11 03:15:35 +00:00
Reid Spencer
caf5a6cbd7 Teach sys::Path how to recognize different kinds of object files for ELF
and Mach-O systems. Additionally, correct the Mach-O logic code to look at
byte 12 not byte 15. Hopefully this fixes the llvm-ld warning on Darwin.

llvm-svn: 35876
2007-04-11 02:02:09 +00:00
Reid Spencer
e580735108 Make isDynamicLibrary detect more than just an ELF file.
llvm-svn: 35874
2007-04-11 00:49:39 +00:00
Jeff Cohen
d40c15afaa Unbreak VC++ build.
llvm-svn: 35751
2007-04-07 20:47:27 +00:00