Commit Graph

176 Commits

Author SHA1 Message Date
Chris Lattner
0eab5e2efa add a helper method to sys::Path for clang, patch by
Kovarththanan Rajaratnam!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54655 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 23:39:47 +00:00
Argyrios Kyrtzidis
4bd3225088 Minor comment fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52312 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 10:14:09 +00:00
Argyrios Kyrtzidis
fc19988bcb Fix the sys::Path::getSuffix() implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52288 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-15 15:15:19 +00:00
Argyrios Kyrtzidis
f1844d2f58 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52284 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-15 03:54:39 +00:00
Matthijs Kooijman
cf45ca0408 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52233 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-12 12:53:35 +00:00
Matthijs Kooijman
905261efed 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52230 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-12 10:47:18 +00:00
Anton Korobeynikov
232a4ab77a Provide hooks for libgcc symbols' address resolution inside lli on mingw32.
Patch by Julien Lerouge!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52037 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 07:20:07 +00:00
Nick Lewycky
fff116fd58 Make constructors target-specific. This fixes problems where the path would
include backslashes on Windows. This should fix llvm-ld problems on win32.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50960 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-11 17:37:40 +00:00
Nick Lewycky
5c632e904c Fix renamePathOnDisk on Win32, patch from David Leon. This fixes problems with
llvm-ar being unable to rename files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50702 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 03:42:21 +00:00
Ted Kremenek
9b01cc0ede Make getDirnameSep a static method (not part of Path's interface).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49354 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 22:01:32 +00:00
Ted Kremenek
cf55c8e221 Added method Path::getDirname().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49352 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 21:53:57 +00:00
Chris Lattner
98b7e612b2 MappedFile is dead, remove it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49035 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 06:20:44 +00:00
Chris Lattner
799ed1053b Stub out some sys::Path::MapInFilePages/UnMapFilePages methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49030 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 06:00:12 +00:00
Chris Lattner
23ffec8258 Make MappedFile::map return a const correct pointer, don't leak address space on Unix platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49026 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 03:49:38 +00:00
Chris Lattner
bdbd2d710c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49022 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 03:10:22 +00:00
Chris Lattner
540630f637 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49009 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 00:53:25 +00:00
Owen Anderson
19cfd733e2 Revert r48676. I had plans for using it, but now it's just dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48743 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-24 21:29:58 +00:00
Owen Anderson
a4bf5c046d Add an AllocateRW to match AllocateRWX.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48676 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-22 02:33:53 +00:00
Chris Lattner
7e526e7544 this was removed from the Unix side.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48370 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-14 20:41:50 +00:00
Chris Lattner
a17fa28ac2 remove extraneous namespace qualifier, PR2142
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48327 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-13 05:17:59 +00:00
Chris Lattner
1a091447f4 Stub out a Path::GetMainExecutable call to find the path to the
main executable of a program.  This needs to be implemented on windows.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47835 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-03 02:55:43 +00:00
Chris Lattner
e1b332a304 Add path separator support, patch by Sam Bishop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47662 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 06:17:10 +00:00
Anton Korobeynikov
47ccf1af3a Provide __main hooks for cygwin & mingw32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47479 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 10:08:31 +00:00
Dan Gohman
3035959425 Use empty() instead of comparing size() with zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46514 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29 13:02:09 +00:00
Anton Korobeynikov
58ea52a6a5 Fix potential buffer overflow
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46296 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-24 01:20:48 +00:00
Chris Lattner
4ee451de36 Remove attribution from file headers, per discussion on llvmdev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 20:36:04 +00:00
Anton Korobeynikov
64ddbe48e1 Unbreak mingw build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45314 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-22 14:26:49 +00:00
Ted Kremenek
79200788df Added "GetCurrentDirectory()" to sys::Path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45182 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-18 22:07:33 +00:00
Ted Kremenek
fd52711675 Added "isDirectory" method to llvm::sys::Path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45168 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-18 19:46:22 +00:00
Chuck Rose III
0ccb93034a 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44260 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-21 00:37:56 +00:00
Gabor Greif
db5565a1f5 finishing touches of bytecode -> bitcode changes. also unbreak Windows
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37950 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-06 20:28:40 +00:00
Anton Korobeynikov
5248896635 Provide hook for alloca on VCPP. Patch by Scott Graham
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37715 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-25 07:12:14 +00:00
Chris Lattner
f283a5e53a pull some win32 code into common code, add bitcode identification support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36846 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-06 05:32:21 +00:00
Jeff Cohen
31102896e5 Unbreak VC++ build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35751 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-07 20:47:27 +00:00
Reid Spencer
2ae9d11b7c For PR1291:
Implement the PathWithStatus class and its use throughout lib/System.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35742 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-07 18:52:17 +00:00
Reid Spencer
8475ec068c For PR789:
Make the sys::Path::getFileStatus function more efficient by having it
return a pointer to the FileStatus structure rather than copy it. Adjust
uses of the function accordingly. Also, fix some memory issues in sys::Path.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35476 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 19:05:44 +00:00
Jeff Cohen
84892be310 Determine absolute paths the correct way :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35464 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 17:27:38 +00:00
Reid Spencer
4031befb62 Add a uniqueID field to the FileStatus structure for Paths. This will map
to the inode number on Unix and something far less unique on Windows. The
windows case needs to be improved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35461 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 17:00:31 +00:00
Reid Spencer
69cce815e7 For PR789:
* Add a method: bool isAbsolute() const, which determines if the path name
  is absolute or not.
* Implement caching of file status information in the Path object. Allow it
  to be updated forcefully or lazily re-fetched from the cached value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35456 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 16:43:20 +00:00
Anton Korobeynikov
d437db1b7b Fix mingw32 build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35177 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-19 20:19:08 +00:00
Anton Korobeynikov
349ec1c11b Unbreak mingw32 build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35042 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-09 11:53:34 +00:00
Jeff Cohen
413bc8262e Ensure 64-bit correctness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34923 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 05:45:08 +00:00
Jeff Cohen
0a18267248 Implement memoryLimit on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34922 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 05:22:08 +00:00
Anton Korobeynikov
9ba8a76f8b Add possibility to set memory limit for binaries run via libSystem. This
is especially needed for bugpoint. This partly implements PR688


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34349 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-16 19:11:07 +00:00
Anton Korobeynikov
cd79df01c2 Partly fixed JITing on mingw32 platform. The support is not full due to
absence of dllimport JIT codegen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32673 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-19 15:24:18 +00:00
Jeff Cohen
d41b30def3 Unbreak VC++ build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31464 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-05 19:31:28 +00:00
Anton Korobeynikov
7d51544903 - Fixed broken Win32 build
- Removed warning about clobbered parameter in Bytecode/Reader


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30026 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-01 20:35:17 +00:00
Reid Spencer
0554575567 For PR797:
Make the Win32 code exception free (untested/uncompiled) which forced some
interface changes which had ripple effect. This should be the last of 797.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29884 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-25 21:37:17 +00:00
Reid Spencer
30300996b3 For PR797:
Adjust implementation to match the new interface after exception handling
was removed in the Unix verison. NOTE: this hasn't been compiled yet!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29858 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-24 18:58:37 +00:00
Reid Spencer
5a060775da For PR797:
Eliminate exception throwing from Path::renamePathOnDisk and adjust its
users correspondingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29843 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-23 07:30:48 +00:00