1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

60 Commits

Author SHA1 Message Date
Benjamin Kramer
9a590500ea Make LLVMContext and LLVMContextImpl classes instead of structs.
llvm-svn: 78690
2009-08-11 17:45:13 +00:00
Dan Gohman
ba72f59923 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.

llvm-svn: 78240
2009-08-05 20:21:17 +00:00
Owen Anderson
cf2c39dc30 Factor some of the constants+context related code out into a separate header, to make LLVMContextImpl.h
not hideous.  Also, fix some MSVC compile errors.

llvm-svn: 78115
2009-08-04 22:41:48 +00:00
Dan Gohman
6abbc537f4 Convert more tools code from cerr and cout to errs() and outs().
llvm-svn: 76070
2009-07-16 15:30:09 +00:00
Owen Anderson
4fa7e54329 Make the use of const with respect to LLVMContext sane. Hopefully this is the last time, for the
moment, that I will need to make far-reaching changes.

llvm-svn: 74655
2009-07-01 23:13:44 +00:00
Owen Anderson
cf112e59c3 Hold the LLVMContext by reference rather than by pointer.
llvm-svn: 74640
2009-07-01 21:22:36 +00:00
Owen Anderson
81b8dabb53 Add a pointer to the owning LLVMContext to Module. This requires threading LLVMContext through a lot
of the bitcode reader and ASM parser APIs, as well as supporting it in all of the tools.

Patches for Clang and LLVM-GCC to follow.

llvm-svn: 74614
2009-07-01 16:58:40 +00:00
Dan Gohman
6cf471ad30 Use CloneModule's ValueMap in more places, instead of looking
up functions by name.

llvm-svn: 69805
2009-04-22 15:57:18 +00:00
Dan Gohman
df0e24acce Generalize bugpoint's concept of a "safe" backend, and add options
to allow the "safe" backend to be run with a different path, and/or
with different command-line options.

This enables the following use cases:
 - bugpoint llc against an llc command from a different build
 - bugpoint llc against the same llc with different command-line options
 - and more...

Also, document the existing "custom" interpreter options.

llvm-svn: 60681
2008-12-08 04:02:47 +00:00
Chris Lattner
309aeb140b remove attributions from tools.
llvm-svn: 45421
2007-12-29 20:44:31 +00:00
Nick Lewycky
a0c9b79552 Allow the block extractor take to take a list of basic blocks to not extract
from a file containing Function/BasicBlock pairings. This is not safe against
anonymous or abnormally-named Funcs or BBs.

Make bugpoint use this interface to pass the BBs list to the child bugpoint.

llvm-svn: 44101
2007-11-14 06:47:06 +00:00
Gabor Greif
9e76bbf30e Pretty straightforward replacement of "bytecode" by "bitcode"
performed on tools/ first, in order not to cause lethal damage

llvm-svn: 37877
2007-07-04 21:55:50 +00:00
Anton Korobeynikov
87e945c62d Add possibility to set memory limit for binaries run via libSystem. This
is especially needed for bugpoint. This partly implements PR688

llvm-svn: 34349
2007-02-16 19:11:07 +00:00
Bill Wendling
b9780660dd Fix for PR960. Improves bugpoint so that it removes global variable
initializers as well. This is only a first pass. It can be slow because
it clones the module for each pass. An obvious improvement is not to do that.

llvm-svn: 31182
2006-10-25 18:36:14 +00:00
Chris Lattner
1e2c7fe283 Add a new -cbe-bug mode, which works just like -run-llc, except that it uses
LLC as the reference compiler to reduce testcases for bugs in GCC.

llvm-svn: 30400
2006-09-15 21:29:15 +00:00
Chris Lattner
9fbf5a233e fit in 80 cols
llvm-svn: 29754
2006-08-17 18:51:28 +00:00
Patrick Jenkins
689b3e1549 This commit adds a new feature called find-bugs. The find-bugs option can be invoked on a .bc file from the command like with -find-bugs and a list of passes you wish to test. This procedure takes the set of optimization passes the user specifies, randomizes the passes, runs the passes on the specified .bc file, compiles the program, and finally runs the program checking its output vs the .bc file with no optimizations. This process repeats until either the user kills bugpoint or an error occurs in the optimizations, program complitation, or the running of the program. If an error occurs, bugpoint attempts to diagnose the error by eliminating passes that are not at fault and code that is not needed.
llvm-svn: 29703
2006-08-15 16:40:49 +00:00
Chris Lattner
05b6364eef Teach bugpoint to kill optimization passes that run over the timeout limit,
which allows it to debug optimizer infinite loops.  This patch is contributed
by Nick Lewycky, thanks!

llvm-svn: 28763
2006-06-13 03:10:48 +00:00
Reid Spencer
36b05575fe For PR351:
Generally, remove use of fork/exec from bugpoint in favor of the portable
sys::Program::ExecuteAndWait method. This change requires two new options
to bugpoint to tell it that it is running in "child" mode. In this mode,
it reads its input and runs the passes. The result code signals to the
parent instance of bugpoint what happened (success, fail, crash).

This change should make bugpoint usable on Win32 systems.

llvm-svn: 24961
2005-12-22 20:02:55 +00:00
Chris Lattner
c7ffb0c713 When the user hits ctrl-c, bugpoint should attempt to stop reduction as
quickly as possible and output what it has so far.  If they hit it twice,
bugpoint is killed.

llvm-svn: 22579
2005-08-02 02:16:17 +00:00
Jeff Cohen
4d31aeb9df Eliminate tabs and trailing spaces
llvm-svn: 21441
2005-04-22 04:13:13 +00:00
Misha Brukman
960a8d47d7 Remove trailing whitespace
llvm-svn: 21428
2005-04-22 00:00:37 +00:00
Chris Lattner
bc83892156 Implement basic block extraction for the miscompilation debugger. This still needs
two things: the FIXME in ExtractBlocks needs to be implemented, and the basic block
extractor itself needs to have enough bugs fixed for this to be more or less
useful.

Until the time that this is generally useful, it is hidden behind the new bugpoint
-enable-block-extraction option.  I hope to get the FIXME done tonight.

Also of note, this patch adds a -extract-bbs option to bugpoint which can be used
to debug the block extractor.  (hint hint Misha :)

llvm-svn: 13471
2004-05-11 21:54:13 +00:00
Chris Lattner
d2c51f2cc3 Merge the code generator miscompilation code into the optimizer miscompilation
code.  This "instantly" gives us loop-extractor power to assist with the
debugment of our nasty codegen issues.  :)

llvm-svn: 12678
2004-04-05 22:58:16 +00:00
Chris Lattner
0442a87f47 Make a method public
llvm-svn: 12677
2004-04-05 22:01:48 +00:00
Chris Lattner
d82b46916c Add a new "AutoDebugCrashes" option
llvm-svn: 12396
2004-03-14 21:21:57 +00:00
Chris Lattner
c3bbd5a66d Add new method
llvm-svn: 12394
2004-03-14 21:17:03 +00:00
Chris Lattner
491f3054b8 Refactor and clean up a bunch more code. No major functionality changes.
* Make several methods of bugdriver global functions (ParseInputFile, PrintFunctionList)
 * Make PrintFunctionList truncate the output after 10 entries, like the crash debugger
   did.  This allows code sharing.
 * Add a couple of methods to BugDriver that allows us to eliminate some friends
 * Improve comments in ExtractFunction.cpp
 * Make classes that used to be friends up bugdriver now live in anon namespaces
 * Rip a bunch of functionality in the miscompilation tester into a new
   TestMergedProgram function for future code sharing.
 * Fix a bug in the miscompilation tester induced in my last checkin

llvm-svn: 12393
2004-03-14 20:50:42 +00:00
Chris Lattner
07b9a2c117 Add a method to extract a loop
llvm-svn: 12391
2004-03-14 20:02:07 +00:00
Chris Lattner
36e8168af5 Refactor all of the "splitting a module into two pieces" code to avoid
code duplication.  Also, don't use ReduceMiscompilingFunctions::TestFuncs
to print out the final message.

llvm-svn: 12387
2004-03-14 19:27:19 +00:00
Chris Lattner
2fba96f37e Add a new method for use by the code generator crash debugger.
llvm-svn: 11613
2004-02-18 23:25:22 +00:00
Chris Lattner
6e7c1e5c5c Make more stuff public. Make the instruction argument to
deleteInstructionFromProgram be const

llvm-svn: 11606
2004-02-18 21:50:26 +00:00
Chris Lattner
975c9272ef make a bunch of methods public
llvm-svn: 11605
2004-02-18 21:35:28 +00:00
Chris Lattner
8a76047d63 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
0eec2f9d9d 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
264e195392 Add a stub for debugging code generator crashes
llvm-svn: 11602
2004-02-18 21:02:04 +00:00
Chris Lattner
1f2a818b9f 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
Brian Gaeke
04b8fe6b33 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
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
Chris Lattner
62b495bd5c 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
c26574d777 Simplify the performFinalCleanups interface
llvm-svn: 9740
2003-11-05 21:15:19 +00:00
Chris Lattner
656ad51b9d fix file headers
llvm-svn: 9293
2003-10-20 17:57:13 +00:00
John Criswell
d06dc1136b Added copyright header to all C++ source files.
llvm-svn: 9291
2003-10-20 17:47:21 +00:00
Chris Lattner
2db02886eb Be more helpful if a pass fails while chasing down a miscompilation
llvm-svn: 9214
2003-10-17 23:03:16 +00:00
Chris Lattner
1a8192c85e 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
60503a16cf 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
cd4179f054 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
Chris Lattner
ef04e86804 Parameterize the performFinalCleanups a bit
llvm-svn: 7477
2003-08-01 16:13:49 +00:00
Misha Brukman
216406a10b Added comment to function isExecutingJIT()
llvm-svn: 7370
2003-07-28 20:59:16 +00:00
Misha Brukman
844d79f8f5 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