summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/BugDriver.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Change the BugDriver to store the current module with std::unique_ptr.Rafael Espindola2018-02-141-12/+16
| | | | | | | | | While there, change a bunch of helper functions to take references to avoid adding calls to get(). This should conclude the bugpoint yak shaving. llvm-svn: 325177
* Convert another use of createUniqueFile to TempFile::create.Rafael Espindola2017-11-161-0/+5
| | | | | | | This one requires a new small feature in TempFile: the ability to keep the temporary file with the temporary name. llvm-svn: 318458
* Convert another use of createUniqueFile to TempFile::create.Rafael Espindola2017-11-161-0/+5
| | | | llvm-svn: 318427
* bugpoint: Return Errors instead of passing around stringsJustin Bogner2016-09-061-26/+23
| | | | | | | | | | | | | This replaces the threading of `std::string &Error` through all of these APIs with checked Error returns instead. There are very few places here that actually emit any errors right now, but threading the APIs through will allow us to replace a bunch of exit(1)'s that are scattered through this code with proper error handling. This is more or less NFC, but does move around where a couple of error messages are printed out. llvm-svn: 280720
* Revert "bugpoint: Stop threading errors through APIs that never fail"Justin Bogner2016-09-061-7/+7
| | | | | | | | | | | | | This isn't the right thing to do - it turns out a number of the APIs that "never fail" just exit(1) if something bad happens. We can and should thread Error through this instead. That diff will make more sense with this reverted. Sorry for the noise. This reverts r280690 llvm-svn: 280691
* bugpoint: Stop threading errors through APIs that never failJustin Bogner2016-09-061-7/+7
| | | | | | | | | | | | | This simplifies ListReducer and most of its subclasses by removing the std::string &Error that was threaded through all of them but almost never used. If we end up needing error handling in more places here we can reinstate it using llvm::Error instead of these unwieldy strings. The 2 cases (out of 12) that actually can hit the error cases are a little bit awkward now, but those will clean up as I refactor this API further. llvm-svn: 280690
* bugpoint: clang-format all of bugpoint. NFCJustin Bogner2016-09-021-27/+29
| | | | | | | I'm going to clean up the APIs here a bit and touch many many lines anyway. llvm-svn: 280450
* Change linkInModule to take a std::unique_ptr.Rafael Espindola2015-12-161-1/+1
| | | | | | | Passing in a std::unique_ptr should help find errors when the module is used after being linked into another module. llvm-svn: 255842
* Use diagnostic handler in the LLVMContextRafael Espindola2015-12-141-8/+1
| | | | | | | | | | | | | | | | This patch converts code that has access to a LLVMContext to not take a diagnostic handler. This has a few advantages * It is easier to use a consistent diagnostic handler in a single program. * Less clutter since we are not passing a handler around. It does make it a bit awkward to implement some C APIs that return a diagnostic string. I will propose new versions of these APIs and deprecate the current ones. llvm-svn: 255571
* Always pass a diagnostic handler to the linker.Rafael Espindola2015-12-041-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | Before this patch the diagnostic handler was optional. If it was not passed, the one in the LLVMContext was used. That is probably not a pattern we want to follow. If each area has an optional callback, there is a sea of callbacks and it is hard to follow which one is called. Doing this also found cases where the callback is a nice addition, like testing that no errors or warnings are reported. The other option is to always use the diagnostic handler in the LLVMContext. That has a few problems * To implement the C API we would have to set the diag handler and then set it back to the original value. * Code that creates the context might be far away from code that wants the diagnostics. I do have a patch that implements the second option and will send that as an RFC. llvm-svn: 254777
* Use references now that it is natural to do so.Rafael Espindola2015-12-011-1/+1
| | | | | | | The linker never takes ownership of a module or changes which module it is refering to, making it natural to use references. llvm-svn: 254449
* [Bugpoint] Use 'CC' instead of 'GCC' for variable naming.Davide Italiano2015-10-141-2/+2
| | | | | | | | | | We now use clang by default and fallback to gcc when requested. With this commit, names reflect reality. No functional change intended. Discussed with: Rafael Espindola. llvm-svn: 250321
* tools: Unify how verifyModule() is calledDuncan P. N. Exon Smith2015-03-311-1/+1
| | | | | | | | | Unify the error messages for the various tools when `verifyModule()` fails on an input module. The "brave new way" is: lltool: path/to/input.ll: error: input module is broken! llvm-svn: 233667
* bugpoint: Verify input filesDuncan P. N. Exon Smith2015-03-261-0/+6
| | | | | | Like r233229 for `llvm-link`, start verifying input files to `bugpoint`. llvm-svn: 233253
* bugpoint: Return early after error, NFCDuncan P. N. Exon Smith2015-03-261-10/+10
| | | | llvm-svn: 233252
* Remove the PreserveSource linker mode.Rafael Espindola2014-10-281-1/+1
| | | | | | | | | | | | | | | | | | | | I noticed that it was untested, and forcing it on caused some tests to fail: LLVM :: Linker/metadata-a.ll LLVM :: Linker/prefixdata.ll LLVM :: Linker/type-unique-odr-a.ll LLVM :: Linker/type-unique-simple-a.ll LLVM :: Linker/type-unique-simple2-a.ll LLVM :: Linker/type-unique-simple2.ll LLVM :: Linker/type-unique-type-array-a.ll LLVM :: Linker/unnamed-addr1-a.ll LLVM :: Linker/visibility1.ll If it is to be resurrected, it has to be fixed and we should probably have a -preserve-source command line option in llvm-mc and run tests with and without it. llvm-svn: 220741
* Update the error handling of lib/Linker.Rafael Espindola2014-10-251-6/+1
| | | | | | Instead of passing a std::string&, use the new diagnostic infrastructure. llvm-svn: 220608
* Return a std::unique_ptr from the IRReader.h functions. NFC.Rafael Espindola2014-08-261-1/+1
| | | | llvm-svn: 216466
* Return a std::unique_ptr from parseInputFile and propagate. NFC.Rafael Espindola2014-08-261-9/+5
| | | | | | | | The memory management in BugPoint is fairly convoluted, so this just unwraps one layer by changing the return type of functions that always return owned Modules. llvm-svn: 216464
* [C++] Use 'nullptr'.Craig Topper2014-04-281-1/+1
| | | | llvm-svn: 207394
* BugPoint: Fix some memory leaks.David Blaikie2014-04-251-0/+4
| | | | | | | | | Patch by Kostya Serebryany. unique_ptr would be nice, but it's a bit too much work for an area I'm not familiar with, nor invested in, unfortunately. llvm-svn: 207265
* [C++] Use 'nullptr'. Tools edition.Craig Topper2014-04-251-4/+4
| | | | llvm-svn: 207176
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-1/+1
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* [Layering] Sink Linker.h into a Linker subdirectory to make itChandler Carruth2014-03-061-1/+1
| | | | | | consistent with every other sub-library header in LLVM. llvm-svn: 203065
* Remove PathV1.h use from BugDriver.cpp.Rafael Espindola2013-06-181-3/+2
| | | | llvm-svn: 184203
* Don't use PathV1.h in ToolRunner.h.Rafael Espindola2013-06-171-0/+1
| | | | llvm-svn: 184107
* Replace uses of the deprecated std::auto_ptr with OwningPtr.Andy Gibbs2013-04-121-1/+1
| | | | llvm-svn: 179373
* Split out the IRReader header and the utility functions it provides intoChandler Carruth2013-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | its own library. These functions are bridging between the bitcode reader and the ll parser which are in different libraries. Previously we didn't have any good library to do this, and instead played fast and loose with a "header only" set of interfaces in the Support library. This really doesn't work well as evidenced by the recent attempt to add timing logic to the these routines. As part of this, make them normal functions rather than weird inline functions, and sink the implementation into the library. Also clean up the header to be nice and minimal. This requires updating lots of build system dependencies to specify that the IRReader library is needed, and several source files to not implicitly rely upon the header file to transitively include all manner of other headers. If you are using IRReader.h, this commit will break you (the header moved) and you'll need to also update your library usage to include 'irreader'. I will commit the corresponding change to Clang momentarily. llvm-svn: 177971
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
* Sort the #include lines for tools/...Chandler Carruth2012-12-041-2/+2
| | | | | | | | Again, tools are trickier to pick the main module header for than library source files. I've started to follow the pattern of using LLVMContext.h when it is included as a stub for program source files. llvm-svn: 169252
* Fix a typo (the the => the)Sylvestre Ledru2012-07-231-1/+1
| | | | llvm-svn: 160621
* rename getHostTriple into getDefaultTargetTripleSebastian Pop2011-11-011-1/+1
| | | | llvm-svn: 143502
* Enhance llvm::SourceMgr to support diagnostic ranges, the same way clang ↵Chris Lattner2011-10-161-1/+1
| | | | | | | | | | | | | | | does. Enhance the X86 asmparser to produce ranges in the one case that was annoying me, for example: test.s:10:15: error: invalid operand for instruction movl 0(%rax), 0(%edx) ^~~~~~~ It should be straight-forward to enhance filecheck, tblgen, and/or the .ll parser to use ranges where appropriate if someone is interested. llvm-svn: 142106
* Make it possible to use the linker without destroying the source module. ↵Tanya Lattner2011-10-111-1/+2
| | | | | | | | | | | | | | This is so the source module can be linked to multiple other destination modules. For all that used LinkModules() before, they will continue to destroy the source module as before. This line, and those below, will be ignored-- M include/llvm/Linker.h M tools/bugpoint/Miscompilation.cpp M tools/bugpoint/BugDriver.cpp M tools/llvm-link/llvm-link.cpp M lib/Linker/LinkModules.cpp llvm-svn: 141606
* Fix whitespace.Michael J. Spencer2011-03-311-10/+10
| | | | llvm-svn: 128631
* Switch FileRemover from PathV1 to V2.Michael J. Spencer2011-03-311-1/+1
| | | | llvm-svn: 128630
* Merge System into Support.Michael J. Spencer2010-11-291-1/+1
| | | | llvm-svn: 120298
* Most of bugpoint now only needs to know the pass names.Rafael Espindola2010-08-081-2/+2
| | | | llvm-svn: 110534
* Run opt instead of bugpoint itself.Rafael Espindola2010-08-071-16/+5
| | | | llvm-svn: 110524
* Revert bugpoint change due to buildbot breakage.Bob Wilson2010-08-051-5/+16
| | | | | | | | | | --- Reverse-merging r110333 into '.': U tools/bugpoint/BugDriver.h U tools/bugpoint/OptimizerDriver.cpp U tools/bugpoint/bugpoint.cpp U tools/bugpoint/BugDriver.cpp llvm-svn: 110341
* Run opt instead of bugpoint itself.Rafael Espindola2010-08-051-16/+5
| | | | | | Fixes PR753. llvm-svn: 110333
* Add a Module argument to the remaining runPasses methods and mark getContextRafael Espindola2010-08-051-1/+1
| | | | | | const. llvm-svn: 110300
* Add a Program argument to diffProgram to avoid a use of swapProgramIn.Rafael Espindola2010-07-301-1/+1
| | | | llvm-svn: 109859
* Speculatively revert r108813, in an attempt to get the self-host buildbots ↵Owen Anderson2010-07-201-2/+1
| | | | | | | | working again. I don't see why this patch would cause them to fail the way they are, but none of the other intervening patches seem likely either. llvm-svn: 108818
* Reapply r108794, a fix for the failing test from last time.Owen Anderson2010-07-201-1/+2
| | | | llvm-svn: 108813
* Revert r108794, "Separate PassInfo into two classes: a constructor-freeDaniel Dunbar2010-07-201-2/+1
| | | | | | | superclass (StaticPassInfo) and a constructor-ful subclass (PassInfo).", it is breaking teh everything. llvm-svn: 108805
* Separate PassInfo into two classes: a constructor-free superclass ↵Owen Anderson2010-07-201-1/+2
| | | | | | (StaticPassInfo) and a constructor-ful subclass (PassInfo). llvm-svn: 108794
* Remove use of exceptions from bugpoint. No deliberate functionality change!Nick Lewycky2010-04-121-43/+42
| | | | llvm-svn: 101013
* Trim #includes.Dan Gohman2010-03-241-1/+0
| | | | llvm-svn: 99416
OpenPOWER on IntegriCloud