Commit Graph

70 Commits

Author SHA1 Message Date
Rafael Espindola b786304fea Move PrependMainExecutablePath next to its only user.
llvm-svn: 183980
2013-06-14 15:12:13 +00:00
Rafael Espindola 7c1023ad27 Avoid using PathV1.h in Program.h.
llvm-svn: 183940
2013-06-13 20:25:38 +00:00
Michael J. Spencer 447762da85 Merge System into Support.
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
Mikhail Glushenkov b8211b80bc Rename FindExecutable to PrependMainExecutablePath.
Makes it more clear that it is just a path manipulation function.

llvm-svn: 118174
2010-11-03 16:14:16 +00:00
Dan Gohman 0baea2aa1b Print an error as one big string instead of breaking it up.
llvm-svn: 118130
2010-11-03 00:24:33 +00:00
Mikhail Glushenkov 4fb337560c Revert r118057, this is better fixed in appendSuffix itself.
llvm-svn: 118088
2010-11-02 22:18:28 +00:00
Dan Gohman 35b2013bf8 Don't append a dot on platforms which don't use exe suffixes.
llvm-svn: 118057
2010-11-02 20:49:48 +00:00
Mikhail Glushenkov 82ee8dad50 FindExecutable: remove the executability check.
This makes the behaviour of FindExecutable more consistent across platforms, but
I'm not very happy with the name...

llvm-svn: 118049
2010-11-02 20:32:46 +00:00
Mikhail Glushenkov fdba1308ee Remove an unnecessary check and an unnecessary temporary.
llvm-svn: 117583
2010-10-28 19:33:04 +00:00
Dan Gohman 2adf2f2714 Use the FindProgramByName fallback only with known absolute paths.
I wasn't able to convince myself that all GetMainExecutable
implementations always return absolute paths; this prevents
unexpected behavior in case they ever don't.

llvm-svn: 112888
2010-09-02 22:32:38 +00:00
NAKAMURA Takumi 4fa39acb53 llvm::FindExecutable(): Retrieve the name with suffix.exe, if available.
bugpoint uses it.

llvm-svn: 112803
2010-09-02 03:46:04 +00:00
Dan Gohman e592923603 Fix llvm-extract's "writing bitcode to a terminal" warning, which wasn't
working. To support this, add an is_displayed() function to raw_ostream,
and generalize Process::StandardOutIsDisplayed and friends in order to
support it.

Also, call RemoveFileOnSignal before creating a file instead of after, so
that the file isn't left behind if the program is interrupted between when
the file is created and RemoveFileOnSignal is called.

While here, add a -S to llvm-extract and port it to IRReader so that it
supports assembly input.

llvm-svn: 81568
2009-09-11 20:46:33 +00:00
Chris Lattner c521f54198 Prune #includes from llvm/Linker.h and llvm/System/Path.h,
forcing them down into various .cpp files.

This change also:
1. Renames TimeValue::toString() and Path::toString() to ::str()
   for similarity with the STL.
2. Removes all stream insertion support for sys::Path, forcing
   clients to call .str().
3. Removes a use of Config/alloca.h from bugpoint, using smallvector
   instead.
4. Weans llvm-db off <iostream>

sys::Path really needs to be gutted, but I don't have the desire to
do it at this point.

llvm-svn: 79869
2009-08-23 22:45:37 +00:00
Chris Lattner b9f25f9e19 eliminate the ostream version of CheckBitcodeOutputToConsole,
change the raw_ostream one to take the raw_ostream byref instead
of byptr.  Prune #includes, eliminate a use of Streams.h

llvm-svn: 79863
2009-08-23 21:36:09 +00:00
Dan Gohman 46ffffa750 Fix FindExecutable to use sys::Path::GetMainExecutable instead of
just argv[0]. And remove the code for searching the current
working directory and for searching PATH; the point of FindExecutable
is not to find whatever version of the executable can be found by
searching around, but to find an executable that accompanies the
current executable.

Update the tools to use sys::Program::FindProgramByName when they
want PATH searching.

llvm-svn: 78240
2009-08-05 20:21:17 +00:00
Dan Gohman 6935332d5f Add a raw_ostream version of CheckBitcodeOutputToConsole.
llvm-svn: 75796
2009-07-15 17:04:50 +00:00
Daniel Dunbar df555fd6f8 Improve sys::Path::makeAbsolute on Win32.
- Patch by Viktor Kutuzov!

 - Minor tweak by me to add llvm_unreachable calls on FIXMEd error paths.

llvm-svn: 75424
2009-07-12 20:23:56 +00:00
Daniel Dunbar 4aef67c99d Tweak FindExecutable so that relative executable paths work as well.
llvm-svn: 74645
2009-07-01 21:36:28 +00:00
Daniel Dunbar b8f779db87 Fix FindExecutable to work if given an absolute executable path name.
- Patch by Viktor Kutuzov, with tweaks by me.

llvm-svn: 74608
2009-07-01 15:26:13 +00:00
Chris Lattner f3ebc3f3d2 Remove attribution from file headers, per discussion on llvmdev.
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Gabor Greif e16561cd5d 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
Bill Wendling 30c0f3367c Don't use <sstream> in Streams.h but <iosfwd> instead.
llvm-svn: 32340
2006-12-07 23:41:45 +00:00
Bill Wendling 355fc5ad50 Removed more <iostream> includes
llvm-svn: 32321
2006-12-07 20:28:15 +00:00
Bill Wendling f3baad3ee1 Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.

llvm-svn: 32298
2006-12-07 01:30:32 +00:00
Bill Wendling 3750ae25a0 Removed #include <iostream> and replace with llvm_* streams.
llvm-svn: 31927
2006-11-26 10:52:51 +00:00
Reid Spencer c9c0473fa5 For PR495:
Get rid of the difference between file paths and directory paths. The Path
class now simply stores a path that can refer to either a file or a
directory. This required various changes in the implementation and interface
of the class with the corresponding impact to its users. Doxygen comments were
also updated to reflect these changes. Interface changes are:

appendDirectory -> appendComponent
appendFile -> appendComponent
elideDirectory -> eraseComponent
elideFile -> eraseComponent
elideSuffix -> eraseSuffix
renameFile -> rename
setDirectory -> set
setFile -> set

Changes pass Dejagnu and llvm-test/SingleSource tests.

llvm-svn: 22349
2005-07-07 23:21:43 +00:00
Reid Spencer 5b891e9847 For PR495:
Change interface to Path class:
readable -> canRead
writable -> canWrite
executable -> canExecute

More (incremental) changes coming to close 495.

llvm-svn: 22345
2005-07-07 18:21:42 +00:00
Misha Brukman 308a715acc Why output multiple strings, let the compiler concatenate them for us for free
llvm-svn: 21845
2005-05-10 22:03:50 +00:00
Misha Brukman 7937b07940 * Order #includes as per style guide
* Combine multiple ``std::cerr <<'' statements into one for simplicity

llvm-svn: 21458
2005-04-22 19:13:22 +00:00
Misha Brukman 10468d8a3c Remove trailing whitespace
llvm-svn: 21422
2005-04-21 22:55:34 +00:00
Reid Spencer 4e8dd44733 Make printing a warning message optional in CheckBytecodeOutputToConsole.
llvm-svn: 19240
2005-01-02 00:10:03 +00:00
Reid Spencer 1263cfd14f Implement a function to print a warning if bytecode output is to be sent to
a terminal/console.

llvm-svn: 19237
2005-01-01 23:56:20 +00:00
Reid Spencer d44f845213 For PR351:
* Remove unneeded header files.
* Move RedirectFD static function to lib/System/Unix/Program.cpp
* Delete RunProgramWithTimeout, now implemented by
  sys::Program::ExecuteAndWait. RunProgramWithTimeout is now a convenience func.

llvm-svn: 19040
2004-12-19 18:00:09 +00:00
Reid Spencer c2e22fea42 For PR351:
* Remove the ExecWait function. This is now in sys::Program::ExecuteAndWait

llvm-svn: 18927
2004-12-14 04:18:15 +00:00
Reid Spencer dc49d865a1 For PR351:
* Remove isExecutable as its now implemented by sys::Path::executable
* Make FindExecutable a thin veneer over sys::Program::FindProgramByName.

llvm-svn: 18918
2004-12-13 23:41:37 +00:00
Reid Spencer e42f222d36 For PR351:
Remove AllocateRWXMemory as it is not used any more in LLVM. The function
has been replaced with sys::Memory::AllocateRWX several months ago.

llvm-svn: 18912
2004-12-13 20:14:30 +00:00
Reid Spencer 7c16caa336 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Chris Lattner d1980dbeba Remove linux/solaris specific stuff.
llvm-svn: 15195
2004-07-25 07:34:00 +00:00
Chris Lattner 2731ead702 Get rid of the printout from the low-level system interface
llvm-svn: 15161
2004-07-24 07:50:48 +00:00
Chris Lattner f5da5de94a Add support for killing the program if it executes for too long.
llvm-svn: 15158
2004-07-24 07:41:31 +00:00
Misha Brukman 4b58581545 * Fix file header and name
* Order #includes alphabetically

llvm-svn: 14234
2004-06-18 15:38:49 +00:00
Misha Brukman 42a24823a1 Use the machine-independent method of querying the page size.
llvm-svn: 14233
2004-06-18 15:34:07 +00:00
Misha Brukman 140f26ea46 Fix spelling, trim empty space, tighten up function header comment.
llvm-svn: 13940
2004-06-02 00:09:46 +00:00
Chris Lattner b6d6b931cc Add support for getting executable memory on Windows. This is actually
much easier than on unix.  :)  The only evil thing is that windows.h defines
a macro named FindExecutable, which collides with one of our names.

The JIT now runs on windows, but it cannot resolve external functions
(like printf) yet.

llvm-svn: 13871
2004-05-28 01:20:58 +00:00
Chris Lattner d54358279d Add a new function for the JIT. libsupport is now the only library that
includes mman.h

llvm-svn: 13870
2004-05-28 00:59:40 +00:00
Chris Lattner 1760ccd7b0 Changes to make libSupport build on systems that don't have the wait syscall.
llvm-svn: 13806
2004-05-27 01:20:55 +00:00
Chris Lattner 82876bdb2a Bugpoint was not correctly capturing stderr! This caused it to "find" bugs
that didn't exist, missing the ones that do :(

llvm-svn: 12978
2004-04-16 05:35:58 +00:00
Brian Gaeke 5ade501501 Add autoconf support for isStandardOutAConsole ().
llvm-svn: 12638
2004-04-02 21:26:04 +00:00
Chris Lattner 454e18317d Add new function, autoconf support required tho
llvm-svn: 12600
2004-04-02 05:04:03 +00:00
Chris Lattner d832807311 Remove config wrapper around <cerrno>
llvm-svn: 10747
2004-01-10 19:15:14 +00:00