summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
* [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
* [llvm-jitlink] Add optional slab allocator for testing locality optimizations.Lang Hames2019-09-062-2/+178
| | | | | | | | | | | | The llvm-jitlink utility now accepts a '-slab-allocate <size>' option. If given, llvm-jitlink will use a slab-based memory manager rather than the default InProcessMemoryManager. Using a slab allocator will allow reliable testing of future locality based optimizations (e.g. PLT and GOT elimination) in JITLink. The <size> argument is a number, optionally followed by a units specifier (Kb, Mb, or Gb). If the units are not given then the number is assumed to be in Kb. llvm-svn: 371244
* [llvm-readelf] - Print unknown st_other value if present in GNU output.George Rimar2019-09-061-15/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a fix for https://bugs.llvm.org/show_bug.cgi?id=40785. llvm-readelf does not print the st_value of the symbol when st_value has any non-visibility bits set. This patch: * Aligns "Ndx" row for the default and a new cases. (it was 1 space character off for the case when "PROTECTED" visibility was printed) * Prints "[<other>: 0x??]" for symbols which has an additional st_other bits set. In compare with GNU, this logic is a bit simpler and seems to be more consistent. For MIPS GNU can print named flags, though can't print a mix of them: 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 NOTYPE GLOBAL DEFAULT [OPTIONAL] UND a1 2: 00000000 0 NOTYPE GLOBAL DEFAULT [MIPS PLT] UND a2 3: 00000000 0 NOTYPE GLOBAL DEFAULT [MIPS PIC] UND a3 4: 00000000 0 NOTYPE GLOBAL DEFAULT [MICROMIPS] UND a4 5: 00000000 0 NOTYPE GLOBAL DEFAULT [MIPS16] UND a5 6: 00000000 0 NOTYPE GLOBAL DEFAULT [<other>: c] UND b1 7: 00000000 0 NOTYPE GLOBAL DEFAULT [<other>: 28] UND b2 On PPC64 it can print a localentry value that is encoded in the high bits of st_other 63: 0000000000000850 208 FUNC GLOBAL DEFAULT [<localentry>: 8] 12 We chose to print the raw st_other field, prefixed with '0x'. Differential revision: https://reviews.llvm.org/D67094 llvm-svn: 371201
* [yaml2obj] Rename SHOffset (e_shoff) field to SHOff. NFCFangrui Song2019-09-061-1/+1
| | | | | | | | | | | `struct Elf*_Shdr` has a field `sh_offset`, named `ShOffset` in llvm::ELFYAML::Section. Rename SHOffset (e_shoff) to SHOff to prevent confusion. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D67254 llvm-svn: 371185
* [llvm-readobj][yaml2obj] Support SHT_LLVM_SYMPART, SHT_LLVM_PART_EHDR and ↵Fangrui Song2019-09-061-0/+6
| | | | | | | | | | | | | | | | | | | | | SHT_LLVM_PART_PHDR See http://lists.llvm.org/pipermail/llvm-dev/2019-February/130583.html and D60242 for the lld partition feature. This patch: * Teaches yaml2obj to parse the 3 section types. * Teaches llvm-readobj/llvm-readelf to dump the 3 section types. There is no test for SHT_LLVM_DEPENDENT_LIBRARIES in llvm-readobj. Add it as well. Reviewed By: thakis Differential Revision: https://reviews.llvm.org/D67228 llvm-svn: 371157
* [llvm-readelf] - Allow dumping dynamic symbols when there is no program headers.George Rimar2019-09-051-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | D62179 introduced a regression. llvm-readelf lose the ability to dump the dynamic symbols when there is .dynamic section with a DT_SYMTAB, but there are no program headers: https://reviews.llvm.org/D62179#1652778 Below is a program flow before the D62179 change: 1) Find SHT_DYNSYM. 2) Find there is no PT_DYNAMIC => don't try to parse it. 3) Print dynamic symbols using information about them found on step (1). And after the change it became: 1) Find SHT_DYNSYM. 2) Find there is no PT_DYNAMIC => find SHT_DYNAMIC. 3) Parse dynamic table, but fail to handle the DT_SYMTAB because of the absence of the PT_LOAD. Report the "Virtual address is not in any segment" error. This patch fixes the issue. For doing this it checks that the value of DT_SYMTAB was mapped to a segment. If not - it ignores it. Differential revision: https://reviews.llvm.org/D67078 llvm-svn: 371071
* [llvm-rtdyld][llvm-jitlink] Rename struct member to remove ambiguity.Lang Hames2019-09-042-11/+8
| | | | | | | This ambiguity (struct member name matching struct name) was causing errors on a few of the MSVC bots. Hopefully this should fix it. llvm-svn: 370969
* [llvm-rtdyld] Add timers to match llvm-jitlink.Lang Hames2019-09-042-33/+71
| | | | | | | | When using llvm-rtdyld to execute code, -show-times will now show the time taken to load the object files, apply relocations, and execute the rtdyld-linked code. llvm-svn: 370968
* [JITLink] Fix the show-timers option on llvm-jitlink.Lang Hames2019-09-041-15/+16
| | | | | | | No longer constantly shows times (even when -show-times=false). When shown, times are now correctly grouped. llvm-svn: 370951
* Fix "enumeral and non-enumeral type in conditional expression" warnings. NFCI.Simon Pilgrim2019-09-042-2/+2
| | | | llvm-svn: 370892
* [llvm-dwarfdump] Fix spelling in the comments. NFCDjordje Todorovic2019-09-041-2/+2
| | | | llvm-svn: 370861
* [llvm-objcopy] Add objcopy::elf::Object::allocSections to simplify loops on ↵Fangrui Song2019-09-042-22/+21
| | | | | | | | | | SHF_ALLOC sections Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D67142 llvm-svn: 370860
* [llvm-objcopy] Rename variable names "Section" to "Sec". NFCFangrui Song2019-09-042-71/+65
| | | | | | | | | | | | | | "Section" can refer to the type llvm::objcopy::elf::Section or the variable name. Rename it to "Sec" for clarity. "Sec" is already used a lot, so this change improves consistency as well. Also change `auto` to `const SectionBase` for readability. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D67143 llvm-svn: 370852
* [llvm-objcopy] Fix some identifier names in comments. NFCFangrui Song2019-09-041-5/+5
| | | | llvm-svn: 370838
* [llvm-profdata] Add mode to recover from profile read failuresVedant Kumar2019-09-031-71/+65
| | | | | | | | | | Add a mode in which profile read errors are not immediately treated as fatal. In this mode, merging makes forward progress and reports failure only if no inputs can be read. Differential Revision: https://reviews.llvm.org/D66985 llvm-svn: 370827
* [llvm-objcopy] Simplify alignToAddr with llvm::alignToFangrui Song2019-08-311-15/+2
| | | | llvm-svn: 370577
* Fix some errors introduced by rL370563 which were not exposed on my local ↵Wei Mi2019-08-311-1/+1
| | | | | | | | | machine. 1. zlib::compress accept &size_t but the param is an uint64_t. 2. Some systems don't have zlib installed. Don't use compression by default. llvm-svn: 370564
* [SampleFDO] Add profile symbol list section to discriminate function beingWei Mi2019-08-311-20/+67
| | | | | | | | | | | | | | | | | | | cold versus function being newly added. This is the second half of https://reviews.llvm.org/D66374. Profile symbol list is the collection of function symbols showing up in the binary which generates the current profile. It is used to discriminate function being cold versus function being newly added. Profile symbol list is only added for profile with ExtBinary format. During profile use compilation, when profile-sample-accurate is enabled, a function without profile will be regarded as cold only when it is contained in that list. Differential Revision: https://reviews.llvm.org/D66766 llvm-svn: 370563
* llvm-dwarfdump: Cache CU low_pc when computing statistics.David Blaikie2019-08-311-6/+6
| | | | llvm-svn: 370559
* [IFS][NFC] llvm-ifs: Fixing build bot build break: revert r370517 and r370510.Puyan Lotfi2019-08-301-5/+13
| | | | llvm-svn: 370522
* [IFS][NFC] llvm-ifs: Fixing build bot error due to commit conflicts.Puyan Lotfi2019-08-301-8/+0
| | | | | | | | r370510 and r370504 Again only on gcc. llvm-svn: 370517
* [IFS][NFC] llvm-ifs: Fixing build errors for bots using GCC.Puyan Lotfi2019-08-301-5/+5
| | | | | | | | | | | | | gcc produces the error: error: specialization of ‘template<class T, class Enable> struct llvm::yaml::ScalarTraits’ in different namespace For all specializations outside of llvm::yaml. So I added llvm::yaml to these specializations to fix the errors on the bots building with gcc (/usr/bin/c++). llvm-svn: 370510
* Fix compilation warnings. NFC.Michael Liao2019-08-301-1/+10
| | | | llvm-svn: 370504
* [llvm-ifs][IFS] llvm Interface Stubs merging + object file generation tool.Puyan Lotfi2019-08-304-0/+552
| | | | | | | | | | | | | | | | | | | | | | This tool merges interface stub files to produce a merged interface stub file or a stub library. Currently it for stub library generation it can produce an ELF .so stub file, or a TBD file (experimental). It will be used by the clang -emit-interface-stubs compilation pipeline to merge and assemble the per-CU stub files into a stub library. The new IFS format is as follows: --- !experimental-ifs-v1 IfsVersion: 1.0 Triple: <llvm triple> ObjectFileFormat: <ELF | TBD> Symbols: _ZSymbolName: { Type: <type>, etc... } ... Differential Revision: https://reviews.llvm.org/D66405 llvm-svn: 370499
* [llvm-nm] Small fix to Exected<StringRef>Sid Manning2019-08-301-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D66976 llvm-svn: 370474
* [llvm-objcopy] Allow the visibility of symbols created by --binary andChris Jackson2019-08-308-23/+57
| | | | | | --add-symbol to be specified with --new-symbol-visibility llvm-svn: 370458
* [COFF] Add a ResourceSectionRef method for getting resource contentsMartin Storsjo2019-08-301-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows llvm-readobj to print the contents of each resource when printing resources from an object file or executable, like it already does for plain .res files. This requires providing the whole COFFObjectFile to ResourceSectionRef. This supports both object files and executables. For executables, the DataRVA field is used as is to look up the right section. For object files, ideally we would need to complete linking of them and fix up all relocations to know what the DataRVA field would end up being. In practice, the only thing that makes sense for an RVA field is an ADDR32NB relocation. Thus, find a relocation pointing at this field, verify that it has the expected type, locate the symbol it points at, look up the section the symbol points at, and read from the right offset in that section. This works both for GNU windres object files (which use one single .rsrc section, with all relocations against the base of the .rsrc section, with the original value of the DataRVA field being the offset of the data from the beginning of the .rsrc section) and cvtres object files (with two separate .rsrc$01 and .rsrc$02 sections, and one symbol per data entry, with the original pre-relocated DataRVA field being set to zero). Differential Revision: https://reviews.llvm.org/D66820 llvm-svn: 370433
* [WebAssembly] Make __attribute__((used)) not imply export.Dan Gohman2019-08-291-0/+1
| | | | | | | | | | Add an WASM_SYMBOL_NO_STRIP flag, so that __attribute__((used)) doesn't need to imply exporting. When targeting Emscripten, have WASM_SYMBOL_NO_STRIP imply exporting. Differential Revision: https://reviews.llvm.org/D62542 llvm-svn: 370415
* [llvm-readobj/llvm-readelf] - Report a proper warning when dumping a broken ↵George Rimar2019-08-291-10/+34
| | | | | | | | | | | | | dynamic relocation. When we have a dynamic relocation with a broken symbol's st_name, tools report a useless error: "Invalid data was encountered while parsing the file". After this change we report a warning + "<corrupt>" as a symbol name. Differential revision: https://reviews.llvm.org/D66734 llvm-svn: 370330
* [COFF] Add a ResourceSectionRef method for getting the data entry, print it ↵Martin Storsjo2019-08-291-0/+7
| | | | | | | | in llvm-readobj Differential Revision: https://reviews.llvm.org/D66819 llvm-svn: 370311
* [COFF] Add a bounds checking helper for iterating a coff_resource_dir_tableMartin Storsjo2019-08-291-16/+2
| | | | | | | | | | Instead of blindly incrementing pointers in llvm-readobj, use this helper, which does bounds checking against the available section data. Differential Revision: https://reviews.llvm.org/D66818 llvm-svn: 370310
* [llvm-readobj] Print the resource type textually for .res filesMartin Storsjo2019-08-291-2/+6
| | | | | | | | This already is done when dumping resources from coff objects. Differential Revision: https://reviews.llvm.org/D66816 llvm-svn: 370308
* [llvm-readobj] Remove a leftover string trim operation. NFC.Martin Storsjo2019-08-291-1/+0
| | | | | | | | This became unnecessary in SVN r359153. Differential Revision: https://reviews.llvm.org/D66815 llvm-svn: 370307
OpenPOWER on IntegriCloud