Commit Graph

194 Commits

Author SHA1 Message Date
Chris Lattner 2fd76cfb69 make a bunch of methods public
llvm-svn: 11605
2004-02-18 21:35:28 +00:00
Chris Lattner 1942f98d80 A couple of minor cleanups: don't forward declare private classes, put private
classes in an anon namespace

llvm-svn: 11604
2004-02-18 21:29:46 +00:00
Chris Lattner 327019b495 Cleanup and simplify manipulation of the program, eliminate the need for so
many 'friends' of bugdriver.

llvm-svn: 11603
2004-02-18 21:24:48 +00:00
Chris Lattner ead1dff00b Add a stub for debugging code generator crashes
llvm-svn: 11602
2004-02-18 21:02:04 +00:00
Chris Lattner 898de4a158 Update comments, if we are running with the CBE, make sure the Interpreter
variable and the CBE variable are pointer equal.

llvm-svn: 11599
2004-02-18 20:52:02 +00:00
Chris Lattner 61dc9419e0 ctor arguments changed order
llvm-svn: 11595
2004-02-18 20:22:25 +00:00
Chris Lattner 947143df0e Catch exception and print message as appropriate
llvm-svn: 11594
2004-02-18 20:22:11 +00:00
Chris Lattner eb89dbada8 Bugpoint will be throwing exceptions soon, perpare for the worst.
llvm-svn: 11584
2004-02-18 17:32:54 +00:00
Chris Lattner d69c7bdc74 This class got moved to FileUtilities.h
llvm-svn: 11583
2004-02-18 17:17:10 +00:00
Chris Lattner 6e540af8f7 The CBE is now in llc, not llvm-dis
llvm-svn: 11534
2004-02-17 06:40:51 +00:00
Brian Gaeke 35145beb61 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.

llvm-svn: 11325
2004-02-11 18:37:32 +00:00
Chris Lattner 2f1aa118a4 finegrainify namespacification
llvm-svn: 10839
2004-01-14 03:38:37 +00:00
Chris Lattner 69d47e7314 Bugpoint had appalingly bad grammar. Fix some of it.
llvm-svn: 10308
2003-12-07 02:43:09 +00:00
Chris Lattner 233b069113 Do not leave a bunch of crud lying around
llvm-svn: 10307
2003-12-07 02:31:03 +00:00
Chris Lattner 58efc9e0fe be 3.4 happy
llvm-svn: 10265
2003-11-29 20:04:13 +00:00
Chris Lattner 3f1ad878ac Do not DESTROY programs by default. No wonder bugpoint was not being useful all this time!
llvm-svn: 10175
2003-11-23 04:51:05 +00:00
Chris Lattner 7b233af247 Do not crash when dealing with invoke and unwind instructions!
llvm-svn: 10160
2003-11-22 02:10:38 +00:00
Chris Lattner 1e6089c2d6 Use new interfaces
llvm-svn: 10159
2003-11-22 02:10:26 +00:00
Brian Gaeke 960707c335 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Chris Lattner 2920100e4d I hate it when bugpoint is all ready to give me a bytecode file, then crashes
in final cleanups.  Then you had to run the whole mess again with
-disable-final-cleanups.

This makes bugpoint run the cleanups in a protected environment so that if
they crash, bugpoint itself doesn't crash.  This makes things much happier,
implements a FIXME, and gets rid of YABPO (yet another bugpoint option).

llvm-svn: 9743
2003-11-05 21:45:35 +00:00
Chris Lattner debac38f5e Simplify the performFinalCleanups interface
llvm-svn: 9740
2003-11-05 21:15:19 +00:00
Chris Lattner 4f50ebda32 Do not print out lists with thousands of elements in them, that's kinda silly
llvm-svn: 9523
2003-10-27 04:44:59 +00:00
Chris Lattner f3e8f97d7e Fix an assertion failure in Bugpoint
llvm-svn: 9406
2003-10-23 15:42:55 +00:00
Brian Gaeke 9a0bdb1aca 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.

llvm-svn: 9337
2003-10-21 17:41:35 +00:00
John Criswell abe5cdcf21 Added LLVM copyright to Makefiles.
llvm-svn: 9314
2003-10-20 22:29:16 +00:00
Misha Brukman 098cafd62b Made error message more comprehensible.
llvm-svn: 9299
2003-10-20 19:43:47 +00:00
Chris Lattner ebec8030d6 fix file headers
llvm-svn: 9293
2003-10-20 17:57:13 +00:00
John Criswell 09344dcf97 Added copyright header to all C++ source files.
llvm-svn: 9291
2003-10-20 17:47:21 +00:00
Chris Lattner 4705141f28 Don't bother forwarding function references which are external to the program entirely
llvm-svn: 9274
2003-10-19 23:32:50 +00:00
Chris Lattner 2b97d6e7cd Ok, return an explicit path to the shared object, unbreaking code generator
debugging with the JIT

llvm-svn: 9273
2003-10-19 21:54:13 +00:00
Chris Lattner a4004f6678 Fix iterator invalidation problem
llvm-svn: 9272
2003-10-19 21:48:27 +00:00
Chris Lattner a9a7c92cea Update compile information
llvm-svn: 9247
2003-10-18 21:55:47 +00:00
Chris Lattner 849619e23e Add usage blurb
llvm-svn: 9246
2003-10-18 21:55:35 +00:00
Chris Lattner 667ad30e5a Print -fno-strict-aliasing as well
llvm-svn: 9243
2003-10-18 21:08:57 +00:00
Chris Lattner 759b9931fe Don't leave a trail of bugpoint-execution-output-* breadcrumbs all over the place
llvm-svn: 9242
2003-10-18 21:02:51 +00:00
Chris Lattner 9e52550555 Change run-lli -> run-int
Many people associate lli with the jit, so we don't want to suprise them

llvm-svn: 9238
2003-10-18 20:30:48 +00:00
Chris Lattner 16d36a1875 Default to using the CBE instead of the Interpreter if no -run-* option is specified
llvm-svn: 9237
2003-10-18 20:18:20 +00:00
Chris Lattner bb831b9cf9 If we detect a pass crash during miscompilation testing, immediately enter the
crash debugger

llvm-svn: 9234
2003-10-18 19:27:48 +00:00
Chris Lattner 54cbc41d05 Fix bug in my checkin
llvm-svn: 9217
2003-10-18 00:14:13 +00:00
Chris Lattner ea48572a80 Another formatting fix
llvm-svn: 9216
2003-10-18 00:05:05 +00:00
Chris Lattner 92a9f7adc4 More cleanups
llvm-svn: 9215
2003-10-17 23:07:47 +00:00
Chris Lattner 7d147aec11 Be more helpful if a pass fails while chasing down a miscompilation
llvm-svn: 9214
2003-10-17 23:03:16 +00:00
Brian Gaeke adbbfebfae Flush output after writing out the list of function names.
llvm-svn: 9138
2003-10-15 20:42:48 +00:00
Chris Lattner dc92fa6473 add support forloading additional .so files on the command line
llvm-svn: 9131
2003-10-14 22:24:31 +00:00
Chris Lattner 3f6e522257 Change the execute methods to take the shared object filename by const reference.
Other adjustments to work with the new ToolRunner interfaces

llvm-svn: 9130
2003-10-14 21:59:36 +00:00
Chris Lattner f8a84dbff3 The return value of compileSharedObject was never used. Return the shared
object's name instead

llvm-svn: 9120
2003-10-14 21:09:11 +00:00
Chris Lattner 6ad91d7166 minor cleanups
llvm-svn: 9118
2003-10-14 21:01:51 +00:00
Chris Lattner 67cc196bf7 Fix minor formatting bug
llvm-svn: 9116
2003-10-14 20:55:56 +00:00
Chris Lattner 2ed0642a95 Eliminate the bugpoint -mode option, by making bugpoint automatically infer the root of all of your problems
llvm-svn: 9115
2003-10-14 20:52:55 +00:00
Chris Lattner 6ca0b8738a Unbreak code generator debug mode
llvm-svn: 9106
2003-10-13 21:04:26 +00:00
Brian Gaeke c4501c936f Don't include <stdlib.h>.
llvm-svn: 9038
2003-10-10 19:12:45 +00:00
Misha Brukman 8b2bd4ed47 Fix spelling.
llvm-svn: 9027
2003-10-10 17:57:28 +00:00
Chris Lattner 10bd1c2c4e This header file moved. Thanks to Bill and Nightly tester for noticing
llvm-svn: 8920
2003-10-07 13:45:51 +00:00
Misha Brukman 5bc6a8fa38 Use the newly abstracted interface for running our tools and gcc.
llvm-svn: 8756
2003-09-29 22:40:52 +00:00
Chris Lattner 8552e7c6df Use new method
llvm-svn: 8573
2003-09-17 05:00:07 +00:00
Misha Brukman 46e18d437e Bugpoint has the ability of generating a plethora of core files, so to
avoid filling up the disk, set the max core file size to 0.

llvm-svn: 8503
2003-09-12 20:42:57 +00:00
Brian Gaeke ef4327037a Check in the fix I meant to apply here, but mistakenly applied to
tools/extract instead..... heh

llvm-svn: 8464
2003-09-10 21:11:42 +00:00
Misha Brukman bd779f7819 Renaming `dis' -> `llvm-dis'.
llvm-svn: 8197
2003-08-28 22:14:16 +00:00
Chris Lattner d1123fde11 Kill warning
llvm-svn: 8056
2003-08-22 18:57:43 +00:00
Misha Brukman 188bf100aa Squash the warning that `Result' may not be initialized on all code paths.
llvm-svn: 8042
2003-08-22 03:35:24 +00:00
Chris Lattner a615c77cde no-strict-aliasing redux
llvm-svn: 7965
2003-08-18 22:32:48 +00:00
Chris Lattner c8e81ba355 The CBE generates code which violates the TBAA rules of C, thus we must disable
optimizations based on these rules.  :(

llvm-svn: 7964
2003-08-18 22:32:03 +00:00
Misha Brukman 7eb05a170a Spell `necessary' correctly.
llvm-svn: 7944
2003-08-18 14:43:39 +00:00
Chris Lattner 7a993b7aad Give correct command line for making a shared object
llvm-svn: 7929
2003-08-17 23:38:53 +00:00
Chris Lattner f1243ba515 Make sure that "newmain" gets names for its arguments
llvm-svn: 7927
2003-08-17 22:14:20 +00:00
Chris Lattner 8877fa2e5e Fix message
llvm-svn: 7926
2003-08-17 22:08:25 +00:00
Misha Brukman 1b7a238f3f File-related functions moved to FileUtilities.h .
llvm-svn: 7696
2003-08-07 21:42:28 +00:00
Misha Brukman 0c2305b110 Re-grouped and alphabetized headers for easier reading and cleaner style.
llvm-svn: 7689
2003-08-07 21:19:30 +00:00
Misha Brukman 83d52f3c36 Fixed path for SystemUtils.h and a few code cleanups.
llvm-svn: 7688
2003-08-07 21:05:13 +00:00
Misha Brukman e722e4ea49 Moved SystemUtils.h to include/Support and SystemUtils.cpp to lib/Support.
llvm-svn: 7687
2003-08-07 21:04:42 +00:00
Chris Lattner d1e2aaef4f If we're debugging the SimplifyCFG pass, we _REALLY_ don't want to use it for
narrowing, no matter what.

llvm-svn: 7596
2003-08-05 15:51:05 +00:00
Misha Brukman 689398fe76 Only test the vector of functions if it is non-empty.
llvm-svn: 7594
2003-08-05 15:26:21 +00:00
Misha Brukman 4aad821408 Do not attempt to reduce a test case if it is an empty set.
llvm-svn: 7570
2003-08-04 19:03:42 +00:00
John Criswell fe69bc502d Added code that ensures that we don't try to reduce an empty vector of basic
blocks.
This fixes the bugpoint regressions.

llvm-svn: 7569
2003-08-04 18:24:31 +00:00
Chris Lattner 7af360e339 Make sure to flush the output stream so that we get incremental updates
llvm-svn: 7555
2003-08-04 00:56:43 +00:00
Chris Lattner a132c36880 Print accurate run instructions for when testing LLC
llvm-svn: 7554
2003-08-04 00:56:27 +00:00
Chris Lattner 4089d880ff Fix problem I introduced in bugpoint with the cleanup functions
llvm-svn: 7549
2003-08-03 22:29:43 +00:00
Chris Lattner f0c6964470 DEBUG got moved to Debug.h
llvm-svn: 7491
2003-08-01 22:13:59 +00:00
Chris Lattner aa997fbbca Use the new FileUtilities library to do diff'ing of files
llvm-svn: 7484
2003-08-01 20:29:45 +00:00
Chris Lattner 238ec53e70 Use the C++, more portable, deleter
llvm-svn: 7483
2003-08-01 20:29:18 +00:00
Chris Lattner 335c51afdf Don't emit modules with lots of cruft hanging off of them.
llvm-svn: 7478
2003-08-01 16:14:33 +00:00
Chris Lattner f7e125403b Parameterize the performFinalCleanups a bit
llvm-svn: 7477
2003-08-01 16:13:49 +00:00
Misha Brukman 7d9632896d Ignore intrinsic functions -- don't mangle their names or rewrite calls to them.
llvm-svn: 7438
2003-07-30 21:45:20 +00:00
Misha Brukman 87154fdbc0 CodeGeneratorBug.cpp:
* Temporarily externing InputArgv to print it out for the benefit of LLI command
  needed to reproduce the result.
* Print out the list of functions currently being tested
* ListReducer now returns a bool if there was a failure, so test for it

ListReducer.h:
* Handle the case where there is no problem by returning true if failure is
  found. Also correctly handles the case when there is only 1 pass/function.

Miscompilation.cpp:
* ListReducer now returns a bool if there was a failure, so test for it

llvm-svn: 7434
2003-07-30 20:15:56 +00:00
Misha Brukman 40feb36ffd * 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*>)

llvm-svn: 7433
2003-07-30 20:15:44 +00:00
Misha Brukman f9010058d2 Moved definition of InputArgv into ExecutionDriver.cpp -- it is only used there.
llvm-svn: 7427
2003-07-30 17:59:23 +00:00
Misha Brukman 6cb2c57354 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.

llvm-svn: 7423
2003-07-30 17:44:15 +00:00
Chris Lattner c65effdd23 Add variable to capture arguments that should be passed to the user program
This is unused so far.

llvm-svn: 7422
2003-07-30 17:36:07 +00:00
Misha Brukman a845a566e1 * Disambiguate symbols before we start splitting module by functions
* Moved DisambiguateGlobalSymbols() out of the ReduceMisCodegenFunctions class
* Added an assert to have a cleaner exit if `main' is not found in the module

llvm-svn: 7380
2003-07-29 16:02:28 +00:00
Misha Brukman 123c8576e5 Implemented cleanups as suggested by Chris:
* Use Module::getNamedFunction() to delete "main" instead of using a loop
* Compare function pointers instead of function names to determine equivalence
* Simplified creation of a 2-element vector containing zeroes
* Manually performed LICM on code
* Added an abort() in case a function we're considering occurs in something that
  is not an instruction
* Use DEBUG() around code sections instead of just in a statement in a loop,
  because GCC's DCE may not be good enough to completely remove it in a release
  build
* Print out a command that can be directly copied-and-pasted to re-execute
* Instead of just checking if a symbol begins with a dot and fixing it
  accordingly, use Mangler and fix all the problems (invalid chars in C symbol
  names) entirely
* The new `main' function has external linkage

llvm-svn: 7371
2003-07-28 21:07:39 +00:00
Misha Brukman eacfd216d3 Added comment to function isExecutingJIT()
llvm-svn: 7370
2003-07-28 20:59:16 +00:00
Misha Brukman 539f95933c 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

llvm-svn: 7364
2003-07-28 19:16:14 +00:00
Misha Brukman 0fd3172754 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.

llvm-svn: 7302
2003-07-24 21:59:10 +00:00
Misha Brukman d792c9bb46 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.

llvm-svn: 7293
2003-07-24 18:17:43 +00:00
Misha Brukman 6a6587ab02 Fixed misspelling.
llvm-svn: 7223
2003-07-21 21:58:16 +00:00
Misha Brukman 7fdaab4f68 The word `separate' only has one `e'.
llvm-svn: 7173
2003-07-14 17:20:40 +00:00
John Criswell 3ef61afb76 Merged in autoconf branch. This provides configuration via the autoconf
system.

llvm-svn: 7014
2003-06-30 21:59:07 +00:00
Chris Lattner 2599356122 Try to run cleanups even if nothing was modified in the preview passes
llvm-svn: 6897
2003-06-25 04:13:52 +00:00
Chris Lattner 0192b72fde Run dead arg elimination, and tell it that it's ok to hack up non-internal functions
llvm-svn: 6896
2003-06-25 04:13:36 +00:00
Brian Gaeke e38c7d9f2d Use $(PLATFORMLIBDL) to selectively bring in -ldl only on those platforms where
it is needed.

llvm-svn: 6753
2003-06-17 20:09:18 +00:00