summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-rtdyld] Refactor to reduce indentation.Davide Italiano2015-11-221-5/+4
| | | | | | Suggested by: David Blaikie. llvm-svn: 253808
* [ThinLTO] Handle bitcode without function summary sections gracefullyTeresa Johnson2015-11-212-14/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Several fixes to the handling of bitcode files without function summary sections so that they are skipped during ThinLTO processing in llvm-lto and the gold plugin when appropriate instead of aborting. 1 Don't assert when trying to add a FunctionInfo that doesn't have a summary attached. 2 Skip FunctionInfo structures that don't have attached function summary sections when trying to create the combined function summary. 3 In both llvm-lto and gold-plugin, check whether a bitcode file has a function summary section before trying to parse the index, and skip the bitcode file if it does not. 4 Fix hasFunctionSummaryInMemBuffer in BitcodeReader, which had a bug where we returned to early while looking for the summary section. Also added llvm-lto and gold-plugin based tests for cases where we don't have function summaries in the bitcode file. I verified that either the first couple fixes described above are enough to avoid the crashes, or fixes 1,3,4. But have combined them all here for added robustness. Reviewers: joker.eph Subscribers: llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D14903 llvm-svn: 253796
* [llvm-rtdyld] Fail early if we can't load dynamic libraries.Davide Italiano2015-11-211-3/+2
| | | | llvm-svn: 253767
* [llvm-rtdyld] Turn assertion into errors, it seems more appropriate.Davide Italiano2015-11-211-4/+8
| | | | llvm-svn: 253766
* [llvm-rtdyld] Improve error handling, use Error().Davide Italiano2015-11-211-14/+8
| | | | llvm-svn: 253765
* [llvm-rtdyld] Use report_fatal_error().Davide Italiano2015-11-211-22/+13
| | | | | | This is a first step towards saner/uniform error reporting in llvm-rtdyld. llvm-svn: 253759
* llvm-link option and test for recent metadata mapping bugTeresa Johnson2015-11-211-0/+13
| | | | | | | | | | | | | | | | | | | | | | | Summary: Add a -preserve-modules option to llvm-link that simulates LTO clients that don't destroy modules as they are linked. This enables reproduction of a recent bug introduced by a metadata linking change that was only caught when the modules weren't destroyed before writing bitcode (LTO on Windows). See http://llvm.org/viewvc/llvm-project?view=revision&revision=253170 for more details on the original bug and the fix. Confirmed the new test added here reproduces the failure using the new option when I suppress the fix. Reviewers: pcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14818 llvm-svn: 253740
* [llvm-rtdyld] Message() is used only once. Inline. NFC.Davide Italiano2015-11-201-5/+1
| | | | llvm-svn: 253736
* [ThinLTO] Add MODULE_CODE_METADATA_VALUES recordTeresa Johnson2015-11-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is split out from the ThinLTO metadata mapping patch http://reviews.llvm.org/D14752. To avoid needing to parse the module level metadata during function importing, a new module-level record is added which holds the number of module-level metadata values. This is required because metadata value ids are assigned implicitly during parsing, and the function-level metadata ids start after the module-level metadata ids. I made a change to this version of the code compared to D14752 in order to add more consistent and thorough assertion checking of the new record value. We now unconditionally use the record value to initialize the MDValueList size, and handle it the same in parseMetadata for all module level metadata cases (lazy loading or not). Reviewers: dexonsmith, joker.eph Subscribers: davidxl, llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D14825 llvm-svn: 253668
* [LTO] Add options to llvm-lto to select output format and dump merged moduleTobias Edler von Koch2015-11-201-0/+23
| | | | | | | | | | | | This introduces two new options: - "llvm-lto -save-merged-module -o outfile" dumps the LTO Module to outfile.merged.bc prior to CodeGen and after LTO optimizations have been run. - "llvm-lto -filetype=asm -o outfile" makes llvm-lto emit assembly instead of object code in outfile. Both are intended for use in lit tests. llvm-svn: 253624
* Remove unused function parameter (NFC)Mehdi Amini2015-11-191-3/+2
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 253569
* gold-plugin.cpp: Fix diagnosticHandler corresponding to r253540.NAKAMURA Takumi2015-11-191-4/+9
| | | | llvm-svn: 253553
* Do not require a Context to extract the FunctionIndex from Bitcode (NFC)Mehdi Amini2015-11-192-5/+31
| | | | | | | | | | The LLVMContext was only used for Diagnostic. Pass a DiagnosticHandler instead. Differential Revision: http://reviews.llvm.org/D14794 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 253540
* Fix UMR in llvm-nm on IR object files in printDarwinSymbolReid Kleckner2015-11-191-5/+4
| | | | llvm-svn: 253529
* [llvm-profdata] Use SmallSet rather that std::set for keeping track of ↵Nathan Slingerland2015-11-181-3/+2
| | | | | | | | | | profdata merge errors Missed bit of feedback from D14720. Use SmallSet<std::error_code> rather than std::set<...> in order to be more efficient. llvm-svn: 253474
* Fix LLD testsuite fallout from r253429David Majnemer2015-11-181-4/+4
| | | | llvm-svn: 253432
* [llvm-objdump] Use the COFF export table for additional symbolsDavid Majnemer2015-11-181-57/+118
| | | | | | | | | Most linked executables do not have a symbol table in COFF. However, it is pretty typical to have some export entries. Use those entries to inform the disassembler about potential function definitions and call targets. llvm-svn: 253429
* [llvm-profdata] Fix unhandled enumeration values warningNathan Slingerland2015-11-181-0/+2
| | | | | | | | | | Fix this: llvm/tools/llvm-profdata/llvm-profdata.cpp:78:15: warning: 12 enumeration values not handled in switch: 'success', 'eof', 'unrecognized_format'... [-Wswitch] switch (instrError) { ^ llvm-svn: 253413
* Generalize ownership/passing semantics to allow dsymutil to own ↵David Blaikie2015-11-181-10/+6
| | | | | | | | | | | | | abbreviations via unique_ptr While still allowing CodeGen/AsmPrinter in llvm to own them using a bump ptr allocator. (might be nice to replace the pointers there with something that at least automatically calls their dtors, if that's necessary/useful, rather than having it done explicitly (I think a typed BumpPtrAllocator already does this, or maybe a unique_ptr with a custom deleter, etc)) llvm-svn: 253409
* [llvm-profdata] Show hint for other mismatch errors when merging instr profdataNathan Slingerland2015-11-171-1/+5
| | | | | | | | | | | Missed bit of feedback from D14720. Show the same "Make sure that all profile data to be merged is generated from the same binary." hint for hash mismatch and value site count mismatch as we now do for counter mismatch when merging incompatible instrumentation profile data. llvm-svn: 253400
* [llvm-profdata] Improve error messaging when merging mismatched profile dataNathan Slingerland2015-11-171-4/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change tries to make the root cause of instrumented profile data merge failures clearer. Previous: $ llvm-profdata merge test_0.profraw test_1.profraw -o test_merged.profdata test_1.profraw: foo: Function count mismatch test_1.profraw: bar: Function count mismatch test_1.profraw: baz: Function count mismatch ... Changed: $ llvm-profdata merge test_0.profraw test_1.profraw -o test_merged.profdata test_1.profraw: foo: Function basic block count change detected (counter mismatch) Make sure that all profile data to be merged is generated from the same binary. test_1.profraw: bar: Function basic block count change detected (counter mismatch) test_1.profraw: baz: Function basic block count change detected (counter mismatch) ... Reviewers: dnovillo, davidxl, bogner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14739 llvm-svn: 253384
* adding sancov to Makefile directory list.Mike Aizatsky2015-11-171-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D14753 llvm-svn: 253368
* Switch lto codegen to using diagnostic handlers.Yunzhong Gao2015-11-172-16/+14
| | | | | | | | | | | This patch removes the std::string& argument from a number of C++ LTO API calls and instead makes them use the installed diagnostic handler. This would also improve consistency of diagnostic handling infrastructure: if an LTO client used lto_codegen_set_diagnostic_handler() to install a custom error handler, we do not want some error messages to go through the custom error handler, and some other error messages to go into sLastErrorString. llvm-svn: 253367
* [llvm-rtdyld] Don't waste cycles invalidating instruction cache.Davide Italiano2015-11-171-20/+4
| | | | | | | | | | | | | Now that setExecutable() changed to do all the ground work to make memory executable on the host, we can remove all (redundant) calls to invalidate instruction cache here. As an added bonus, this makes invalidateInstructionCache() dead code, so it can be removed. Differential Revision: http://reviews.llvm.org/D13631 llvm-svn: 253343
* Use a different block id for block of metadata kind recordsTeresa Johnson2015-11-151-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There are currently two blocks with the METADATA_BLOCK id at module scope. The first has the module-level metadata values (consisting of some combination of METADATA_* record codes except for METADATA_KIND). The second consists only of METADATA_KIND records. The latter is used only in the METADATA_ATTACHMENT block within function blocks (for metadata attached to instructions). For ThinLTO we want to delay the parsing of module level metadata until all functions have been imported from that module (there is some bookkeeping used to suture it up when we read it during a post-pass). However, we do need the METADATA_KIND records when parsing the function body during importing, since those kinds are used as described above. To simplify identification and parsing of just the block containing the metadata kinds, use a different block id (METADATA_KIND_BLOCK_ID). Support older bitcode without the new block id as well. Reviewers: dexonsmith, joker.eph Subscribers: davidxl, llvm-commits Differential Revision: http://reviews.llvm.org/D14654 llvm-svn: 253154
* [llvm-ar] Use failIfError/fail helpers.Davide Italiano2015-11-141-11/+4
| | | | llvm-svn: 253141
* [llvm-ar] Use fail() helper to reduce duplication.Davide Italiano2015-11-141-4/+2
| | | | llvm-svn: 253139
* [llvm-ar] Simplify the code.Davide Italiano2015-11-141-12/+3
| | | | llvm-svn: 253138
* [llvm-profdata] Add check for text profile formats and improve error ↵Nathan Slingerland2015-11-131-13/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reporting (2nd try) Summary: This change addresses two possible instances of user error / confusion when merging sampled profile data. Previously any input that didn't match the raw or processed instrumented format would automatically be interpreted as instrumented profile text format data. No error would be reported during the merge. Example: If foo-sampled.profdata and bar-sampled.profdata are binary sampled profiles: Old behavior: $ llvm-profdata merge foo-sampled.profdata bar-sampled.profdata -output foobar-sampled.profdata $ llvm-profdata show -sample foobar-sampled.profdata error: foobar-sampled.profdata:1: Expected 'mangled_name:NUM:NUM', found lprofi This change adds basic checks for valid input data when assuming text input. It also makes error messages related to file format validity more specific about the assumbed profile data type. New behavior: $ llvm-profdata merge foo-sampled.profdata bar-sampled.profdata -o foobar-sampled.profdata error: foo.profdata: Unrecognized instrumentation profile encoding format Perhaps you forgot to use the -sample option? Reviewers: bogner, davidxl, dnovillo Subscribers: davidxl, llvm-commits Differential Revision: http://reviews.llvm.org/D14558 llvm-svn: 253009
* sancov test suiteMike Aizatsky2015-11-121-3/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D14589 llvm-svn: 252933
* reverting r252916 to investigate test failureNathan Slingerland2015-11-121-29/+13
| | | | llvm-svn: 252921
* [llvm-profdata] Add check for text profile formats and improve error reportingNathan Slingerland2015-11-121-13/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change addresses two possible instances of user error / confusion when merging sampled profile data. Previously any input that didn't match the raw or processed instrumented format would automatically be interpreted as instrumented profile text format data. No error would be reported during the merge. Example: If foo-sampled.profdata and bar-sampled.profdata are binary sampled profiles: Old behavior: $ llvm-profdata merge foo-sampled.profdata bar-sampled.profdata -output foobar-sampled.profdata $ llvm-profdata show -sample foobar-sampled.profdata error: foobar-sampled.profdata:1: Expected 'mangled_name:NUM:NUM', found lprofi This change adds basic checks for valid input data when assuming text input. It also makes error messages related to file format validity more specific about the assumbed profile data type. New behavior: $ llvm-profdata merge foo-sampled.profdata bar-sampled.profdata -o foobar-sampled.profdata error: foo.profdata: Unrecognized instrumentation profile encoding format Perhaps you forgot to use the -sample option? Reviewers: bogner, davidxl, dnovillo Subscribers: davidxl, llvm-commits Differential Revision: http://reviews.llvm.org/D14558 llvm-svn: 252916
* [Object, MachO] Mark symbols from DATA and BSS sections as ST_DataKuba Brecka2015-11-121-1/+1
| | | | | | | | In `MachOObjectFile::getSymbolType` we currently always return `SymbolRef::ST_Function` for symbols from any section. In order for llvm-symbolizer to correctly symbolize Mach-O globals, symbols from data and BSS sections should return `SymbolRef::ST_Data`. Differential Revision: http://reviews.llvm.org/D14576 llvm-svn: 252867
* dwarfdump: Added macro support to llvm-dwarfdump tool.Amjad Aboud2015-11-121-0/+1
| | | | | | | | Added "macro" option to "-debug-dump" flag, which trigger parsing and dumping of the ".debug_macinfo" section. Differential Revision: http://reviews.llvm.org/D14294 llvm-svn: 252866
* dwarfdump: Use the right enum for the tu_index sectionDavid Blaikie2015-11-121-1/+1
| | | | llvm-svn: 252835
* dwarfdump: add command line support for dumping the tu_index sectionDavid Blaikie2015-11-121-1/+2
| | | | llvm-svn: 252830
* Adding qualifier for make_unique.Mike Aizatsky2015-11-111-2/+2
| | | | | | | | Summary: MSVC gets confused. Differential Revision: http://reviews.llvm.org/D14585 llvm-svn: 252804
* sancov tool in c++Mike Aizatsky2015-11-113-0/+292
| | | | | | | | | | | First batch of sancov.py rewrite in c++. Supports "-print" and "-coveredfns" commands. Followup to http://reviews.llvm.org/D14356 in a better location. Differential Revision: http://reviews.llvm.org/D14579 llvm-svn: 252801
* [Symbolizer]: Add -pretty-print optionHemant Kulkarni2015-11-111-2/+9
| | | | | | Differential Revision: http://reviews.llvm.org/D13671 llvm-svn: 252798
* Add a libLTO diagnostic handler that supports lto_get_error_message APIYunzhong Gao2015-11-111-2/+10
| | | | | | | | | | | | | | This is a follow-up from the previous discussion on the thread: http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151019/307763.html The LibLTO lto_get_error_message() API reads error messages from a std::string sLastErrorString. Instead of passing this string around as an argument, this patch creates a diagnostic handler and then sends this handler to the constructor of LTOCodeGenerator. Differential Revision: http://reviews.llvm.org/D14313 llvm-svn: 252791
* Format my previous commitDavid Blaikie2015-11-111-8/+8
| | | | llvm-svn: 252782
* dwarfdump: First piece of support for DWP dumpingDavid Blaikie2015-11-111-0/+1
| | | | | | Just a tiny piece of index dumping - the header in this instance. llvm-svn: 252781
* Reverting r252760Colin LeMahieu2015-11-111-9/+2
| | | | llvm-svn: 252770
* llvm-config.cpp: Prune an obsolete \param. [-Wdocumentation]NAKAMURA Takumi2015-11-111-2/+0
| | | | llvm-svn: 252762
* [Symbolizer]: Add -pretty-print optionHemant Kulkarni2015-11-111-2/+9
| | | | | | Differential Revision: http://reviews.llvm.org/D13671 llvm-svn: 252760
* [CMake] Autoconf builds libLTO with -fPIC, CMake should be able to as well.Chris Bieneman2015-11-101-1/+1
| | | | llvm-svn: 252652
* dsymutil: Prune module forward decl DIEs if a uniquable definition wasAdrian Prantl2015-11-101-6/+18
| | | | | | | | | | already emitted and fix a latent bug in DIECloner where the DW_CHILDREN_yes flag is set based on the number of children in the input DIE rather than the number of children that are actually being cloned. rdar://problem/23439845 llvm-svn: 252649
* llvm-lto: trivial spelling changes to distinguish custom diagnostic handler andYunzhong Gao2015-11-101-0/+1
| | | | | | | | default diagnostic handler. Differential Revision: http://reviews.llvm.org/D14520 llvm-svn: 252633
* Fix mingw targets. Bandaid for r252532's buildbot brakage.Richard Diamond2015-11-101-1/+1
| | | | | | | | | | Reviewers: brad.king, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14523 llvm-svn: 252576
* Fix llvm-nm(1) printing of llvm-bitcode files for -format darwin to match ↵Kevin Enderby2015-11-101-45/+113
| | | | | | | | darwin’s nm(1). Also a small fix to match printing of Mach-O objects with -format posix. llvm-svn: 252567
OpenPOWER on IntegriCloud