1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-26 22:42:46 +02:00
Commit Graph

231 Commits

Author SHA1 Message Date
Bill Wendling
fe0af72bc4 Don't use <sstream> in Streams.h but <iosfwd> instead.
llvm-svn: 32340
2006-12-07 23:41:45 +00:00
Bill Wendling
a3246c4272 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
d933b6630c Removed #include <iostream> and replace with llvm_* streams.
llvm-svn: 31927
2006-11-26 10:52:51 +00:00
Chris Lattner
9476464f86 avoid a ctor/dtor issue with the ProgramName global.
llvm-svn: 30925
2006-10-13 00:06:24 +00:00
Chris Lattner
f48558b3b6 shrink anon-ns and mark stuff static. No functionality changes
llvm-svn: 30922
2006-10-12 22:09:17 +00:00
Chris Lattner
d55928d5f6 Fix more static dtor issues
llvm-svn: 30725
2006-10-04 21:52:35 +00:00
Chris Lattner
c8276aeb22 Minor code cleanups
llvm-svn: 29917
2006-08-27 22:10:29 +00:00
Chris Lattner
91f098c9f7 Add external definitions for commonly-used template specializations and add
anchor methods to others.  This eliminates the vtable/template method bloat
in .o files that defining a cl::opt used to impose (~4K per .o file for one
cp::opt<unsigned>).

llvm-svn: 29909
2006-08-27 12:45:47 +00:00
Reid Spencer
de93aba128 Make the ProgramName variable a std::string so we can eliminate the path
portion fo the program name via sys::Path().getLast(). This makes error
messages more readable since this is invariably used only in error
messages.  Instead of:
  /path/to/llvm/bin/directory/toolname: error message
we will now get:
  toolname: error message
Also, since we always have a program name (even if its defaulted), don't
check to see if it is set or not when generating error messages. This
eliminates a bunch of constant strings, saving a little under 1K of data.

llvm-svn: 29842
2006-08-23 07:10:06 +00:00
Reid Spencer
5ed787710d For PR797:
Make sys::Program::ExecuteAndWait not throw exceptions and update any
affected code. It now return -9999 to signal that the program couldn't be
executed. Only one case (in bugpoint) actually examines the result code.

llvm-svn: 29785
2006-08-21 02:04:43 +00:00
Jim Laskey
ce9ed8e5e5 If the Program name was NULL then all further output sent to std::cerr was
suppressed.

llvm-svn: 29477
2006-08-02 20:15:56 +00:00
Chris Lattner
d2ad578246 Add an out-of-line virtual method to provide a home for the cl::option class.
llvm-svn: 29191
2006-07-18 23:59:33 +00:00
Chris Lattner
198d63f336 Print LLVM version info like this:
Low Level Virtual Machine (http://llvm.org/):
  llvm version 1.8cvs
  DEBUG build with assertions.

instead of like this:

Low Level Virtual Machine (llvm) 1.8cvs (see http://llvm.org/) ASSERTIONS ENABLED

Also, add a place for vendor version info.

llvm-svn: 29020
2006-07-06 18:33:03 +00:00
Reid Spencer
24f0a4a816 Make it possible to override the standard version printer. Not all tools
built with CommandLine.h will want the --version option to report that the
tool belongs to LLVM. To override simply pass a void func() to the
cl::SetVersionPrinter() function and that void func() will be called when
it is time to print the version information.

llvm-svn: 28687
2006-06-05 16:22:56 +00:00
Chris Lattner
a297ad27db Fix PR743: emit -help output of a tool to cout, not cerr.
llvm-svn: 28010
2006-04-28 05:36:25 +00:00
Chris Lattner
111de6b5cf Add support for programs with a null argv[0]
llvm-svn: 25379
2006-01-17 00:32:28 +00:00
Duraid Madina
392483ef73 MERRY CHRISTMAS EVERYONE!!! (what better way to spend christmas than
to try building LLVM on HP-UX! (the Right Way seems to be to tear out
the ancient STL that HP ship and use http://incubator.apache.org/stdcxx/ )

llvm-svn: 25012
2005-12-26 04:56:16 +00:00
Chris Lattner
5853bd7984 indicate when a tool is a debug build.
llvm-svn: 24374
2005-11-16 06:36:47 +00:00
Chris Lattner
f1d821b665 Allow tools with "consume after" options (like lli) to take more positional
opts than they take directly.  Thanks to John C for pointing this problem
out to me!

llvm-svn: 22717
2005-08-08 21:57:27 +00:00
Chris Lattner
e30b898fec Reject command lines that have too many positional arguments passed (e.g.,
'opt x y').  This fixes PR493.

Patch contributed by Owen Anderson!

llvm-svn: 22705
2005-08-08 17:25:38 +00:00
Chris Lattner
f79a885a30 Capitalize
llvm-svn: 21964
2005-05-13 19:49:09 +00:00
Chris Lattner
593c0e8957 Do not use "" as a sentinal for a missing argument! This fixes PR560.
llvm-svn: 21850
2005-05-10 23:20:17 +00:00
Misha Brukman
933cdaf254 Remove trailing whitespace
llvm-svn: 21422
2005-04-21 22:55:34 +00:00
Chris Lattner
786b30e148 Work around GCC PR19958, which causes programs to sometimes crash after
printing help output or version info.

llvm-svn: 20180
2005-02-14 19:17:29 +00:00
Reid Spencer
1c55479db5 Implement and document prefix options with arbitrary values including an
= sign. This needed to support -DNAME=value options as pass-through in
llvmc.

llvm-svn: 18203
2004-11-24 06:13:42 +00:00
Tanya Lattner
a2cf139875 Fixed assertion from triggering. We need to check if the commandline map is empty before checking if an arg exists.
llvm-svn: 18057
2004-11-20 23:35:20 +00:00
Chris Lattner
1d11859e8c Patches to avoid "leaking" memory on process exit. Patch contributed by
Morten Ofstad!

llvm-svn: 17998
2004-11-19 17:08:15 +00:00
Reid Spencer
e64ca0563a Add a comment to some code that at first glance just doesn't look right.
llvm-svn: 17886
2004-11-16 06:50:36 +00:00
Reid Spencer
fdf8ac8d29 Per code review:
*Implement/Document the cl::extrahelp feature instead of the MoreHelp ptr.

llvm-svn: 17871
2004-11-16 06:11:52 +00:00
Reid Spencer
8bf3328ca7 Implement the MoreHelp utility that calls a function to printmore help information if the MoreHelp global is not null.
llvm-svn: 17774
2004-11-14 22:04:00 +00:00
Misha Brukman
ce8c2c2aee Replace uses of llvm.org with llvm.cs.uiuc.edu
llvm-svn: 17549
2004-11-07 00:58:38 +00:00
Reid Spencer
c4abcbefb1 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
Reid Spencer
fc74d1fba8 Make CommandLine prefix error output with the name of the program.
llvm-svn: 16129
2004-09-01 04:41:28 +00:00
Reid Spencer
45d12b6601 Allow any cl::opt to use the method getPosition() to retrieve the option's
absolute position on the command line. Similarly allow any cl::list to
use the method getPosition(n) to retrieve the absolute position of the nth
option in the list. This provides support for two things: (a) options like
-l that are actually positional and their order of occurrence matters when
they are intermixed with positional arguments like "a.o"; and (b) options
like -x LANG which affect only the positional arguments that come after
the option. In both cases, knowing the absolute position of a given option
helps.

llvm-svn: 15725
2004-08-13 19:47:30 +00:00
Reid Spencer
7a574d3872 Add a --version option for every tool that prints out:
Low Level Virtual Machine ($PACKAGE_NAME) $PACKAGE_VERSION

llvm-svn: 15454
2004-08-04 00:36:06 +00:00
Chris Lattner
9d3ff75eba Add a workaround for a GCC 3.3.2 bug
llvm-svn: 14976
2004-07-18 21:56:20 +00:00
Chris Lattner
5d7966a0ea Fix compilation on internix
llvm-svn: 14588
2004-07-03 01:21:05 +00:00
Chris Lattner
88706ea172 Implement the new cl::PositionalEatsArgs flag, refactor code a bit
llvm-svn: 13388
2004-05-06 22:04:31 +00:00
Alkis Evlogimenos
d6bb9674d9 Hide variable from other functions.
llvm-svn: 12118
2004-03-04 17:50:44 +00:00
Chris Lattner
2fdf5e32aa Finegrainify namespacification
llvm-svn: 10464
2003-12-14 21:35:53 +00:00
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
John Criswell
b402729b30 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.

llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Brian Gaeke
254dd12289 Change to use strtoul instead of strtoll.
llvm-svn: 9010
2003-10-10 17:01:36 +00:00
Brian Gaeke
b121c72006 Add missing apostrophe. It's been bugging me for years.
No really, years.

llvm-svn: 8566
2003-09-16 18:00:35 +00:00
Misha Brukman
ed4039f715 Fixed spelling & grammar.
llvm-svn: 8559
2003-09-16 15:31:46 +00:00
Brian Gaeke
294589d7f6 lib/Support/CommandLine.cpp:
Many changes suggested by Chris. It's okay, I'll recover from the emotional
damage...maybe someday. :-)

Collapse ParseCStringVector into ParseStringVector.  Comment it.
Make it take a const input.
Use std::string::npos instead of -1 (what a mouthful!)
Make ParseEnvironmentOptions take const inputs.
Check its args at the very beginning.
Strdup all the contents of newArgv and free them all at the end.

include/Support/CommandLine.h:
Constify progName and envVar arguments to ParseEnvironmentOptions().

llvm-svn: 7905
2003-08-15 21:05:57 +00:00
Brian Gaeke
1fea9addaa Add support for reading command line arguments from an environment variable.
llvm-svn: 7851
2003-08-14 22:00:59 +00:00
Chris Lattner
78f944d347 Add support for "named positional arguments"
llvm-svn: 7421
2003-07-30 17:34:02 +00:00
Misha Brukman
74d17238cb Fixed grammatical error.
llvm-svn: 7160
2003-07-10 21:38:28 +00:00
Misha Brukman
c12238543a Lowercase versions of `occurrence' need to be spelled correctly, too.
llvm-svn: 7142
2003-07-10 17:05:26 +00:00
Misha Brukman
14194dcdae Occurrence' has no a' and the `r' is doubled.
llvm-svn: 7140
2003-07-10 16:49:51 +00:00
Chris Lattner
4d3ee0f3b1 Add support for 'unsigned' command line arguments
llvm-svn: 6928
2003-06-28 15:47:20 +00:00
Chris Lattner
7099c87692 Add new CommaSeparated option modifier
llvm-svn: 6294
2003-05-22 20:26:17 +00:00
Chris Lattner
802d657a39 Destroy using declarations
llvm-svn: 6291
2003-05-22 20:06:43 +00:00
Chris Lattner
a4b59e7f2b Simplify writing custom parsers.
llvm-svn: 3256
2002-08-07 18:36:37 +00:00
Chris Lattner
86b1459fdb Fix lli with no arguments
llvm-svn: 3226
2002-08-02 21:51:29 +00:00
Chris Lattner
e6e1bc4719 Fix bug that was causing problems for lli
llvm-svn: 3176
2002-07-31 16:29:43 +00:00
Chris Lattner
abbfb07573 * Fix assertion failure caused by command line argument getting removed after
the map was freed.
* Cleanup code a bit

llvm-svn: 3121
2002-07-29 20:58:42 +00:00
Chris Lattner
86e5192d95 Remove needless #include
llvm-svn: 3117
2002-07-27 05:25:29 +00:00
Chris Lattner
05fe67c0d2 *** empty log message ***
llvm-svn: 3075
2002-07-25 06:17:51 +00:00
Chris Lattner
b0e9d1b80c Fix a bug exposed by lli
llvm-svn: 3049
2002-07-24 20:15:13 +00:00
Chris Lattner
d39f1f6b60 *** empty log message ***
llvm-svn: 2999
2002-07-23 17:15:12 +00:00
Chris Lattner
706b40541e Minor bugfix, prevents error in LLI
llvm-svn: 2989
2002-07-22 02:21:57 +00:00
Chris Lattner
435788e8c3 Checkin CommandLine 2.0
llvm-svn: 2982
2002-07-22 02:07:59 +00:00
Chris Lattner
555163a0ab Add ability to update existing variables with values read from the command line
to certain classes.  This is nice because it means that in header files we can
just declare a value, and still have that value be set based on a command-line
argument.  The difference is now that the #include of CommandLine.h does not
need to go into the header file as well.

llvm-svn: 2708
2002-05-22 17:03:05 +00:00
Chris Lattner
96e0c48175 Eliminate duplicate or unneccesary #include's
llvm-svn: 2397
2002-04-29 17:42:12 +00:00
Chris Lattner
08443aa73b 64 bit clean now
llvm-svn: 1789
2002-02-24 23:02:12 +00:00
Chris Lattner
d1f09685e3 If an invalid alternative is listed for an argument, print the valid options
llvm-svn: 1604
2002-01-31 00:42:56 +00:00
Chris Lattner
3dc9a2a61f Changes to build successfully with GCC 3.02
llvm-svn: 1503
2002-01-20 22:54:45 +00:00
Chris Lattner
463cc31132 Create a new #include "Support/..." directory structure to move things
from "llvm/Support/..." that are not llvm dependant.

Move files and fix #includes

llvm-svn: 1400
2001-11-27 00:03:19 +00:00
Chris Lattner
9158ea6980 * Implement support for folding multiple single letter arguments together like
with ls: ls -la  === ls -l -a
* Implement support for trimming arguments that start with a single letter
  argument so that -lfoo is recognized as -l foo for the linker

llvm-svn: 1378
2001-11-26 18:58:34 +00:00
Chris Lattner
269c7dd5d3 Provide option to enable eating of all arguments following a specific one
llvm-svn: 986
2001-10-27 05:54:17 +00:00
Chris Lattner
c3cee9637c Clean up error handling a bit. Add / as a seperator for command line arguments. This is just a big old ugly hack.
llvm-svn: 974
2001-10-24 06:21:56 +00:00
Chris Lattner
57781f7fda Add StringList support
llvm-svn: 766
2001-10-13 06:53:19 +00:00
Chris Lattner
8de7c629dd Fixed a bug exposed when doing something like this: <program> -notanoption --help
llvm-svn: 293
2001-07-25 18:40:49 +00:00
Chris Lattner
aafababdd2 Doh! Wrong Optional flag. :(
llvm-svn: 290
2001-07-23 23:14:23 +00:00
Chris Lattner
501f2d27ea Add a comment indicating that there is documentation of the library
llvm-svn: 289
2001-07-23 23:04:07 +00:00
Chris Lattner
866521c345 Minor changes to implementation of CommandLine library to let users override
options forced by different  subclasses of Option

llvm-svn: 286
2001-07-23 23:02:45 +00:00
Chris Lattner
3e365b974b CommandLine library cleanup. No longer use getValue/setValue, instead, just treat the commandline
args as the objects they represent and the "right thing" will happen

llvm-svn: 283
2001-07-23 19:27:24 +00:00
Chris Lattner
ff6c44f04f Moved inline/llvm/Tools/* to include/llvm/Support/*
llvm-svn: 279
2001-07-23 17:46:59 +00:00
Chris Lattner
59f8477b5c Initial checkin
llvm-svn: 278
2001-07-23 17:17:47 +00:00