summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix -Wdocumentation "@returns in a void function" warning. NFCI.Simon Pilgrim2019-09-191-1/+0
| | | | llvm-svn: 372310
* [llvm-ar] Include a line number when failing to parse an MRI scriptOwen Reynolds2019-09-191-3/+16
| | | | | | | | | Errors that occur when reading an MRI script now include a corresponding line number. Differential Revision: https://reviews.llvm.org/D67449 llvm-svn: 372309
* llvm-reduce: Add pass to reduce instructionsDavid Blaikie2019-09-194-0/+89
| | | | | | | | Patch by Diego Treviño! Differential Revision: https://reviews.llvm.org/D66263 llvm-svn: 372282
* llvm-reduce: Avoid use-after-free when removing a branch instructionDavid Blaikie2019-09-191-2/+7
| | | | | | Found my msan buildbot & pointed out by Nico Weber - thanks Nico! llvm-svn: 372280
* [Object] Extend MachOUniversalBinary::getObjectForArchAlexander Shaposhnikov2019-09-192-5/+4
| | | | | | | | | | | | Make the method MachOUniversalBinary::getObjectForArch return MachOUniversalBinary::ObjectForArch and add helper methods MachOUniversalBinary::getMachOObjectForArch, MachOUniversalBinary::getArchiveForArch for those who explicitly expect to get a MachOObjectFile or an Archive. Differential revision: https://reviews.llvm.org/D67700 Test plan: make check-all llvm-svn: 372278
* llvm-reduce: Remove inaccurate doxy comment about a return that isn't returnedDavid Blaikie2019-09-181-1/+0
| | | | | | | Addressing post-commit code review feedback from Dávid Bolvanský - thanks! llvm-svn: 372271
* llvm-reduce: Fix inconsistencies between int/unsigned usage (standardize on int)David Blaikie2019-09-187-31/+32
| | | | llvm-svn: 372270
* llvm-reduce: Add pass to reduce basic blocksDavid Blaikie2019-09-184-0/+165
| | | | | | | | Patch by Diego Treviño! Differential Revision: https://reviews.llvm.org/D66320 llvm-svn: 372264
* Fix -Wdocumentation "@returns in a void function" warning. NFCI.Simon Pilgrim2019-09-181-1/+0
| | | | llvm-svn: 372212
* [llvm-readobj/llvm-objdump] - Improve how tool locate the dynamic table and ↵George Rimar2019-09-171-34/+96
| | | | | | | | | | | | | | | | | | | | | report warnings about that. Before this patch we gave a priority to a dynamic table found from the section header. It was discussed (here: https://reviews.llvm.org/D67078?id=218356#inline-602082) that probably preferring the table from PT_DYNAMIC is better, because it is what runtime loader sees. This patch makes the table from PT_DYNAMIC be chosen at first place if it is available. But also it adds logic to fall back to SHT_DYNAMIC if the table from the dynamic segment is broken or fall back to use no table if both are broken. It adds a few more diagnostic warnings for the logic above. Differential revision: https://reviews.llvm.org/D67547 llvm-svn: 372122
* [llvm-ar] Parse 'h' and '-h': display help and exitFangrui Song2019-09-171-5/+5
| | | | | | | | | | | Support `llvm-ar h` and `llvm-ar -h` because they may be what users try at first. Note, operation 'h' is undocumented in GNU ar. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D67560 llvm-svn: 372088
* [llvm-readobj] - Refactor the code.George Rimar2019-09-171-39/+22
| | | | | | | | It's a straightforward refactoring that allows to simplify and encapsulate the code. Differential revision: https://reviews.llvm.org/D67624 llvm-svn: 372083
* [bugpoint] Add support for -Oz and properly enable -Os.Florian Hahn2019-09-171-12/+34
| | | | | | | | | | | | | | | | | This patch adds -Oz as option and also properly enables support for -Os. Currently, the existing check for -Os is dead, because the enclosing if only checks of O1, O2 and O3. There is still a difference between the -Oz pipeline compared to opt, but I have not been able to track that down yet. Reviewers: bogner, sebpop, efriedma Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D67593 llvm-svn: 372079
* llvm-reduce: Remove some string copiesDavid Blaikie2019-09-162-25/+5
| | | | llvm-svn: 372053
* llvm-reduce: Make tests shell-independent by passing the interpreter on the ↵David Blaikie2019-09-161-7/+7
| | | | | | command line rather than using #! in the test file llvm-svn: 372049
* [LTO][Legacy] Add new C inferface to query libcall functionsSteven Wu2019-09-162-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is needed to implemented the same approach as lld (implemented in r338434) for how to handling symbols that can be generated by LTO code generator but not present in the symbol table for linker that uses legacy C APIs. libLTO is in charge of providing the list of symbols. Linker is in charge of implementing the eager loading from static libraries using the list of symbols. rdar://problem/52853974 Reviewers: tejohnson, bd1976llvm, deadalnix, espindola Reviewed By: tejohnson Subscribers: emaste, arichardson, hiraditya, MaskRay, dang, kledzik, mehdi_amini, inglorion, jkorous, dexonsmith, ributzka, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67568 llvm-svn: 372021
* Added return statement to fix compile and build warning:Sjoerd Meijer2019-09-161-0/+1
| | | | | | llvm-rtdyld.cpp:966:7: warning: variable ‘Result’ set but not used llvm-svn: 371972
* [llvm-objcopy] Ignore -B --binary-architecture=Fangrui Song2019-09-146-51/+12
| | | | | | | | | | | | | | | | | | | | | | | GNU objcopy documents that -B is only useful with architecture-less input (i.e. "binary" or "ihex"). After D67144, -O defaults to -I, and -B is essentially a NOP. * If -O is binary/ihex, GNU objcopy ignores -B. * If -O is elf*, -B provides the e_machine field in GNU objcopy. So to convert a blob to an ELF, `-I binary -B i386:x86-64 -O elf64-x86-64` has to be specified. `-I binary -B i386:x86-64 -O elf64-x86-64` creates an ELF with its e_machine field set to EM_NONE in GNU objcopy, but a regular x86_64 ELF in elftoolchain elfcopy. Follow the elftoolchain approach (ignoring -B) to simplify code. Users that expect their command line portable should specify -B. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D67215 llvm-svn: 371914
* [llvm-objcopy] Default --output-target to --input-target when unspecifiedFangrui Song2019-09-141-14/+17
| | | | | | | | | | | | | | | | | | | | | Fixes PR42171. In GNU objcopy, if -O (--output-target) is not specified, the value is copied from -I (--input-target). ``` objcopy -I binary -B i386:x86-64 a.txt b # b is copied from a.txt llvm-objcopy -I binary -B i386:x86-64 a.txt b # b is an x86-64 object file ``` This patch changes our behavior to match GNU. With this change, we can delete code related to -B handling (D67215). Reviewed By: jakehehrlich Differential Revision: https://reviews.llvm.org/D67144 llvm-svn: 371913
* [llvm-ar] Uncapitalize error messages and delete full stopFangrui Song2019-09-141-30/+29
| | | | | | | | | | | | Most GNU binutils don't append full stops in error messages. This convention has been adopted by a bunch of LLVM binary utilities. Make llvm-ar follow the convention as well. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D67558 llvm-svn: 371912
* [llvm-objcopy] Add support for response files in llvm-strip and llvm-objcopyMichael Pozulp2019-09-142-6/+34
| | | | | | | | | | | | | | | | Summary: Addresses https://bugs.llvm.org/show_bug.cgi?id=42671 Reviewers: jhenderson, espindola, alexshap, rupprecht Reviewed By: jhenderson Subscribers: seiya, emaste, arichardson, jakehehrlich, MaskRay, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65372 llvm-svn: 371911
* Bugpoint: Remove some unnecessary c_str conversions on the journey to StringRefDavid Blaikie2019-09-141-8/+8
| | | | llvm-svn: 371910
* [llvm-opt-report] Improve error handlingFrancis Visoiu Mistrih2019-09-131-3/+5
| | | | | | | | * std::move the error extracted from the parsing creation to avoid asserts * print a newline after the error message * create the parser from the metadata llvm-svn: 371895
* [yaml2obj/ObjectYAML] - Cleanup the error reporting API, add custom errors ↵George Rimar2019-09-132-16/+13
| | | | | | | | | | | | | | | | | | | | | handlers. This is a continuation of the YAML library error reporting refactoring/improvement and the idea by itself was mentioned in the following thread: https://reviews.llvm.org/D67182?id=218714#inline-603404 This performs a cleanup of all object emitters in the library. It allows using the custom one provided by the caller. One of the nice things is that each tool can now print its tool name, e.g: "yaml2obj: error: <text>" Also, the code became a bit simpler. Differential revision: https://reviews.llvm.org/D67445 llvm-svn: 371865
* [llvm-size] Fix spelling errors (Berkely -> Berkeley)James Henderson2019-09-131-3/+3
| | | | llvm-svn: 371845
* [Alignment] Introduce llvm::Align to MCSectionGuillaume Chatelet2019-09-131-1/+1
| | | | | | | | | | | | | | | | | Summary: This is patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Reviewers: courbet, JDevlieghere Subscribers: arsenm, sdardis, jvesely, nhaehnle, sbc100, hiraditya, aheejin, jrtc27, atanasyan, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67486 llvm-svn: 371831
* [llvm-objdump] Fix llvm-objdump --all-headers output orderGeorge Rimar2019-09-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Patch by Justice Adams! Made llvm-objdump --all-headers output match the order of GNU objdump for compatibility reasons. Old order of the headers output: * file header * section header table * symbol table * program header table * dynamic section New order of the headers output (GNU compatible): * file header information * program header table * dynamic section * section header table * symbol table (Relevant BugZilla Bug: https://bugs.llvm.org/show_bug.cgi?id=41830) Differential revision: https://reviews.llvm.org/D67357 llvm-svn: 371826
* llvm-reduce: Remove unused plugin support/requirementsDavid Blaikie2019-09-121-4/+0
| | | | llvm-svn: 371755
* [Alignment] Move OffsetToAlignment to Alignment.hGuillaume Chatelet2019-09-123-3/+5
| | | | | | | | | | | | | | | | | Summary: This is patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Reviewers: courbet, JDevlieghere, alexshap, rupprecht, jhenderson Subscribers: sdardis, nemanjai, hiraditya, kbarton, jakehehrlich, jrtc27, MaskRay, atanasyan, jsji, seiya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D67499 llvm-svn: 371742
* Reapply llvm-reduce: Add pass to reduce parameters""David Blaikie2019-09-124-0/+150
| | | | | | | | | | Fixing a couple of asan-identified bugs * use of an invalid "Use" iterator after the element was removed * use of StringRef to Function name after the Function was erased This reapplies r371567, which was reverted in r371580. llvm-svn: 371700
* PR43278: llvm-reduce: Use temporary file names (and ToolOutputFile) rather ↵David Blaikie2019-09-124-51/+34
| | | | | | | | | | | | | | | than unique ones - to ensure they're cleaned up This modifies the tool somewhat to only create files when about to run the "interestingness" test, and delete them immediately after - this means some more files will be created sometimes (when "double checking" work - which should probably be fixed/avoided anyway). This now creates temporary files, rather than only unique ones, and also uses ToolOutputFile (without ever calling "keep") to ensure the files are deleted as soon as the interestingness test is run. llvm-svn: 371696
* Revert [llvm-nm] Add tapi file supportCyndy Ishida2019-09-111-30/+0
| | | | | | This reverts r371576 (git commit f88f46358dbffa20af3b054a9346e5154789d50f) llvm-svn: 371676
* [llvm-reduce] Fix a bug, improve error handling when running testReid Kleckner2019-09-112-4/+9
| | | | | | | | | | llvm::sys::ExecuteAndWait can report errors, so let's make use of that. Second, while iterating uses of functions to remove, a call can appear multiple times. Use a SetVector so we don't attempt to erase such a call twice. llvm-svn: 371653
* Fix -Wdocumentation warning - void function doesn't need a @returns. NFCI.Simon Pilgrim2019-09-111-1/+0
| | | | llvm-svn: 371606
* [llvm-objcopy] Simplify --prefix-alloc-sectionsFangrui Song2019-09-111-53/+43
| | | | | | | | | | | Handle --prefix-alloc-sections after --rename-sections so that --prefix-alloc-sections code does not have to check if renaming has been performed. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D66931 llvm-svn: 371591
* [llvm-nm] Fix -DBUILD_SHARED_LIBS=ON builds after D66160/r371576Fangrui Song2019-09-111-0/+1
| | | | llvm-svn: 371585
* Revert "llvm-reduce: Add pass to reduce parameters"David Blaikie2019-09-114-149/+0
| | | | | | | | Looks to be failing on asan buildbots This reverts commit r371567. llvm-svn: 371580
* [llvm-nm] Add tapi file supportCyndy Ishida2019-09-111-0/+30
| | | | | | | | | | | | | | | | | | Summary: This commit is the final one for adding tapi support to the llvm-nm implementation. This commit also has accompanying tests the additions to lib/Object Reviewers: ributzka, steven_wu Reviewed By: ributzka Subscribers: hiraditya, plotfi, dexonsmith, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66160 llvm-svn: 371576
* llvm-reduce: Add pass to reduce parametersDavid Blaikie2019-09-104-0/+149
| | | | | | | | Patch by Diego Treviño! Differential Revision: https://reviews.llvm.org/D65479 llvm-svn: 371567
* llvm-reduce: Remove some unused headers/more narrowly include themDavid Blaikie2019-09-104-9/+9
| | | | llvm-svn: 371564
* llvm-remove: Remove "using namespace" in header.David Blaikie2019-09-104-5/+10
| | | | llvm-svn: 371563
* llvm-reduce: Add pass to reduce MetadataDavid Blaikie2019-09-104-2/+160
| | | | | | | | Patch by Diego Treviño! Differential Revision: https://reviews.llvm.org/D65026 llvm-svn: 371562
* llvm-reduce: Simplify testing using -implicit-check-notDavid Blaikie2019-09-101-2/+0
| | | | | | | Also fix llvm-reduce to use the specified output file name directly, without appending '.ll' to the name. llvm-svn: 371555
* Revert "Reland "r364412 [ExpandMemCmp][MergeICmps] Move passes out of ↵Dmitri Gribenko2019-09-101-0/+1
| | | | | | | | | CodeGen into opt pipeline."" This reverts commit r371502, it broke tests (clang/test/CodeGenCXX/auto-var-init.cpp). llvm-svn: 371507
* [llvm-dwarfdump] Add additional stats fieldsDjordje Todorovic2019-09-101-13/+205
| | | | | | | | | | The additional fields will be parsed by the llvm-locstats tool in order to produce more human readable output of the DWARF debug location quality generated. Differential Revision: https://reviews.llvm.org/D66525 llvm-svn: 371506
* Reland "r364412 [ExpandMemCmp][MergeICmps] Move passes out of CodeGen into ↵Clement Courbet2019-09-101-1/+0
| | | | | | | | opt pipeline." With a fix for sanitizer breakage (see explanation in D60318). llvm-svn: 371502
* [Remarks] Add parser for bitstream remarksFrancis Visoiu Mistrih2019-09-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The bitstream remark serializer landed in r367372. This adds a bitstream remark parser that parser bitstream remark files to llvm::remarks::Remark objects through the RemarkParser interface. A few interesting things to point out: * There are parsing helpers to parse the different types of blocks * The main parsing helper allows us to parse remark metadata and open an external file containing the encoded remarks * This adds a dependency from the Remarks library to the BitstreamReader library * The testing strategy is to create a remark entry through YAML, parse it, serialize it to bitstream, parse that back and compare the objects. * There are close to no tests for malformed bitstream remarks, due to the lack of textual format for the bitstream format. * This adds a new C API for parsing bitstream remarks: LLVMRemarkParserCreateBitstream. * This bumps the REMARKS_API_VERSION to 1. Differential Revision: https://reviews.llvm.org/D67134 llvm-svn: 371429
* [llvm-nm] - Fix a bug and unbreak ASan BB.George Rimar2019-09-071-1/+4
| | | | | | | | | | BB: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/13820/steps/check-llvm%20asan/logs/stdio rL371074 revealed a bug in llvm-nm. This patch fixes it. llvm-svn: 371318
* [llvm-objcopy] Rename SHOffset (e_shoff) field to SHOff. NFCFangrui Song2019-09-072-7/+7
| | | | | | | | | Similar to D67254. `struct Elf*_Shdr` has a field `sh_offset`. Rename SHOffset to SHOff to avoid confusion. llvm-svn: 371281
* [llvm-ifs] Improving detection of PlatformKind from triple for TBD generation.Puyan Lotfi2019-09-061-7/+31
| | | | | | | | It was pointed out that I had hard-coded PlatformKind. This is rectifying that. Differential Revision: https://reviews.llvm.org/D67255 llvm-svn: 371248
OpenPOWER on IntegriCloud