summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
* [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
* Simplify some APIs I was cleaning up while fixing -Wpessimizing-move warningDavid Blaikie2015-11-091-27/+25
| | | | | | (Reid fixed the original error, but this seems nice to do in any case) llvm-svn: 252548
* Fix -Wpessimizing-move warning in llvm-config.cppReid Kleckner2015-11-091-1/+1
| | | | llvm-svn: 252542
* Fix `llvm-config` to adapt to the install environment.Richard Diamond2015-11-094-22/+259
| | | | | | | | | | | | | | | | | | | | | Summary: This patch does a couple of things: - Adds a new argument `--shared-mode` which accepts a list of components and prints whether or not the provided components need to be linked statically or shared. - Fixes `--libnames` when CMake BUILD_SHARED_LIBS is used. - Fixes `--libnames`, `--libs`, and `--libfiles` for dylib when static components aren't installed. - Fixes `--libnames`, `--libs`, `--libfiles`, and `--components` to use LLVM_DYLIB_COMPONENTS as the component manifest for dylib linking. - Uses the host platform's usual convention for filename extensions and such, instead of always defaulting to Unix-izms. Because I don't own a Mac, I am not able to test the Mac platform dependent stuff locally. If someone would be willing to run a build for me on their machine (unless there's a better option), I'd appreciate it. Reviewers: jfb, brad.king, whitequark, beanz Subscribers: beanz, jauhien, llvm-commits Differential Revision: http://reviews.llvm.org/D13198 llvm-svn: 252532
* Make bugpoint ehpad/token friendlyDavid Majnemer2015-11-081-4/+5
| | | | | | | Tokens shouldn't be blindly replaced with undef/null. Also, don't try to remove EH pad instructions from the top of basic blocks. llvm-svn: 252414
* ADT: Remove last implicit ilist iterator conversions, NFCDuncan P. N. Exon Smith2015-11-071-1/+1
| | | | | | | | | | Some implicit ilist iterator conversions have crept back into Analysis, Transforms, Hexagon, and llvm-stress. This removes them. I'll commit a patch immediately after this to disallow them (in a separate patch so that it's easy to revert if necessary). llvm-svn: 252371
* Fix bugpoint breakage on libcxx introduced by r252247Keno Fischer2015-11-061-2/+2
| | | | llvm-svn: 252253
* [bugpoint] Add a named metadata (+their operands) reducerKeno Fischer2015-11-062-13/+213
| | | | | | | | | | | | | | | | | | | Summary: We frequently run bugpoint on a linked module that consists of all modules we create while jitting the julia standard library. This module has a very large number of compile units (10000+) in `llvm.dbg.cu`, which didn't get reduced at all, requiring manual post processing. This is an attempt to have bugpoint go through and attempt to reduce the number of global named metadata nodes as well as their operands, to cut down the number of roots for such metadata. Reviewers: dexonsmith, reames, pete Subscribers: pete, dexonsmith, reames, llvm-commits Differential Revision: http://reviews.llvm.org/D14043 llvm-svn: 252247
* Reapply r250906 with many suggested updates from Rafael Espindola.Kevin Enderby2015-11-058-24/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The needed lld matching changes to be submitted immediately next, but this revision will cause lld failures with this alone which is expected. This removes the eating of the error in Archive::Child::getSize() when the characters in the size field in the archive header for the member is not a number. To do this we have all of the needed methods return ErrorOr to push them up until we get out of lib. Then the tools and can handle the error in whatever way is appropriate for that tool. So the solution is to plumb all the ErrorOr stuff through everything that touches archives. This include its iterators as one can create an Archive object but the first or any other Child object may fail to be created due to a bad size field in its header. Thanks to Lang Hames on the changes making child_iterator contain an ErrorOr<Child> instead of a Child and the needed changes to ErrorOr.h to add operator overloading for * and -> . We don’t want to use llvm_unreachable() as it calls abort() and is produces a “crash” and using report_fatal_error() to move the error checking will cause the program to stop, neither of which are really correct in library code. There are still some uses of these that should be cleaned up in this library code for other than the size field. The test cases use archives with text files so one can see the non-digit character, in this case a ‘%’, in the size field. These changes will require corresponding changes to the lld project. That will be committed immediately after this change. But this revision will cause lld failures with this alone which is expected. llvm-svn: 252192
* [CMake] Bug 25059 - CMake libllvm.so.$MAJOR.$MINOR shared object name not ↵Chris Bieneman2015-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | compatible with ldconfig Summary: This change makes the CMake build system generate libraries for Linux and Darwin matching the makefile build system. Linux libraries follow the pattern lib${name}.${MAJOR}.${MINOR}.so so that ldconfig won't pick it up incorrectly. Darwin libraries are not versioned. Note: On linux the non-versioned symlink is generated at install-time not build time. I plan to fix that eventually, but I expect that is good enough for the purposes of fixing this bug. Reviewers: loladiro, tstellarAMD Subscribers: axw, llvm-commits Differential Revision: http://reviews.llvm.org/D13841 llvm-svn: 252093
* Fix some Clang-tidy modernize warnings, other minor fixes.Eugene Zelenko2015-11-043-6/+8
| | | | | | | | Fixed warnings are: modernize-use-override, modernize-use-nullptr and modernize-redundant-void-arg. Differential revision: http://reviews.llvm.org/D14312 llvm-svn: 252087
* llvm-config: Add --has-rtti optionTom Stellard2015-11-044-0/+13
| | | | | | | | | | | | | | | | | | | | | | Summary: This prints NO if LLVM was built with -fno-rtti or an equivalent flag and YES otherwise. The reasons to add -has-rtti rather than adding -fno-rtti to --cxxflags are: 1. Building LLVM with -fno-rtti does not always mean that client applications need this flag. 2. Some compilers have a different flag for disabling rtti, and the compiler being used to build LLVM may not be the compiler being used to build the application. Reviewers: echristo, chandlerc, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11849 llvm-svn: 252075
* [ELF] elfiamcu triple should imply e_machine == EM_IAMCUMichael Kuperstein2015-11-041-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D14109 llvm-svn: 252043
* [LLVMSymbolize] Properly propagate object parsing errors from the library.Alexey Samsonov2015-11-041-3/+14
| | | | llvm-svn: 252021
* [LLVMSymbolize] Factor out the logic for printing structs from DIContext. NFC.Alexey Samsonov2015-11-031-6/+11
| | | | | | | | Introduce DIPrinter which takes care of rendering DILineInfo and friends. This allows LLVMSymbolizer class to return a structured data instead of plain std::strings. llvm-svn: 251989
* llmv-pdbdump: Make BuiltinDumper shorter. NFC.Rui Ueyama2015-11-032-41/+27
| | | | llvm-svn: 251974
* Revert "Revert "[Orc] Directly emit machine code for the x86 resolver block ↵Rafael Espindola2015-11-032-29/+16
| | | | | | | | | | and trampolines."" This reverts commit r251937. The test was updated to the new API, bring the API back. llvm-svn: 251944
* Revert "[Orc] Directly emit machine code for the x86 resolver block and ↵Rafael Espindola2015-11-032-16/+29
| | | | | | | | | | trampolines." This reverts commit r251933. It broke the build of examples/Kaleidoscope/Orc/fully_lazy/toy.cpp. llvm-svn: 251937
* [Orc] Directly emit machine code for the x86 resolver block and trampolines.Lang Hames2015-11-032-29/+16
| | | | | | | | | | | | | | Bypassing LLVM for this has a number of benefits: 1) Laziness support becomes asm-syntax agnostic (previously lazy jitting didn't work on Windows as the resolver block was in Darwin asm). 2) For cross-process JITs, it allows resolver blocks and trampolines to be emitted directly in the target process, reducing cross process traffic. 3) It should be marginally faster. llvm-svn: 251933
* Pass enum instead of bool to new linkInModule call in llvm-linkTeresa Johnson2015-11-031-1/+1
| | | | | | | | | A new call I added to linkInModule from llvm-link in r251866 was still passing in a boolean for an argument that was changed to an enum in r246561. I didn't catch this in my merge since the bool false matched the flag value it mapped to. llvm-svn: 251925
* Don't implicitly construct a Archive::child_iterator.Rafael Espindola2015-11-031-2/+2
| | | | llvm-svn: 251878
OpenPOWER on IntegriCloud