summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm-readobj] Should declare `ListScope` for `verneed` entries.Xing GUO2019-04-101-0/+1
| | | | | | | | | | | | | | | | Summary: YAML mappings require keys to be unique. See: https://yaml.org/spec/1.2/spec.html#id2764652 Reviewers: jhenderson, grimar, rupprecht, espindola, ruiu Reviewed By: ruiu Subscribers: ruiu, emaste, arichardson, MaskRay, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60438 llvm-svn: 358078
* [llvm-exegesis] YamlContext: fix some missing spaces/quotes/newlines in ↵Roman Lebedev2019-04-101-6/+6
| | | | | | error strings llvm-svn: 358077
* [llvm-exegesis] Fix error propagation from yaml writing (from serialization)Roman Lebedev2019-04-102-8/+17
| | | | | | Investigating https://bugs.llvm.org/show_bug.cgi?id=41448 llvm-svn: 358076
* [llvm-objdump] Don't print trailing space in dumpBytesFangrui Song2019-04-101-3/+3
| | | | | | | In disassembly output, dumpBytes prints a space, followed by a tab printed by printInstr. Remove the extra space. llvm-svn: 358045
* [llvm-objdump] Accept and ignore --wide/-wFangrui Song2019-04-101-0/+4
| | | | | | | | | This is similar to what we do for llvm-readobj (--wide/-W is for GNU readelf compatibility). The test will be added in D60376. llvm-svn: 358043
* [LLVM-C] Add Section and Symbol Iterator Accessors for Object File BinariesRobert Widmann2019-04-091-21/+31
| | | | | | | | | | | | | | | | Summary: This brings us to full feature parity with the old API, so I've deprecated it and updated the tests. I'll do a follow-up patch to do some more cleanup and documentation work in this header. Reviewers: whitequark, deadalnix Reviewed By: whitequark Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60407 llvm-svn: 358037
* Remove the unit at a time optionEric Christopher2019-04-091-6/+0
| | | | | | | | Removes the code from opt and the pass manager builder. The code was unused - even by the C library code that was supposed to set it and had been removed previously. llvm-svn: 358024
* [llvm-rtdyld] Fix missing include on MSVC builds.Simon Pilgrim2019-04-091-0/+1
| | | | llvm-svn: 357990
* [llvm-objdump] Migrate some functions from std::error_code to ErrorFangrui Song2019-04-094-38/+28
| | | | llvm-svn: 357965
* [RuntimeDyld] Decouple RuntimeDyldChecker from RuntimeDyld.Lang Hames2019-04-081-48/+212
| | | | | | | This will allow RuntimeDyldChecker (and rtdyld-check tests) to test a new JIT linker: JITLink (https://reviews.llvm.org/D58704). llvm-svn: 357947
* [BinaryFormat] Update Mach-O ARM64E CPU subtype and dumpingShoaib Meenai2019-04-082-0/+8
| | | | | | | | | The new value is taken from <mach/machine.h> in the MacOSX10.14 SDK from Xcode 10.1. Update llvm-objdump and llvm-readobj accordingly. Differential Revision: https://reviews.llvm.org/D58636 llvm-svn: 357945
* Revert [ThinLTO] Fix ThinLTOCodegenerator to export llvm.used symbolsSteven Wu2019-04-081-52/+24
| | | | | | This reverts r357931 (git commit 8b70a5c11e08116955a875b9085433f14737bcaf) llvm-svn: 357932
* [ThinLTO] Fix ThinLTOCodegenerator to export llvm.used symbolsSteven Wu2019-04-081-24/+52
| | | | | | | | | | | | | | | | | | | | | | | Summary: ThinLTOCodeGenerator currently does not preserve llvm.used symbols and it can internalize them. In order to pass the necessary information to the legacy ThinLTOCodeGenerator, the input to the code generator is rewritten to be based on lto::InputFile. This fixes: PR41236 rdar://problem/49293439 Reviewers: tejohnson, pcc, dexonsmith Reviewed By: tejohnson Subscribers: mehdi_amini, inglorion, eraman, hiraditya, jkorous, dang, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60226 llvm-svn: 357931
* [llvm-objdump] Migrate relocation handling functions from error_code to ErrorFangrui Song2019-04-086-50/+49
| | | | llvm-svn: 357920
* [llvm-mca][scheduler-stats] Print issued micro opcodes per cycle. NFCIAndrea Di Biagio2019-04-082-18/+16
| | | | | | | | | It makes more sense to print out the number of micro opcodes that are issued every cycle rather than the number of instructions issued per cycle. This behavior is also consistent with the dispatch-stats: numbers from the two views can now be easily compared. llvm-svn: 357919
* [llvm-readobj] Use `reinterpret_cast` instead of C-style casting. NFC.Xing GUO2019-04-081-18/+25
| | | | llvm-svn: 357903
* [llvm-exegesis] benchmarkMain(): less cryptic error if built w/o libpfmRoman Lebedev2019-04-081-0/+5
| | | | | | | | | | | Wanted to check if inablility to measure latency of CMOV32rm is a regression from D60041 / D60138, but unable to do that because the llvm-exegesis-{8,9} from debian sid fails with that cryptic, unhelpful error. I suspect this will be a better error. llvm-svn: 357900
* [llvm-exegesis][X86] Randomize CMOVcc/SETcc OPERAND_COND_CODE CondCodesRoman Lebedev2019-04-083-7/+12
| | | | | | | | | | | | | | Reviewers: courbet, gchatelet Reviewed By: gchatelet Subscribers: tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60066 llvm-svn: 357898
* [llvm-objdump] Fix MC/ARM/arm-macho-calls.sFangrui Song2019-04-081-2/+1
| | | | llvm-svn: 357880
* [llvm-objdump] Split disassembleObject and simplify --{start,stop}-address ↵Fangrui Song2019-04-071-109/+116
| | | | | | | | | | | | | handling The main disassembly loop is hard to read due to special handling of ARM ELF data & ELF data. Split off the logic into two functions dumpARMELFData and dumpELFData. Hoist some checks outside of the loop. --start-address --stop-address have redundant checks and minor off-by-1 issues. Fix them. llvm-svn: 357869
* [llvm-objdump] Fix split of source lines; don't ltrim source linesFangrui Song2019-04-071-20/+16
| | | | | | | | | If the file does not end with a newline, it may be dropped. Fix the splitting algorithm. Also delete an unnecessary SourceCache lookup. llvm-svn: 357858
* [llvm-objdump] Simplify some ELF typename: ELFFile<ELFT>::Elf_xxx -> ELFT::xxxFangrui Song2019-04-071-11/+4
| | | | llvm-svn: 357857
* .Fangrui Song2019-04-071-17/+8
| | | | llvm-svn: 357856
* [llvm-objdump] Simplify Expected<T> handling with unwrapOrErrorFangrui Song2019-04-074-327/+170
| | | | llvm-svn: 357855
* [llvm-objdump] Simplify disassembleObjectFangrui Song2019-04-071-79/+48
| | | | | | | | * Use std::binary_search to replace some std::lower_bound * Use llvm::upper_bound to replace some std::upper_bound * Use format_hex and support::endian::read{16,32} llvm-svn: 357853
* Change some StringRef::data() reinterpret_cast to bytes_begin() or ↵Fangrui Song2019-04-075-17/+11
| | | | | | arrayRefFromStringRef() llvm-svn: 357852
* [llvm-exegesis][X86] Handle CMOVcc/SETcc OPERAND_COND_CODE OperandTypeRoman Lebedev2019-04-065-27/+60
| | | | | | | | | | | | | | | | | | | | | | Summary: D60041 / D60138 refactoring changed how CMOV/SETcc opcodes are handled. concode is now an immediate, with it's own operand type. This at least allows to not crash on the opcode. However, this still won't generate all the snippets with all the condcode enumerators. D60066 does that. Reviewers: courbet, gchatelet Reviewed By: gchatelet Subscribers: tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60057 llvm-svn: 357841
* [X86] Merge the different Jcc instructions for each condition code into ↵Craig Topper2019-04-051-0/+1
| | | | | | | | | | | | | | | | | | | | | single instructions that store the condition code as an operand. Summary: This avoids needing an isel pattern for each condition code. And it removes translation switches for converting between Jcc instructions and condition codes. Now the printer, encoder and disassembler take care of converting the immediate. We use InstAliases to handle the assembly matching. But we print using the asm string in the instruction definition. The instruction itself is marked IsCodeGenOnly=1 to hide it from the assembly parser. Reviewers: spatel, lebedev.ri, courbet, gchatelet, RKSimon Reviewed By: RKSimon Subscribers: MatzeB, qcolombet, eraman, hiraditya, arphaman, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60228 llvm-svn: 357802
* [X86] Merge the different SETcc instructions for each condition code into ↵Craig Topper2019-04-051-0/+2
| | | | | | | | | | | | | | | | | | | | | single instructions that store the condition code as an operand. Summary: This avoids needing an isel pattern for each condition code. And it removes translation switches for converting between SETcc instructions and condition codes. Now the printer, encoder and disassembler take care of converting the immediate. We use InstAliases to handle the assembly matching. But we print using the asm string in the instruction definition. The instruction itself is marked IsCodeGenOnly=1 to hide it from the assembly parser. Reviewers: andreadb, courbet, RKSimon, spatel, lebedev.ri Reviewed By: andreadb Subscribers: hiraditya, lebedev.ri, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60138 llvm-svn: 357801
* [X86] Merge the different CMOV instructions for each condition code into ↵Craig Topper2019-04-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | single instructions that store the condition code as an immediate. Summary: Reorder the condition code enum to match their encodings. Move it to MC layer so it can be used by the scheduler models. This avoids needing an isel pattern for each condition code. And it removes translation switches for converting between CMOV instructions and condition codes. Now the printer, encoder and disassembler take care of converting the immediate. We use InstAliases to handle the assembly matching. But we print using the asm string in the instruction definition. The instruction itself is marked IsCodeGenOnly=1 to hide it from the assembly parser. This does complicate the scheduler models a little since we can't assign the A and BE instructions to a separate class now. I plan to make similar changes for SETcc and Jcc. Reviewers: RKSimon, spatel, lebedev.ri, andreadb, courbet Reviewed By: RKSimon Subscribers: gchatelet, hiraditya, kristina, lebedev.ri, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60041 llvm-svn: 357800
* Revert "[llvm-readobj] Improve error message for --string-dump"Stephen Tozer2019-04-052-11/+16
| | | | | | | | This reverts commit 681b0798dbbc6b3500c9930977ec8a274b142acb. Reverted due to causing build failures: llvm-svn: 357772 llvm-svn: 357774
* [llvm-readobj] Improve error message for --string-dumpStephen Tozer2019-04-052-16/+11
| | | | | | | | | | | | | | | | Fixes bug 40630: https://bugs.llvm.org/show_bug.cgi?id=40630 This patch changes the error message when the section specified by --string-dump cannot be found by including the name of the section in the error message and changing the prefix text to not imply that the file itself was invalid. As part of this change some uses of std::error_code have been replaced with the llvm Error class to better encapsulate the error info (rather than passing File strings around), and the WithColor class replaces string literal error prefixes. Differential Revision: https://reviews.llvm.org/D59946 llvm-svn: 357772
* [format] Add correct punctuation to commentStephen Tozer2019-04-051-1/+1
| | | | | | | Test commit that adds a grammatically correct full stop to a single comment. llvm-svn: 357771
* Add an option do not dump the generated object on diskGuillaume Chatelet2019-04-053-14/+34
| | | | | | | | | | | | Reviewers: courbet Subscribers: llvm-commits, bdb Tags: #llvm Differential Revision: https://reviews.llvm.org/D60317 llvm-svn: 357769
* Include invoke'd functions for recursive extractDavid Callahan2019-04-041-3/+3
| | | | | | | | | | | | | | | | Summary: When recursively extracting a function from a bit code file, include functions mentioned in InvokeInst as well as CallInst Reviewers: loladiro, espindola, volkan Reviewed By: loladiro Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60231 llvm-svn: 357735
* llvm-dwarfdump: Support alternative architecture names in the -arch filterAdrian Prantl2019-04-041-7/+4
| | | | | | <rdar://problem/47918606> llvm-svn: 357706
* [llvm-symbolizer] Allow more flexible usage of -e.Igor Kudrin2019-04-041-4/+3
| | | | | | | | | | | | | | | | addr2line allows -e to be grouped with other options; it also allows it to prefix the value. Thus, all the following usages are possible: * addr2line -f -e <bin> <addr> * addr2line -fe <bin> <addr> * addr2line -f e<bin> <addr> * addr2line -fe<bin> <addr> This patch adds the same for llvm-symbolizer. Differential Revision: https://reviews.llvm.org/D60196 llvm-svn: 357676
* [llvm-symbolizer] Add `--output-style` switch.Igor Kudrin2019-04-041-1/+9
| | | | | | | | | | | | | In general, llvm-symbolizer follows the output style of GNU's addr2line. However, there are still some differences; in particular, for a requested address, llvm-symbolizer prints line and column, while addr2line prints only the line number. This patch adds a new switch to select the preferred style. Differential Revision: https://reviews.llvm.org/D60190 llvm-svn: 357675
* [XCOFF] Add functionality for parsing AIX XCOFF object file headersHubert Tong2019-04-044-0/+60
| | | | | | | | | | | | | | | | | | | | | Summary: 1. Add functionality for parsing AIX XCOFF object files headers. 2. Only support 32-bit AIX XCOFF object files in this patch. 3. Print out the AIX XCOFF object file header in YAML format. Reviewers: sfertile, hubert.reinterpretcast, jasonliu, mstorsjo, zturner, rnk Reviewed By: sfertile, hubert.reinterpretcast Subscribers: jsji, mgorny, hiraditya, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59419 Patch by Digger Lin llvm-svn: 357663
* [codeview] Remove Type member from CVRecordReid Kleckner2019-04-042-2/+2
| | | | | | | | | | | | | | | | | Summary: Now CVType and CVSymbol are effectively type-safe wrappers around ArrayRef<uint8_t>. Make the kind() accessor load it from the RecordPrefix, which is the same for types and symbols. Reviewers: zturner, aganea Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60018 llvm-svn: 357658
* [yaml2obj][obj2yaml] - Change how symbol's binding is descibed when ↵George Rimar2019-04-032-74/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | parsing/dumping. Currently, YAML has the following syntax for describing the symbols: Symbols: Local: LocalSymbol1: ... LocalSymbol2: ... ... Global: GlobalSymbol1: ... Weak: ... GNUUnique: I.e. symbols are grouped by their bindings. That is not very convenient, because: It does not allow to set a custom binding, what can be useful for producing broken/special outputs for test cases. Adding a new binding would require to change a syntax (what we observed when added GNUUnique recently). It does not allow to change the order of the symbols in .symtab/.dynsym, i.e. currently all Local symbols are placed first, then Global, Weak and GNUUnique are following, but we are not able to change the order. It is not consistent. Binding is just one of the properties of the symbol, we do not group them by other properties. It makes the code more complex that it can be. This patch shows it can be simplified with the change performed. The patch changes the syntax to just: Symbols: Symbol1: ... Symbol2: ... ... With that, we are able to work with the binding field just like with any other symbol property. Differential revision: https://reviews.llvm.org/D60122 llvm-svn: 357595
* [llvm-objcopy] Make section rename/set flags case-insensitiveJames Henderson2019-04-031-12/+12
| | | | | | | | | | | | This fixes https://bugs.llvm.org/show_bug.cgi?id=41305. GNU objcopy --set-section-flags/--rename-section flags are case-insensitive, so this patch updates llvm-objcopy to match. Reviewed by: grimar Differential Revision: https://reviews.llvm.org/D60200 llvm-svn: 357590
* [llvm-readobj] Add GNU style dumper for .gnu.version sectionXing GUO2019-04-031-1/+51
| | | | | | | | | | | | | | | | Summary: Currently, `llvm-readobj` do not support GNU style dumper for symbol versioning sections. In this patch, I would like to implement dumper for `.gnu.version` section Reviewers: jhenderson, rupprecht, grimar Reviewed By: jhenderson, rupprecht Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59877 llvm-svn: 357578
* [llvm-nm]Add support for --no-demangleJames Henderson2019-04-031-3/+10
| | | | | | | | | | | | | GNU nm has --no-demangle, so llvm-nm should too. It disables the --demangle switch. The patch also allows --demangle to be specified multiple times (the last of all --no-demangle/--demangle switches takes precedence). Reviewed by: grimar, rupprecht, mattd Differential Revision: https://reviews.llvm.org/D60134 llvm-svn: 357575
* [llvm-objcopy] Change SHT_NOBITS to SHT_PROBITS for some --set-section-flagsJordan Rupprecht2019-04-021-5/+16
| | | | | | | | | | | | | | | | | | | | | Summary: Some flags accepted by --set-section-flags and --rename-section can change a SHT_NOBITS section to a SHT_PROGBITS section. Note that none of them can change a SHT_PROGBITS to SHT_NOBITS. The full list (found via experimentation of individually setting each flag) that does this is: contents, load, noload, code, data, rom, and debug. This was found by testing llvm-objcopy with the gnu binutils test suite, specifically this test case: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=binutils/testsuite/binutils-all/copy-1.d;h=f2b0d9e90df738c2891b4d5c7b62f62894b556ca;hb=HEAD Reviewers: jhenderson, grimar, jakehehrlich, alexshap, espindola Reviewed By: jhenderson Subscribers: emaste, arichardson, MaskRay, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59958 llvm-svn: 357492
* [llvm-shlib] Fix cross-compilation for LLVM-CShoaib Meenai2019-04-021-2/+10
| | | | | | | | | | | | | When we're cross-compiling, build and use a native llvm-nm instead of attempting to use the one from the target's build tree. A nice follow-up would be to add a cache variable to allow specifying a path to an external native llvm-nm instead of building one ourselves, similar to LLVM_TABLEGEN and LLVM_CONFIG_PATH. Differential Revision: https://reviews.llvm.org/D60025 llvm-svn: 357487
* [cmake] Add function for building native toolShoaib Meenai2019-04-021-9/+2
| | | | | | | | | | | | | | | | | | Instead of duplicating functionality for building native versions of tblgen and llvm-config, add a function to set up a native tool build. This will also be used for llvm-nm in a follow-up. This should be NFC for tblgen, besides the slightly different COMMENT for the custom command (it'll display the tablegen target name instead of always saying TableGen). For the native llvm-config, it's a behavior change in that we'll use llvm_ExternalProject_BuildCmd instead of constructing the build command manually, always build in Release, and reference the correct binary path for multi-config generators. I believe all of these changes to be bug fixes. Differential Revision: https://reviews.llvm.org/D60024 llvm-svn: 357486
* [llvm-objcopy]Allow llvm-objcopy to be used on an ELF file with no section ↵James Henderson2019-04-022-13/+21
| | | | | | | | | | | | | | | | | | | | headers This patch fixes https://bugs.llvm.org/show_bug.cgi?id=41293 and https://bugs.llvm.org/show_bug.cgi?id=41045. llvm-objcopy assumed that it could always read a section header string table. This isn't the case when the sections were previously all stripped, and the e_shstrndx field was set to 0. This patch fixes this. It also fixes a double space in an error message relating to this issue, and prevents llvm-objcopy from adding extra space for non-existent section headers, meaning that --strip-sections on the output of a previous --strip-sections run produces identical output, simplifying the test. Reviewed by: rupprecht, grimar Differential Revision: https://reviews.llvm.org/D59989 llvm-svn: 357475
* Add minidump support to obj2yamlPavel Labath2019-04-024-0/+31
| | | | | | | | | | | | | | | | | Summary: This patch adds the code needed to parse a minidump file into the MinidumpYAML model, and the necessary glue code so that obj2yaml can recognise the minidump files and process them. Reviewers: jhenderson, zturner, clayborg Subscribers: mgorny, lldb-commits, amccarth, markmentovai, aprantl, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59634 llvm-svn: 357469
* [llvm-objcopy] Add --keep-symbols optionYi Kong2019-04-012-0/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D60054 llvm-svn: 357418
OpenPOWER on IntegriCloud