summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/ToolRunner.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Bugpoint: Remove some unnecessary c_str conversions on the journey to StringRefDavid Blaikie2019-09-141-8/+8
| | | | llvm-svn: 371910
* 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
* [bugpoint] Find 'opt', etc., in bugpoint directoryBrian Gesiak2018-12-101-53/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When bugpoint attempts to find the other executables it needs to run, such as `opt` or `clang`, it tries searching the user's PATH. However, in many cases, the 'bugpoint' executable is part of an LLVM build, and the 'opt' executable it's looking for is in that same directory. Many LLVM tools handle this case by using the `Paths` parameter of `llvm::sys::findProgramByName`, passing the parent path of the currently running executable. Do this same thing for bugpoint. However, to preserve the current behavior exactly, first search the user's PATH, and then search for 'opt' in the directory containing 'bugpoint'. Test Plan: `check-llvm`. Many of the existing bugpoint tests no longer need to use the `--opt-command` option as a result of these changes. Reviewers: MatzeB, silvas, davide Reviewed By: MatzeB, davide Subscribers: davide, llvm-commits Differential Revision: https://reviews.llvm.org/D54884 llvm-svn: 348734
* Refactor ExecuteAndWait to take StringRefs.Zachary Turner2018-06-121-93/+81
| | | | | | | | | | | | | | | | | | | This simplifies some code which had StringRefs to begin with, and makes other code more complicated which had const char* to begin with. In the end, I think this makes for a more idiomatic and platform agnostic API. Not all platforms launch process with null terminated c-string arrays for the environment pointer and argv, but the api was designed that way because it allowed easy pass-through for posix-based platforms. There's a little additional overhead now since on posix based platforms we'll be takign StringRefs which were constructed from null terminated strings and then copying them to null terminate them again, but from a readability and usability standpoint of the API user, I think this API signature is strictly better. llvm-svn: 334518
* Rename DEBUG macro to LLVM_DEBUG.Nicola Zaghen2018-05-141-26/+27
| | | | | | | | | | | | | | | | The DEBUG() macro is very generic so it might clash with other projects. The renaming was done as follows: - git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g' - git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM - Manual change to APInt - Manually chage DOCS as regex doesn't match it. In the transition period the DEBUG() macro is still present and aliased to the LLVM_DEBUG() one. Differential Revision: https://reviews.llvm.org/D43624 llvm-svn: 332240
* Remove @brief commands from doxygen comments, too.Adrian Prantl2018-05-011-1/+1
| | | | | | | | | | | | | | | | | This is a follow-up to r331272. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done https://reviews.llvm.org/D46290 llvm-svn: 331275
* s/LLVM_ON_WIN32/_WIN32/, llvmNico Weber2018-04-291-1/+1
| | | | | | | | | | | | | | LLVM_ON_WIN32 is set exactly with MSVC and MinGW (but not Cygwin) in HandleLLVMOptions.cmake, which is where _WIN32 defined too. Just use the default macro instead of a reinvented one. See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev. No intended behavior change. This moves over all uses of the macro, but doesn't remove the definition of it in (llvm-)config.h yet. llvm-svn: 331127
* Convenience/safety fix for llvm::sys::Execute(And|No)WaitAlexander Kornienko2017-09-131-2/+2
| | | | | | | | | | | | | | | | | | | | Summary: Change the type of the Redirects parameter of llvm::sys::ExecuteAndWait, ExecuteNoWait and other APIs that wrap them from `const StringRef **` to `ArrayRef<Optional<StringRef>>`, which is safer and simplifies the use of these APIs (no more local StringRef variables just to get a pointer to). Corresponding clang changes will be posted as a separate patch. Reviewers: bkramer Reviewed By: bkramer Subscribers: vsk, llvm-commits Differential Revision: https://reviews.llvm.org/D37563 llvm-svn: 313155
* [NFC] Remove multiple semicolonsMandeep Singh Grang2017-06-281-1/+1
| | | | | | | | | | | | Reviewers: bogner, whitequark, mgrang Reviewed By: mgrang Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34785 llvm-svn: 306613
* Allow use of spaces in Bugpoint ‘--compile-command’ argumentDavid Bozier2017-03-021-21/+46
| | | | | | | | | | | | | | | | | Bug-Point functionality needs extending due to the patch D29185 by bd1976llvm (Allow llvm's build and test systems to support paths with spaces ). It requires Bugpoint to accept the use of spaces within ‘--compile-command’ tokens. Details Bugpoint uses the argument ‘--compile-command’ to pass in a command line argument as a string, the string is tokenized by the ‘lexCommand’ function using spaces as a delimiter. Patch D29185 will cause the unit test compile-custom.ll to fail as spaces are now required within tokens and as a delimiter. This patch allows the use of escape characters as below: Two consecutive '\' evaluate to a single '\'. A space after a '\' evaluates to a space that is not interpreted as a delimiter. Any other instances of the '\' character are removed. Committed on behalf of Owen Reynolds Differential revision: https://reviews.llvm.org/D29940 llvm-svn: 296763
* Retire bugpoint's -R. hack.Joerg Sonnenberger2016-10-011-3/+0
| | | | | | | | | It got disconnected during the cmake conversion. For Miscompilation.cpp, it was purely advisory for the user and the ToolRunner.cpp version was trying to compensate for libs and bins in the same directory, which hasn't been the case for a very long time. llvm-svn: 283022
* HAVE_LINK_R is not the only reason why this needs config.h.Joerg Sonnenberger2016-09-301-1/+1
| | | | llvm-svn: 282923
* bugpoint: Return Errors instead of passing around stringsJustin Bogner2016-09-061-88/+85
| | | | | | | | | | | | | 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
* bugpoint: clang-format all of bugpoint. NFCJustin Bogner2016-09-021-272/+231
| | | | | | | I'm going to clean up the APIs here a bit and touch many many lines anyway. llvm-svn: 280450
* Apply clang-tidy's misc-move-constructor-init throughout LLVM.Benjamin Kramer2016-05-271-6/+7
| | | | | | No functionality change intended, maybe a tiny performance improvement. llvm-svn: 270997
* [Bugpoint] Use 'CC' instead of 'GCC' for variable naming.Davide Italiano2015-10-141-99/+99
| | | | | | | | | | 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
* [Bugpoint] Get rid of dead code. No functional change.Davide Italiano2015-10-111-19/+0
| | | | llvm-svn: 249999
* Use findProgramByName.Michael J. Spencer2014-11-041-10/+19
| | | | llvm-svn: 221221
* [Bugpoint] Close error log in ProcessFailure. Bugpoint had been failing to closeLang Hames2014-10-071-9/+1
| | | | | | | | | | this, and in some circumstances (e.g. reducing particularly large test-cases) this was causing bugpoint to be killed for hitting open file-handle limits. No test case: I was only able to trigger this with test cases taking upwards of 10 mins to run. llvm-svn: 219244
* bugpoint/ToolRunner.cpp: ProcessFailure(): Close ErrorFD immediately, or it ↵NAKAMURA Takumi2014-07-131-0/+8
| | | | | | | couldn't be reopened on Win32. FIXME: We may have an option in openFileForWrite(), not to use ResultFD but to close it. llvm-svn: 212902
* Remove 'using std::error_code' from tools.Rafael Espindola2014-06-131-5/+4
| | | | llvm-svn: 210876
* Don't use 'using std::error_code' in include/llvm.Rafael Espindola2014-06-121-0/+1
| | | | | | This should make sure that most new uses use the std prefix. llvm-svn: 210835
* [C++] Use 'nullptr'. Tools edition.Craig Topper2014-04-251-17/+17
| | | | llvm-svn: 207176
* [Modules] Fix potential ODR violations by sinking the DEBUG_TYPEChandler Carruth2014-04-221-1/+2
| | | | | | definition below all of the header #include lines, tools edition. llvm-svn: 206848
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-081-47/+47
| | | | | | class. llvm-svn: 203345
* [bugpoint] Don't ignore arg in -compile-commad="tool arg"Adam Nemet2014-03-081-1/+1
| | | | | | | Args is an output parameter of the function lexCommand but the reference operator was missed. llvm-svn: 203343
* Use startswith_lower() where possible.Jakub Staszak2013-11-041-1/+1
| | | | llvm-svn: 194007
* Add a createUniqueFile function and switch llvm's users of unique_file.Rafael Espindola2013-07-051-4/+4
| | | | | | | | | | | | | | This function is complementary to createTemporaryFile. It handles the case were the unique file is *not* temporary: we will rename it in the end. Since we will rename it, the file has to be in the same filesystem as the final destination and we don't prepend the system temporary directory. This has a small semantic difference from unique_file: the default mode is 0666. This matches the behavior of most unix tools. For example, with this change lld now produces files with the same permissions as ld. I will add a test of this change when I port clang over to createUniqueFile (next commit). llvm-svn: 185726
* Use sys::fs::createTemporaryFile.Rafael Espindola2013-07-051-2/+2
| | | | llvm-svn: 185719
* Remove unused includes.Rafael Espindola2013-06-261-1/+0
| | | | | | llvm itself is now PathV1 clean. llvm-svn: 184947
* Port GetMainExecutable over to PathV2.Rafael Espindola2013-06-261-2/+2
| | | | | | I will remove the V1 version as soon as I change clang in the next commit. llvm-svn: 184914
* Move GetEXESuffix to the one place it is used.Rafael Espindola2013-06-251-1/+7
| | | | llvm-svn: 184853
* Convert most uses of PathV1.h in ToolRunner.cpp.Rafael Espindola2013-06-181-25/+35
| | | | llvm-svn: 184210
* Return a std::string from PrependMainExecutablePath.Rafael Espindola2013-06-181-6/+7
| | | | llvm-svn: 184204
* Don't use PathV1.h in ToolRunner.h.Rafael Espindola2013-06-171-7/+8
| | | | llvm-svn: 184107
* Move PrependMainExecutablePath next to its only user.Rafael Espindola2013-06-141-0/+22
| | | | llvm-svn: 183980
* Avoid using PathV1.h in Program.h.Rafael Espindola2013-06-131-13/+5
| | | | llvm-svn: 183940
* Have sys::FindProgramByName return a std::string.Rafael Espindola2013-06-131-6/+6
| | | | llvm-svn: 183928
* Further reduce usage of sys::Path in bugpoint.Rafael Espindola2013-06-131-8/+8
| | | | llvm-svn: 183912
* Try to fix the build with libstdc++ 4.4.Rafael Espindola2013-06-131-1/+2
| | | | llvm-svn: 183909
* Reduce sys::Path usage in bugpoint.Rafael Espindola2013-06-131-47/+47
| | | | llvm-svn: 183908
* Remove the program class.Rafael Espindola2013-06-121-8/+7
| | | | | | | It was only used to implement ExecuteAndWait and ExecuteNoWait. Expose just those two functions and make Execute and Wait implementations details. llvm-svn: 183864
* [bugpoint] set Message after tool configurationSaleem Abdulrasool2013-01-241-1/+1
| | | | | | | | | | Set the message returned after the GCC runner has been constructed as otherwise the message will be overwritten by the construction of the runner, resulting in misleading messages. Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org> Reviewed-by: Chandler Carruth <chandlerc@gmail.com> llvm-svn: 173359
* 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 unintentional use of operator bool.John McCall2012-05-021-1/+1
| | | | llvm-svn: 155978
* Remove the C backend.Eric Christopher2012-03-231-88/+0
| | | | llvm-svn: 153307
* Unweaken vtables as per ↵David Blaikie2011-12-201-0/+2
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146960
* Remove the Alpha backend.Dan Gohman2011-10-271-2/+1
| | | | llvm-svn: 143164
* Have Program::Wait return -2 for crashed and timeouts instead of embeddingAndrew Trick2011-05-211-9/+4
| | | | | | info in the error message. Per Dan's request. llvm-svn: 131780
* Typo and missing checkin from r131186.Andrew Trick2011-05-111-1/+1
| | | | llvm-svn: 131187
OpenPOWER on IntegriCloud