1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

643 Commits

Author SHA1 Message Date
Chris Lattner
d28d16bc57 more getting windows to build.
llvm-svn: 74981
2009-07-08 00:52:12 +00:00
Chris Lattner
00c23b1d9e hopefully fix the build on windows.
llvm-svn: 74977
2009-07-08 00:29:32 +00:00
Chris Lattner
ccaba64332 Eliminate the static constructors and locks from DynamicLibrary.cpp.
This fixes PR4512 and eliminating static ctors is always good.  Losing
thread safety is unfortunate, but the code is just incredibly poorly
designed.

If someone is interested, the "right" solution is to split
DynamicLibrary.cpp into two separate pieces: a stateless piece in
libsystem, and a simple support file in libsupport that has the
"state" (e.g.  AddSymbol) in managed static objects.

Doing this would both fix memory leaks we already have, as well as make
the code thread safe again.  it would also make sense to move all the
unix specific code in System/DynamicLibrary.cpp into 
System/Unix/DynamicLibrary.inc.

llvm-svn: 74927
2009-07-07 18:17:07 +00:00
Chris Lattner
b11fca33f8 remove dead code, noone creates instances of "DynamicLibrary", so the ctor and dtor are dead.
llvm-svn: 74926
2009-07-07 18:01:58 +00:00
Chris Lattner
5d45e95584 we don't use libtool anymore, update comments.
llvm-svn: 74924
2009-07-07 17:50:11 +00:00
Owen Anderson
70fe80ea5e No need to double-include config.h
llvm-svn: 74854
2009-07-06 21:24:37 +00:00
Owen Anderson
8c9cecfed5 We need to include config.h to get the proper setting to LLVM_MULTITHREADED.
Patch by Xerxes Ranby.

llvm-svn: 74846
2009-07-06 18:50:47 +00:00
Chris Lattner
dc35f5434f improve portability to windows, patch by Xerces Ranby!
llvm-svn: 74835
2009-07-06 17:24:48 +00:00
Jeffrey Yasskin
b21c8333a6 Oops, I #included errno.h from inside the llvm::sys namespace.
llvm-svn: 74834
2009-07-06 16:50:27 +00:00
Duncan Sands
961ee9b54e Fix windows build, patch by Howard Su.
llvm-svn: 74697
2009-07-02 12:09:50 +00:00
Jeffrey Yasskin
29ea777c1e Add a portable strerror*() wrapper, llvm::sys::StrError(). This includes the
Windows variant, strerror_s, but I couldn't test that.

I'll update configure and config.h.in in a subsequent patch.

llvm-svn: 74621
2009-07-01 18:11:20 +00:00
Owen Anderson
250c7e1a54 Try again at making this work on OpenBSD.
llvm-svn: 74612
2009-07-01 16:19:23 +00:00
Owen Anderson
a006b0212a Fix the build on OpenBSD.
llvm-svn: 74597
2009-07-01 06:53:29 +00:00
Oscar Fuentes
88c3197f7c Fixed assert that checks return value of TlsSetValue.
See http://msdn.microsoft.com/en-us/library/ms686818(VS.85).aspx

Patch by Olaf Krzikalla!

llvm-svn: 74526
2009-06-30 14:12:28 +00:00
Owen Anderson
77f965d8b2 Fix compilation without pthreads.
Patch by Xerxes Ranby.

llvm-svn: 74283
2009-06-26 08:48:03 +00:00
Daniel Dunbar
0d9b275e55 Fix unused variable warnings.
llvm-svn: 74250
2009-06-26 01:34:35 +00:00
Owen Anderson
ba05ead9db Fix error in the Win32 implementation pointed out by Howard Su.
llvm-svn: 74248
2009-06-26 00:51:20 +00:00
Owen Anderson
3a892a63b7 Add support for const thread locals.
llvm-svn: 74226
2009-06-25 23:31:18 +00:00
Owen Anderson
8d5f9675c7 Fix typo in assertion.
llvm-svn: 74225
2009-06-25 23:28:28 +00:00
Owen Anderson
59ffd85020 Add a configure test for pthread_getspecific, and use it when building ThreadLocal.
llvm-svn: 74222
2009-06-25 23:10:26 +00:00
Owen Anderson
aef431f9cb Update cmake build files.
llvm-svn: 74210
2009-06-25 21:58:34 +00:00
Owen Anderson
e716e57779 Add a class for supporting platform independent thread-local storage.
Windows people, please double-check/patch this.

llvm-svn: 74209
2009-06-25 21:58:01 +00:00
Owen Anderson
d1598408ce Guard dynamic library loading.
I did my best at implementing this for Win32, but I don't have a way to test it.
Can someone with access to a Win32 machine test/fix this?

llvm-svn: 74188
2009-06-25 18:12:44 +00:00
Owen Anderson
5bda03a404 Add atomic multiply and divide operations, built on top of CompareAndSwap.
llvm-svn: 74004
2009-06-23 21:19:04 +00:00
Owen Anderson
c11dfb46c1 Revert my last series of commits related to Timer and 64-bit atomics. Not all the targets
we care about are capable of supporting it.

llvm-svn: 73993
2009-06-23 20:17:22 +00:00
Owen Anderson
c2d02066d0 Atomic ops that do arithmetic use signed arithmetic.
llvm-svn: 73980
2009-06-23 18:30:27 +00:00
Owen Anderson
1bea9b9158 Label the existing atomic functions as 32-bit specific, and add a 64-bit one that will be useful in
the near future.

llvm-svn: 73971
2009-06-23 18:01:04 +00:00
Owen Anderson
e0ff9fb130 Add an atomic add operation.
llvm-svn: 73964
2009-06-23 17:39:31 +00:00
Owen Anderson
c1a4bbe1c8 Workaround for an... interesting bug in Darwin's pthread_rwlock_init.
llvm-svn: 73806
2009-06-20 00:32:27 +00:00
Owen Anderson
47968a6dec Fix bad paste-o in the MSVC atomics.
Patch by Иван Сорокин.

llvm-svn: 73779
2009-06-19 18:37:50 +00:00
Owen Anderson
4760da0a7a Give RWMutex the SmartRWMutex treatment too.
llvm-svn: 73710
2009-06-18 18:26:15 +00:00
Owen Anderson
9aaa6b8958 Insert a SmartMutex templated class into the class hierarchy, which takes a template parameter specifying whether this mutex
should become a no-op when not running in multithreaded mode.  Make sys::Mutex a typedef of SmartMutex<false>, to preserve source compatibility.

llvm-svn: 73709
2009-06-18 17:53:17 +00:00
Ted Kremenek
e88e953645 Update CMake files to account for new location of Threading.cpp.
llvm-svn: 73708
2009-06-18 17:47:09 +00:00
Owen Anderson
a59f91c08d Move Threading.[h|cpp] from Support to System.
llvm-svn: 73707
2009-06-18 16:54:52 +00:00
Owen Anderson
f71490c586 Fix build when disable thread support.
Patch by Howard Su.

llvm-svn: 73680
2009-06-18 04:44:46 +00:00
Douglas Gregor
b1764a0bef Add RWMutex.cpp to the CMake makefiles
llvm-svn: 73615
2009-06-17 17:01:30 +00:00
Owen Anderson
c40f3f2752 Improve the Win32 reader-writer lock implementation by making it just a normal
lock.  This is obviously bad, but at least it's threadsafe!  If you know how
to improve this in a pre-Vista friendly well, patches welcome!

Patch by Max Burke.

llvm-svn: 73607
2009-06-17 09:10:42 +00:00
Owen Anderson
3637fc65bd Use atomic increment/decrement for reference counting of Type's.
llvm-svn: 73588
2009-06-17 00:28:49 +00:00
Owen Anderson
430f18d2db Add an atomic increment and decrement implementation, which will be used for
thread-safe reference counting.

llvm-svn: 73587
2009-06-17 00:13:00 +00:00
Owen Anderson
aaf83d86b8 Accidentally broke this file.
llvm-svn: 73552
2009-06-16 20:57:51 +00:00
Owen Anderson
208c38b522 Remove the Win32 implementation, since it doesn't compile pre-Vista.
llvm-svn: 73550
2009-06-16 20:49:20 +00:00
Owen Anderson
30a1b2528a Fix/cleanup trailing newlines.
llvm-svn: 73546
2009-06-16 20:23:05 +00:00
Owen Anderson
48d53f2c53 Add a portable wrapper for reader-writer locks.
llvm-svn: 73545
2009-06-16 20:19:28 +00:00
Dan Gohman
d0637707c5 glibc has two versions of strerror_r, a standards compliant one and a GNU
specific one. The GNU one is chosen when _GNU_SOURCE is defined. g++ always
defines _GNU_SOURCE on linux platforms because glibc's headers won't compile
in C++ mode without it. The GNU strerror_r doesn't always modify the buffer
which causes empty error messages on linux.

This patch changes MakeErrMsg to use the return value of strerror_r to get
the string instead of assuming the buffer will be modified, on GLIBC.

Patch by Benjamin Kramer!

llvm-svn: 73396
2009-06-15 18:05:46 +00:00
Chris Lattner
9e81498d2d "This patch implements the method with the GetModuleFileName function for windows."
Patch by Benjamin Kramer!

llvm-svn: 73379
2009-06-15 05:38:04 +00:00
Chris Lattner
dfaaf63aff add a new static method to portably determine whether a patch is
absolute or not, based on a patch by Gregory Curfman!

llvm-svn: 73368
2009-06-15 04:17:07 +00:00
Torok Edwin
a10c3b9bc6 Fix comments.
llvm-svn: 72858
2009-06-04 08:18:25 +00:00
Torok Edwin
5da9f51d1e Add support for outputting ANSI colors to raw_fd_ostream.
llvm-svn: 72854
2009-06-04 07:09:50 +00:00
Duncan Sands
1f0ecf9952 At a newline at the end of this file.
llvm-svn: 72767
2009-06-03 11:54:28 +00:00
Owen Anderson
6a94d2450e Undef MemoryFence when compiling on MSVC.
llvm-svn: 72732
2009-06-02 17:35:55 +00:00
Bill Wendling
8235a05c1a Untabification.
llvm-svn: 72604
2009-05-30 01:09:53 +00:00
Jay Foad
ccae25d83b Work around a page size issue on Cygwin.
llvm-svn: 72332
2009-05-23 17:57:59 +00:00
Owen Anderson
3e3206324b Add Atomic.cpp to the CMake build system.
llvm-svn: 72202
2009-05-21 00:48:56 +00:00
Owen Anderson
07513122f5 Tabs, be gone!
llvm-svn: 72180
2009-05-20 19:06:49 +00:00
Owen Anderson
b3e9d10028 I just fail today.
Hopefully this fixes the last build errors on systems with GCC < 4.1.

llvm-svn: 72179
2009-05-20 19:01:50 +00:00
Owen Anderson
0bc99bd557 Copy-and-paste-o.
llvm-svn: 72177
2009-05-20 18:47:53 +00:00
Owen Anderson
2753821fab Move atomic operations' definitions out of line. While this seems kind of silly,
all kinds of problems caused by including windows.h and/or config.h in an LLVM header.

llvm-svn: 72174
2009-05-20 18:26:15 +00:00
Douglas Gregor
1ad25cdc99 termios.h contains the winsize structure we need to determine the
width of a terminal. Don't try to get the width of a terminal if we
don't have this header.

llvm-svn: 72018
2009-05-18 17:21:34 +00:00
Douglas Gregor
26745696ef Add terminal width detection to llvm::sys::Process. This is needed to
fix Clang PRs 4148 and 4183.

llvm-svn: 71448
2009-05-11 18:05:52 +00:00
Stefanus Du Toit
984008e1d7 Fix choice of version of Windows callback to use to consider not only the Visual Studio version, but also the Windows SDK version.
Patch by Tareq Siraj.

llvm-svn: 70299
2009-04-28 16:37:58 +00:00
Torok Edwin
285a5fb1d5 Fix g++-4.4.0 warning, it was causing llvm-nm to fail on wrapped BC files:
Path.cpp:59: warning: case label value exceeds maximum value for type
magic[0] is a (signed) char, but some case values are unsigned (e.g. 0xde).
When magic[0] was 0xde, the switch has taken the default branch instead of case
0xde branch.
Apparently this was the behaviour with older versions of gcc too, but not with g++.
Now g++-4.4 behaves as gcc, and ignores unsigned case values out of range signed
range.

llvm-svn: 70038
2009-04-25 10:25:12 +00:00
Anton Korobeynikov
b53ac333d7 Silence warnings.
Patch by Jay Foad!

llvm-svn: 69679
2009-04-21 16:04:56 +00:00
Anton Korobeynikov
0a64083f49 Drop obsolete reference to __eprintf.
Patch by Jay Foad!

llvm-svn: 69678
2009-04-21 16:04:41 +00:00
Daniel Dunbar
024320d274 Make Unix.h:MakeErrMsg separate the prefix and errno string, so we get:
clang: error: unable to make temporary file: /etc/cc: can't make
  unique filename: Permission denied

instead of 

  clang: error: unable to make temporary file: /etc/cc: can't make
  unique filenamePermission denied

for example.

Also, audited the uses of MakeErrMsg to make the prefix strings
consistent (not end with newline/punctuation/space/": ").

llvm-svn: 69626
2009-04-20 20:50:13 +00:00
Mikhail Glushenkov
df9499583d Call CreateProcess with bInheritHandles = TRUE.
Makes llvmc show error messages printed by child processes when run from the
Cygwin/MSYS shell. Since ExecuteAndWait does not return until the child program
has finished execution, this change should be harmless.

llvm-svn: 69082
2009-04-14 21:31:36 +00:00
Mikhail Glushenkov
c249ce5be4 Delete trailing whitespace.
llvm-svn: 69081
2009-04-14 21:31:14 +00:00
Chris Lattner
76d47b6629 fix PR3965:SIGINT handler not restored after calling ParseAST(),
patch by Alexei Svitkine!

llvm-svn: 68929
2009-04-12 23:33:13 +00:00
Daniel Dunbar
7682ffcabb Add sys::Path::makeAbsolute().
llvm-svn: 68663
2009-04-09 00:33:08 +00:00
Chris Lattner
437755672d hopefully fix an apparent build error on windows.
llvm-svn: 68175
2009-04-01 02:03:38 +00:00
Daniel Dunbar
aec3d9857f Add llvm::sys::getHostTriple and remove
llvm::sys::getOS{Name,Version}.

Right now the implementation just derives from LLVM_HOSTTRIPLE (which
is wrong, but it doesn't look like we have a define for the target
triple). Ideally this routine would actually be able to compute the
triple for targets we care about.

llvm-svn: 68118
2009-03-31 17:30:15 +00:00
Chris Lattner
095a3938e4 fix a bug Alexei Svitkine pointed out.
llvm-svn: 67510
2009-03-23 06:46:20 +00:00
Chris Lattner
910f31715e When we restore signal handlers, restore them back to what they
were when we came around, not to their default handler.  This 
should fix PR3848

llvm-svn: 67509
2009-03-23 05:55:36 +00:00
Chris Lattner
429a82ad30 factorize signal registration, part of PR3848.
llvm-svn: 67508
2009-03-23 05:42:29 +00:00
Sebastian Redl
e4e5b1c2f2 Fix the Win32 VS2008 build:
- Make type declarations match the struct/class keyword of the definition.
 - Move AddSignalHandler into the namespace where it belongs.
 - Correctly call functions from template base.
 - Some other small changes.
With this patch, LLVM and Clang should build properly and with far less noise under VS2008.

llvm-svn: 67347
2009-03-19 23:26:52 +00:00
Chris Lattner
778f77667d add some explicit llvm:: qualifiers to the unix side, fix problems on the windows side.
llvm-svn: 66386
2009-03-08 19:13:45 +00:00
Chris Lattner
005d001719 When a crash signal is delivered do two things: remove all of our
signal handlers to prevent reentrance on unrelated things (a sigabort
where the handle bus errors) also, clear the signal mask so that the
signal doesn't infinitely reissue.  This fixes rdar://6654827 -
Crash causes clang to loop

llvm-svn: 66330
2009-03-07 08:15:47 +00:00
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
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