Commit Graph

70 Commits

Author SHA1 Message Date
Rafael Espindola
c65aba032e Move PrependMainExecutablePath next to its only user.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183980 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-14 15:12:13 +00:00
Rafael Espindola
675e0ac0bf Avoid using PathV1.h in Program.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183940 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-13 20:25:38 +00:00
Michael J. Spencer
1f6efa3996 Merge System into Support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 18:16:10 +00:00
Mikhail Glushenkov
d66f2b74f2 Rename FindExecutable to PrependMainExecutablePath.
Makes it more clear that it is just a path manipulation function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118174 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03 16:14:16 +00:00
Dan Gohman
303f350f7d Print an error as one big string instead of breaking it up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03 00:24:33 +00:00
Mikhail Glushenkov
ed724fd43a Revert r118057, this is better fixed in appendSuffix itself.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118088 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 22:18:28 +00:00
Dan Gohman
d4589a3f58 Don't append a dot on platforms which don't use exe suffixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118057 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 20:49:48 +00:00
Mikhail Glushenkov
345b344e64 FindExecutable: remove the executability check.
This makes the behaviour of FindExecutable more consistent across platforms, but
I'm not very happy with the name...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118049 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 20:32:46 +00:00
Mikhail Glushenkov
8a5ff478db Remove an unnecessary check and an unnecessary temporary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117583 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 19:33:04 +00:00
Dan Gohman
776339ee27 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112888 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 22:32:38 +00:00
NAKAMURA Takumi
1b68af4183 llvm::FindExecutable(): Retrieve the name with suffix.exe, if available.
bugpoint uses it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112803 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 03:46:04 +00:00
Dan Gohman
ec080467f5 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81568 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 20:46:33 +00:00
Chris Lattner
74382b7c69 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79869 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 22:45:37 +00:00
Chris Lattner
b683ea4712 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79863 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-23 21:36:09 +00:00
Dan Gohman
197f728d49 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78240 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-05 20:21:17 +00:00
Dan Gohman
d890de10af Add a raw_ostream version of CheckBitcodeOutputToConsole.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75796 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 17:04:50 +00:00
Daniel Dunbar
a00e85c9b1 Improve sys::Path::makeAbsolute on Win32.
- Patch by Viktor Kutuzov!

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75424 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-12 20:23:56 +00:00
Daniel Dunbar
74a81813c2 Tweak FindExecutable so that relative executable paths work as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74645 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-01 21:36:28 +00:00
Daniel Dunbar
93696a38b7 Fix FindExecutable to work if given an absolute executable path name.
- Patch by Viktor Kutuzov, with tweaks by me.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74608 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-01 15:26:13 +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
Gabor Greif
a99be51bf5 Here is the bulk of the sanitizing.
Almost all occurrences of "bytecode" in the sources have been eliminated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37913 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 17:07:56 +00:00
Bill Wendling
1a097e30d3 Don't use <sstream> in Streams.h but <iosfwd> instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32340 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 23:41:45 +00:00
Bill Wendling
bcd2498f4f Removed more <iostream> includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32321 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 20:28:15 +00:00
Bill Wendling
e81561909d Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32298 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 01:30:32 +00:00
Bill Wendling
fe6b146dcd Removed #include <iostream> and replace with llvm_* streams.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31927 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-26 10:52:51 +00:00
Reid Spencer
dd04df0ec3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22349 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-07 23:21:43 +00:00
Reid Spencer
c7f083297c For PR495:
Change interface to Path class:
readable -> canRead
writable -> canWrite
executable -> canExecute

More (incremental) changes coming to close 495.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22345 91177308-0d34-0410-b5e6-96231b3b80d8
2005-07-07 18:21:42 +00:00
Misha Brukman
b5cd8459df Why output multiple strings, let the compiler concatenate them for us for free
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21845 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-10 22:03:50 +00:00
Misha Brukman
dca7978d1d * Order #includes as per style guide
* Combine multiple ``std::cerr <<'' statements into one for simplicity


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21458 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-22 19:13:22 +00:00
Misha Brukman
f976c856fc Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21422 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 22:55:34 +00:00
Reid Spencer
52b50a64ec Make printing a warning message optional in CheckBytecodeOutputToConsole.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19240 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 00:10:03 +00:00
Reid Spencer
436f23ebf5 Implement a function to print a warning if bytecode output is to be sent to
a terminal/console.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19237 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 23:56:20 +00:00
Reid Spencer
a434805014 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19040 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-19 18:00:09 +00:00
Reid Spencer
44f6966ef0 For PR351:
* Remove the ExecWait function. This is now in sys::Program::ExecuteAndWait


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18927 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-14 04:18:15 +00:00
Reid Spencer
9665e8a697 For PR351:
* Remove isExecutable as its now implemented by sys::Path::executable
* Make FindExecutable a thin veneer over sys::Program::FindProgramByName.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18918 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-13 23:41:37 +00:00
Reid Spencer
9b9e22a32e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18912 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-13 20:14:30 +00:00
Reid Spencer
551ccae044 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/.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-01 22:55:40 +00:00
Chris Lattner
d67e439241 Remove linux/solaris specific stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15195 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 07:34:00 +00:00
Chris Lattner
21ddf17ff6 Get rid of the printout from the low-level system interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15161 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-24 07:50:48 +00:00
Chris Lattner
de0213b9f5 Add support for killing the program if it executes for too long.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15158 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-24 07:41:31 +00:00
Misha Brukman
ebb0faabd3 * Fix file header and name
* Order #includes alphabetically


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14234 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-18 15:38:49 +00:00
Misha Brukman
b487303725 Use the machine-independent method of querying the page size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14233 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-18 15:34:07 +00:00
Misha Brukman
d6af686d28 Fix spelling, trim empty space, tighten up function header comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13940 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-02 00:09:46 +00:00
Chris Lattner
49f61c4ea4 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13871 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-28 01:20:58 +00:00
Chris Lattner
c89fe6da17 Add a new function for the JIT. libsupport is now the only library that
includes mman.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13870 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-28 00:59:40 +00:00
Chris Lattner
d895ffe122 Changes to make libSupport build on systems that don't have the wait syscall.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13806 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-27 01:20:55 +00:00
Chris Lattner
bf3d2e2683 Bugpoint was not correctly capturing stderr! This caused it to "find" bugs
that didn't exist, missing the ones that do :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12978 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-16 05:35:58 +00:00
Brian Gaeke
8507ecb36d Add autoconf support for isStandardOutAConsole ().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12638 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 21:26:04 +00:00
Chris Lattner
b234d460b2 Add new function, autoconf support required tho
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12600 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 05:04:03 +00:00
Chris Lattner
74b1f45293 Remove config wrapper around <cerrno>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10747 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 19:15:14 +00:00