Commit Graph

48 Commits

Author SHA1 Message Date
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
7d91e49ff7 Finally give bugpoint -timeout support!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15163 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-24 07:53:26 +00:00
Misha Brukman
eed80e2375 * Convert "\n" -> '\n'
* Print out another '\n' after printing out program execution status
* Make sure code wraps at 80 cols


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15123 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-23 01:30:49 +00:00
Brian Gaeke
7848e68c16 These files don't need to include <iostream> since they include "Support/Debug.h".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15089 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 20:50:33 +00:00
Chris Lattner
4d143ee019 IA64 compat
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14867 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-16 00:08:28 +00:00
Chris Lattner
60083e2fc0 Use the new commandline flag to allow us to call bugpoint like this:
bugpoint ... --tool-args -enable-correct-eh-support -regalloc=linearscan --args -- -foo

So that tool-args option gets the -enable-correct-eh-support -regalloc=linearscan flags instead of bugpoint.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13389 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-06 22:05:35 +00:00
Chris Lattner
817d8d3046 Remove a really old comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13385 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-06 19:29:58 +00:00
Brian Gaeke
636df3d7ec Add --tool-args flag which lets you pass arguments to llc or lli.
This is intended to address Bug 40.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13358 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-04 21:09:16 +00:00
Misha Brukman
b687d82b02 * Reorder #includes
* Wrap a long line


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13061 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-19 03:12:35 +00:00
Chris Lattner
58d84ced5f If the program returns a non-zero exit value, don't leave files laying
around


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12603 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-02 05:33:06 +00:00
Chris Lattner
ea9212ca96 Add a new method for use by the code generator crash debugger.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11613 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-18 23:25:22 +00:00
Chris Lattner
9709272675 Make the executeProgram method exception safe, not leaving around bytecode
files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11607 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-18 22:01:21 +00:00
Chris Lattner
7bb11547e4 Update comments, if we are running with the CBE, make sure the Interpreter
variable and the CBE variable are pointer equal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11599 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-18 20:52:02 +00:00
Brian Gaeke
c5cad211d6 Add check-exit-code option, defaulting to true.
Add ProgramExitedNonzero argument to executeProgram(), and make it
tell its caller whether the program exited nonzero.

Move executeProgramWithCBE() out of line, to ExecutionDriver.cpp, and remove
its extra arguments which are always defaulted.  Make it turn off
check-exit-code if the program exits nonzero while generating a reference
output.

Make diffProgram() assume that any nonzero exit code is a failure, if
check-exit-code is turned on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11325 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-11 18:37:32 +00:00
Chris Lattner
fa76183e8e finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10839 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 03:38:37 +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
Brian Gaeke
b5ee509be2 Fix the first FIXME in this file: automatically pick a "good"
interpreter by default, by picking the first one that works
from a hard-coded list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9337 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 17:41:35 +00:00
Chris Lattner
943211187d fix file headers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9293 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 17:57:13 +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
Chris Lattner
6ebe44d22f Ok, return an explicit path to the shared object, unbreaking code generator
debugging with the JIT


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9273 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-19 21:54:13 +00:00
Chris Lattner
1a28a2b76d Don't leave a trail of bugpoint-execution-output-* breadcrumbs all over the place
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9242 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-18 21:02:51 +00:00
Chris Lattner
367e1ee5be Change run-lli -> run-int
Many people associate lli with the jit, so we don't want to suprise them


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9238 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-18 20:30:48 +00:00
Chris Lattner
25d66473c6 Default to using the CBE instead of the Interpreter if no -run-* option is specified
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9237 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-18 20:18:20 +00:00
Chris Lattner
7dac658792 add support forloading additional .so files on the command line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9131 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-14 22:24:31 +00:00
Chris Lattner
769f1fe672 Change the execute methods to take the shared object filename by const reference.
Other adjustments to work with the new ToolRunner interfaces


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9130 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-14 21:59:36 +00:00
Chris Lattner
a0f5b15e1e The return value of compileSharedObject was never used. Return the shared
object's name instead


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9120 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-14 21:09:11 +00:00
Chris Lattner
5de0bac111 This header file moved. Thanks to Bill and Nightly tester for noticing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8920 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-07 13:45:51 +00:00
Misha Brukman
4148556a9c Use the newly abstracted interface for running our tools and gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8756 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-29 22:40:52 +00:00
Misha Brukman
85544baf54 Renaming dis' -> llvm-dis'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8197 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-28 22:14:16 +00:00
Chris Lattner
a59f71adea no-strict-aliasing redux
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7965 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-18 22:32:48 +00:00
Chris Lattner
c13115c633 The CBE generates code which violates the TBAA rules of C, thus we must disable
optimizations based on these rules.  :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7964 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-18 22:32:03 +00:00
Misha Brukman
e49603d79d Re-grouped and alphabetized headers for easier reading and cleaner style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7689 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-07 21:19:30 +00:00
Misha Brukman
0bd75bb92d Moved SystemUtils.h to include/Support and SystemUtils.cpp to lib/Support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7687 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-07 21:04:42 +00:00
Chris Lattner
ca25b956f1 Make sure to flush the output stream so that we get incremental updates
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7555 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-04 00:56:43 +00:00
Chris Lattner
c648dabf65 DEBUG got moved to Debug.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7491 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 22:13:59 +00:00
Chris Lattner
65f62790d6 Use the new FileUtilities library to do diff'ing of files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7484 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 20:29:45 +00:00
Misha Brukman
9d679cbc6c * Moved InputArgv out of anonymous scope to be extern'd in another file.
* Added DEBUG() statements to print out parameters passed to executing programs
* Actually ADD parameters to a program running via the JIT (using vector<char*>)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7433 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 20:15:44 +00:00
Misha Brukman
800e6e216a Moved definition of InputArgv into ExecutionDriver.cpp -- it is only used there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7427 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 17:59:23 +00:00
Misha Brukman
7835c85227 Use a vector<char*> instead of char*[] so that we can add arbitrary number of
parameters, such as command-line arguments that the executing program gets via
bugpoint.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7423 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 17:44:15 +00:00
Misha Brukman
91eabc13d3 BugDriver.h:
* Added method to query if BugDriver is executing the JIT currently.
  This provides the ability in adding code that is conditionally executed in
  codegen debugging phase.

CodeGeneratorBug.cpp:
* Delete test functions from the Safe module
* Code conditionally added when debugging the JIT:
  use the lazy resolver function added to Emitter.cpp to get function pointer
  by name. When compiled into an .so, this is the only way to get a pointer to
  an external function
* Added a symbol disambiguator which will keep symbols uniquely named across
  modules
* Delete generated files by default
* The function `main' *must* stay in the .bc file for the JIT, but that prevents
  debugging it alone. This patch makes the old `main' become `old_main' and adds
  a new function named `main' which just calls the original with the same
  parameters, thereby keeping functionality the same.

ExecutionDriver.cpp:
* Returned to getting unique filenames
* Simplified code choosing between using and not using shared library option


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7364 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-28 19:16:14 +00:00
Misha Brukman
a259c9be2a Made a bunch of cleanups, as per Chris' recommendations:
* Removed unused global and member variables
* Fixed comments (CodeGeneratorBug.cpp)
* Check for possibly failing GCC::create() and CBE::create()
* Remove generated files after diffing the output (e.g., shared object)
* Instead of using std::for_each, use explicit loops as std::for_each may
  duplicate the functor, and ours carries state
* Changed member var from cl::opt<std::string> to just std::string
* Fixed doxygen comments
* Fixed string comparisons to use [ str.empty() ] instead of [ str == "" ]
* Cache instances of CBE and GCC in BugDriver across compilations and executions
  while testing tools.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7302 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 21:59:10 +00:00
Misha Brukman
5073336cd4 Major addition to bugpoint: ability to debug code generators (LLC and LLI).
The C backend is assumed correct and is used to generate shared objects to be
loaded by the other two code generators.

LLC debugging should be functional now, LLI needs a few more additions to work,
the major one is renaming of external functions to call the JIT lazy function
resolver.

Bugpoint now has a command-line switch -mode with options 'compile' and
'codegen' to debug appropriate portions of tools.

ExecutionDriver.cpp: Added implementations of AbstractInterpreter for LLC and
GCC, broke out common code within other tools, and added ability to generate C
code with CBE individually, without executing the program, and the GCC tool can
generate executables shared objects or executables.

If no reference output is specified to Bugpoint, it will be generated with CBE,
because it is already assumed to be correct for the purposes of debugging using
this method. As a result, many functions now accept as an optional parameter a
shared object to be loaded in, if specified.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7293 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 18:17:43 +00:00
Chris Lattner
f479be58f5 Make a comment more accurate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5991 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-03 03:20:36 +00:00
Chris Lattner
cc876a7421 Add support for debugging miscompilations with the use of the JIT or CBE!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5990 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-03 03:19:41 +00:00
Chris Lattner
640f22e66d Implement support for bugpoint to identify which FUNCTION an optimization
is miscompiling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5893 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-24 17:02:17 +00:00
Chris Lattner
3c053a0a98 Allow specifying an input file for the program being executed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5888 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-23 20:31:37 +00:00
Chris Lattner
e1b52b7656 Fix compilation on GCC 3.2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5136 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-24 00:44:34 +00:00
Chris Lattner
4a10645c70 New files for miscompilation detection
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5120 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-23 23:50:16 +00:00