Commit Graph

132 Commits

Author SHA1 Message Date
Devang Patel
1bc89361c2 Now LoopUnswitch is a LoopPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34992 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-07 00:26:10 +00:00
Chris Lattner
f2e292ce58 push bytecode decompressor out through APIs. Now the bytecode reader
api's look like this:

ModuleProvider *getBytecodeModuleProvider(
  const std::string &Filename,  ///< Name of file to be read
  BCDecompressor_t *BCDC = Compressor::decompressToNewBuffer,
  std::string* ErrMsg = 0,      ///< Optional error message holder
  BytecodeHandler* H = 0        ///< Optional handler for reader events
);

This is ugly, but allows a client to say:

  getBytecodeModuleProvider("foo", 0);

If they do this, there is no dependency on the compression libraries, saving
codesize.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34012 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 21:41:02 +00:00
Reid Spencer
ef9b9a7939 For PR411:
This patch replaces the SymbolTable class with ValueSymbolTable which does
not support types planes. This means that all symbol names in LLVM must now
be unique. The patch addresses the necessary changes to deal with this and
removes code no longer needed as a result. This completes the bulk of the
changes for this PR. Some cleanup patches will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33918 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05 20:47:22 +00:00
Reid Spencer
7ba98a9000 For PR1072:
Removing -raise has neglible positive or negative side effects so we are
opting to remove it. See the PR for comparison details.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33844 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-03 23:15:56 +00:00
Reid Spencer
74ed997d52 For PR1152:
Step 1: Copy gccas functionality to opt. This endows opt with a new
-std-compile-opts option to get the set of optimization passes that
gccas used. It also adds -disable-inlining and -disable-opt which
both apply only if -std-compile-opts is given. The -strip-debug option
was also removed. It just makes sure that "-strip" gets done early and
is mostly there for compatibility with gccas. Finally, a new
-verify-each option will cause the verify pass to be run after each pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33786 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-02 14:46:29 +00:00
Chris Lattner
0331524555 shutdown at end of run
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33697 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-31 04:45:28 +00:00
Chris Lattner
17be6791b8 default to emiting an uncompressed .bc file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33420 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-21 06:34:18 +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
Chris Lattner
c30598bc3a make all llvm tools call llvm_shutdown when they exit, static'ify some stuff.
With this change, I can now move -stats to print when llvm_shutdown is called.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32250 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06 01:18:01 +00:00
Chris Lattner
cd950a5308 target constructors are never used
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32099 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-01 21:59:37 +00:00
Nick Lewycky
5cbc63e91a Fix opt -o option. Don't pass a pointer to an auto variable which is going
away before it's needed, and don't try to delete that pointer!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32055 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-01 00:43:14 +00:00
Bill Wendling
68fe61d6a1 Replacing std::iostreams with llvm iostreams. Some of these changes involve
adding a temporary wrapper around the ostream to make it friendly to
functions expecting an LLVM stream. This should be fixed in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31990 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-29 00:19:40 +00:00
Bill Wendling
a5b31ca856 Convert to using llvm streams instead of iostreams.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31989 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-28 23:33:06 +00:00
Reid Spencer
3ed469ccd7 For PR786:
Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining
issues when they see them. All changes pass DejaGnu tests and Olden.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31380 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-02 20:25:50 +00:00
Chris Lattner
5e9b177cb5 Add a --disable-compression option like llvm-link/llvm-as etc have
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29941 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-28 17:31:55 +00:00
Chris Lattner
3b2493e2a1 -analyze mode shouldn't output a .bc file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29923 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-27 22:40:26 +00:00
Chris Lattner
7f500f7f2a Merge the 'analyze' mode code with the 'opt' mode code. Eliminate the
'autodetect .ll files' functionality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29915 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-27 22:07:01 +00:00
Reid Spencer
62c5105adc For PR885:
Consolidate the LinkAllAnalyses.h and LinkAllPasses.h headers into one
so there is no dupliation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29787 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-21 05:34:03 +00:00
Nate Begeman
da6169b996 Fix a build failure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29786 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-21 04:57:01 +00:00
Reid Spencer
023fcf9776 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29785 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-21 02:04:43 +00:00
Reid Spencer
61c83e023f For PR797:
Rid the Assembly Parser of exceptions. This is a really gross hack but it
will do until the Assembly Parser is re-written as a recursive descent.
The basic premise is that wherever the old "ThrowException" function was
called (new name: GenerateError) we set a flag (TriggerError). Every
production checks that flag and calls YYERROR if it is set. Additionally,
each call to ThrowException in the grammar is replaced with GEN_ERROR
which calls GenerateError and then YYERROR immediately. This prevents
the remaining production from continuing after an error condition.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29763 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-18 08:43:06 +00:00
Reid Spencer
fd90dd5d55 For PR872:
Shrinkify LLVM's footprint by removing the analyze tool and moving its
functionality into the opt tool. THis eliminates one of the largest tools
from LLVM and doesn't make opt much bigger because it already included
most of the analysis passes.  To get the old analyze functionality pass
the -analyze option to opt. Note that the integeration here is dead
simple. The "main" of analyze was just copied to opt and invoked if the
-analyze option was given. There may be opportunities for further
integration such as removing the distinction between transform passes
and analysis passes.

To use the analysis functionality, if you previously did this:
  analyze $FNAME -domset -disable-verify
you would now do this:
  opt -analyze $FNAME -domset -disable-verify
Pretty simple.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29762 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-18 06:34:30 +00:00
Chris Lattner
831b121039 Don't pass target name into TargetData anymore, it is never used or needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28831 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-16 18:23:49 +00:00
Reid Spencer
af303d53e6 For PR780:
1. Add #includes to LinkAllVMCore.h to get Mangler.o and InlineAsm.o
2. Make Mangler.h and InlineAsm.h use the macros to ensure linkage
3. Make each of the tools with --load options include LinkAllVMCore.h
This should be the last set of changes for this bug and 800.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28719 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-07 23:03:13 +00:00
Owen Anderson
07000c6f01 Refactor a bunch of includes so that TargetMachine.h doesn't have to include
TargetData.h.  This should make recompiles a bit faster with my current
TargetData tinkering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28238 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-12 06:33:49 +00:00
Misha Brukman
3da94aec4d Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21428 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-22 00:00:37 +00:00
Jeff Cohen
5fb6ed4ae6 Use binary mode for reading/writing bytecode files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19751 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-22 17:36:17 +00:00
Jeff Cohen
e67bc1384a Get the #ifdef right on LinkAllPasses.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19310 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-06 07:01:08 +00:00
Jeff Cohen
00f3db6a4c Fix minor mistakes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19309 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-06 06:29:42 +00:00
Jeff Cohen
4b807e0381 Add project opt to Visual Studio.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19307 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-06 06:02:53 +00:00
Reid Spencer
564a571f62 Make opt honor the quiet option when printing the bytecode warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19294 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-05 17:31:55 +00:00
Reid Spencer
5737913c46 Move the code for printing out a warning about bytecode output to a console
into lib/Support so it can be used with other tools.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19238 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-01 23:57:01 +00:00
Reid Spencer
1ef8bdaedb For PR351:
* Place a try/catch block around the entire tool to Make sure std::string
  exceptions are caught and printed before exiting the tool.
* Make sure we catch unhandled exceptions at the top level so that we don't
  abort with a useless message but indicate than an unhandled exception was
  generated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19192 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-30 05:36:08 +00:00
Reid Spencer
227b6d00dd Fix usage of changed function prototype
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17798 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-14 22:30:54 +00:00
Misha Brukman
81dd3d4536 Fix hyphenation and quoting style for great justice
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17024 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-15 23:22:48 +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
Reid Spencer
9de7b334ec The functions in Signal.h are now in the llvm::sys namespace - adjust
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16091 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-29 19:28:55 +00:00
Chris Lattner
988a1a0c66 Prune unused #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14753 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 04:05:32 +00:00
Chris Lattner
4a1de8b250 Add -load option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14740 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 01:08:19 +00:00
Chris Lattner
3153e4fc80 Neuter the -q option. Stop printing the "program modified" message, ever
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13844 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-27 20:32:10 +00:00
Reid Spencer
ec7eb45926 Re-introduce the -q option and make opt always return 0, even if the
optimization pasess fail. This is necessary to avoid breaking feature
tests in the tests suite that depend on this behavior. *sigh*


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13832 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-27 16:28:54 +00:00
Reid Spencer
0870594530 Removed the -q option and the default message written to stderr. The
output produces confusing results in TestRunner.sh


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13828 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-27 08:26:22 +00:00
Chris Lattner
bed85ff010 Header file moved
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13813 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-27 05:41:36 +00:00
Chris Lattner
76351aa57e Fix wonky header
Address PR305: LLVM tools will happily spew bytecode onto your terminal


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12602 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 05:06:57 +00:00
Chris Lattner
f73b4ca7f9 Make sure to print a stack trace whenever an error signal is delivered to the
tool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11632 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-19 20:32:12 +00:00
Chris Lattner
b592fc2b8d Make 'opt -o -' work correctly instead of creating a file named './-'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10359 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 14:41:33 +00:00
Brian Gaeke
d0fde30ce8 Put all LLVM code into the llvm namespace, as per bug 109.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-11 22:41:34 +00:00
John Criswell
1ee1e64293 Removed extraneous comment line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9308 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 20:40:30 +00:00
John Criswell
7c0e022c5c Added copyright header to all C++ source files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9291 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 17:47:21 +00:00
Misha Brukman
452fea9972 Fix grammar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9026 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 17:56:49 +00:00