summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm-cov] Create an index of reports in -output-dir modeVedant Kumar2016-06-285-93/+151
| | | | | | | | | | This index lists the reports available in the 'coverage' sub-directory. This will help navigate coverage output from large projects. This commit factors the file creation code out of SourceCoverageView and into CoveragePrinter. llvm-svn: 274029
* [llvm-cov] Minor cleanups (NFC)Vedant Kumar2016-06-281-2/+2
| | | | | | | | - Test the '-o' alias for -output-dir. - Use a helper method in a conditional. - Add a period. llvm-svn: 274028
* [llvm-cov] Avoid copying file paths multiple times (NFC)Vedant Kumar2016-06-283-4/+15
| | | | llvm-svn: 274027
* [llvm-cov] Rename ShowFormat to Format (NFC)Vedant Kumar2016-06-283-4/+4
| | | | | | | This makes it a bit more generic, in case we want to emit summary reports in different formats in the future. llvm-svn: 274026
* [llvm-cov] Move a check into a helper method (NFC)Vedant Kumar2016-06-282-1/+4
| | | | llvm-svn: 274025
* Fix "not all control paths return a value" warning on MSVCSimon Pilgrim2016-06-281-0/+1
| | | | llvm-svn: 274011
* [llvm-cov] Simplify; NFCVedant Kumar2016-06-281-4/+2
| | | | llvm-svn: 273988
* Reapply "[llvm-cov] Add an -output-dir option for the show sub-command""Vedant Kumar2016-06-286-6/+124
| | | | | | | | | | | | | | | Passing -output-dir path/to/dir to llvm-cov show creates path/to/dir if it doesn't already exist, and prints reports into that directory. In function view mode, all views are written into path/to/dir/functions.$EXTENSION. In file view mode, all views are written into path/to/dir/coverage/$PATH.$EXTENSION. Changes since the initial commit: - Avoid accidentally closing stdout twice. llvm-svn: 273985
* Revert "[llvm-cov] Add an -output-dir option for the show sub-command"Vedant Kumar2016-06-286-116/+6
| | | | | | | This reverts commit r273971. test/profile/instrprof-visibility.cpp is failing because of an uncaught error in SafelyCloseFileDescriptor. llvm-svn: 273978
* [llvm-cov] Add an -output-dir option for the show sub-commandVedant Kumar2016-06-286-6/+116
| | | | | | | | | | | Passing -output-dir path/to/dir to llvm-cov show creates path/to/dir if it doesn't already exist, and prints reports into that directory. In function view mode, all views are written into path/to/dir/functions.$EXTENSION. In file view mode, all views are written into path/to/dir/coverage/$PATH.$EXTENSION. llvm-svn: 273971
* [llvm-cov] clang-format a line, NFCVedant Kumar2016-06-281-1/+2
| | | | llvm-svn: 273969
* [llvm-cov] Add a format option for the 'show' sub-command (mostly NFC)Vedant Kumar2016-06-283-2/+18
| | | | llvm-svn: 273968
* Change all but the last ErrorOr<...> use for MachOUniversalBinary to ↵Kevin Enderby2016-06-271-2/+4
| | | | | | | | | | | | | | | Expected<...> to allow a good error message to be produced. I added the one test case that the object file tools could produce an error message. The other two errors can’t be triggered if the input file is passed through sys::fs::identify_magic(). But the malformedError("bad magic number") does get triggered by the logic in llvm-dsymutil when dealing with a normal Mach-O file. The other "File too small ..." error would take a logic error currently to produce and is not tested for. llvm-svn: 273946
* [llvm-ar] Ignore -plugin option.Davide Italiano2016-06-271-0/+1
| | | | | | | | | | | binutils ar uses -plugin to specify the LTO plugin, but LLVM doesn't need this as it doesn't use a plugin for LTO. Accepting (and ignoring) the option allows interoperability with existing build systems and make downstream consumers life much easier. No objections from Rafael on this change. llvm-svn: 273938
* [yaml2obj] Remove --format option in favor of YAML tagsChris Bieneman2016-06-276-83/+55
| | | | | | | | | | | | | | | | | | | | | | Summary: Our YAML library's handling of tags isn't perfect, but it is good enough to get rid of the need for the --format argument to yaml2obj. This patch does exactly that. Instead of requiring --format, it infers the format based on the tags found in the object file. The supported tags are: !ELF !COFF !mach-o !fat-mach-o I have a corresponding patch that is quite large that fixes up all the in-tree test cases. Reviewers: rafael, Bigcheese, compnerd, silvas Subscribers: compnerd, llvm-commits Differential Revision: http://reviews.llvm.org/D21711 llvm-svn: 273915
* [Object, COFF] An import data directory might not consist soley of importsDavid Majnemer2016-06-261-10/+16
| | | | | | | | | | | | | The last import is the penultimate entry, the last entry is nulled out. Data beyond the null entry should not be considered to hold import entries. This fixes PR28302. N.B. I am working on a reduced testcase, the one in PR28302 is too large. llvm-svn: 273790
* [llvm-cov] Simplify the way expansion views are rendered (NFC)Vedant Kumar2016-06-264-35/+38
| | | | | | | | | If a sub-view has already been rendered, it's helpful to re-render the expansion site before rendering the next expansion view. Make this fact explicit in the rendering interface, instead of hiding it behind an awkward Optional<LineRef> parameter. llvm-svn: 273789
* [llvm-cov] Make an API more consistent, NFCVedant Kumar2016-06-254-12/+14
| | | | | | | Make renderExpansionView() look a bit more like renderLine(), and clarify its doxygen comment. llvm-svn: 273773
* [llvm-cov] Flesh out some doxygen comments, NFCVedant Kumar2016-06-254-16/+20
| | | | llvm-svn: 273772
* Try to fix the MSVC buildVedant Kumar2016-06-251-2/+2
| | | | | | | | | There's some kind of issue with using "constexpr unsigned" in an anonymous namespace. http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/13395 llvm-svn: 273770
* [llvm-cov] Separate presentation logic from formatting logic, NFCVedant Kumar2016-06-256-201/+363
| | | | | | | | | | This makes it easier to add renderers for new kinds of output formats. - Define and document a pure-virtual coverage rendering interface. - Move the text-based rendering logic into its a new file. - Re-work the API to better reflect the presentation/formatting split. llvm-svn: 273767
* [obj2yaml] [yaml2obj] Support for MachO Universal binariesChris Bieneman2016-06-244-10/+144
| | | | | | This patch adds round-trip support for MachO Universal binaries to obj2yaml and yaml2obj. Universal binaries have a header and list of architecture structures, followed by a the individual object files at specified offsets. llvm-svn: 273719
* [PM] Port PreISelIntrinsicLowering to the new PMMichael Kuperstein2016-06-241-1/+1
| | | | llvm-svn: 273713
* Thread Expected<...> up from libObject’s getSymbolAddress() for symbols to ↵Kevin Enderby2016-06-248-31/+59
| | | | | | | | | | | | | | | | | | | | | allow a good error message to be produced. This is nearly the last libObject interface that used ErrorOr and the last one that appears in llvm/include/llvm/Object/MachO.h . For Mach-O objects this is just a clean up because it’s version of getSymbolAddress() can’t return an error. I will leave it to the experts on COFF and ELF to actually add meaning full error messages in their tests if they wish. And also leave it to these experts to change the last two ErrorOr interfaces in llvm/include/llvm/Object/ObjectFile.h for createCOFFObjectFile() and createELFObjectFile() if they wish. Since there are no test cases for COFF and ELF error cases with respect to getSymbolAddress() in the test suite this is no functional change (NFC). llvm-svn: 273701
* [llvm-cov] Fix two warningsVedant Kumar2016-06-241-5/+5
| | | | | | | | | They were using output streams inconsistently. One also had a grammar bug. I noticed these while trying to pare down D18278. llvm-svn: 273642
* [llvm-cov] Use getOptions() instead of Options in SourceCoverageView, NFCVedant Kumar2016-06-241-14/+16
| | | | | | | A lot of this code is going to move into the text-based coverage renderer, and won't be able to use Options directly. Use the getter. llvm-svn: 273635
* [llvm-cov] Add SourceNames to SourceCoverageViews, NFCVedant Kumar2016-06-243-16/+37
| | | | | | | | | | | | | A SourceName can be a file or a function. It makes sense to attach this information to a SourceCoverageView, seeing as views (1) already point to the text corresponding to the relevant source code and (2) are already used to render that text along with the SourceNames. This is a nice cleanup which is independent of the upcoming html patch. While we're at it, document the fields in SourceCoverageView. llvm-svn: 273634
* [llvm-cov] Rename SourceCoverageView::LineCoverageInfo to LineCoverageStats, NFCVedant Kumar2016-06-242-25/+25
| | | | | | | | | | | | Pull LineCoverageInfo out of SourceCoverageView and rename it so that it doesn't conflict with another class of the same name in CoverageSummaryInfo.h. This cuts down on the amount of code we have to move into a `protected` section of SourceCoverageView for the upcoming html patch. It also makes the code a bit clearer: having two LineCoverageInfo's is strange. llvm-svn: 273633
* [yaml2macho] Removing asserts in favor of explicit yaml parse errorChris Bieneman2016-06-231-4/+0
| | | | | | | | | | | | 32-bit Mach headers don't have reserved fields. When generating the mapping for 32-bit headers leaving off the reserved field will result in parse errors if the field is present in the yaml. Added a CHECK-NOT line to ensure that mach_header.yaml isn't adding a reserved field, and a test to ensure that the parser error gets hit with 32-bit headers. llvm-svn: 273623
* NFC, add an "end namespace" comment for consistencyVedant Kumar2016-06-231-1/+2
| | | | llvm-svn: 273577
* [llc] Remove exit-on-error flag (PR27759)Diana Picus2016-06-231-12/+4
| | | | | | | | | | | | | This flag was introduced in r269655 with the new diagnostic handler for llc. Its purpose was to keep the old behavior for some of the tests that didn't recover well after an error. Those tests have been fixed, so now it's safe to remove the flag entirely. Fixes PR27759. Differential Revision: http://reviews.llvm.org/D21368 llvm-svn: 273554
* Change that to include MCMachObjectWriter.hReid Kleckner2016-06-221-1/+1
| | | | llvm-svn: 273511
* Add one more missing MCObjectWriter.h includeReid Kleckner2016-06-221-0/+1
| | | | llvm-svn: 273510
* llvm-ar: reduce some duplication, NFCSaleem Abdulrasool2016-06-221-27/+19
| | | | | | | Improve the previous change by using a local function to reduce the duplication of the object file scanning. NFC. llvm-svn: 273429
* [llvm-readobj] - Teach llvm-readobj to print dependencies of SHT_GNU_verdef ↵George Rimar2016-06-221-18/+26
| | | | | | | | | | | | | | | and refactor dumping method. This patch changes single method of llvm-readobj. It teaches SHT_GNU_verdef dumper to print version dependencies, also it removes few fields from output that can be dumped with other keys and slightly refactors code. Testcase was also modified to match the changes. Change is required for testcases of upcoming lld patches. Differential revision: http://reviews.llvm.org/D21552 llvm-svn: 273417
* llvm-ar: be more clever about default formatSaleem Abdulrasool2016-06-221-18/+76
| | | | | | | | | | | | Try to be more clever about selecting the default format. When an existing archive is used, use the type of the archive to determine the format. When existing members are present, use the first member's format to determine the format to use. If we are creating an empty archive (MRI mode) or are adding non-object members, default to the current behaviour of using the host type due to the lack of a better alternative. This aids in cross-compilation on Darwin to non-Darwin platforms which rely on GNU format archives. llvm-svn: 273373
* IR: Allow metadata attachments on declarations, and fix lazy loaded metadata ↵Peter Collingbourne2016-06-211-18/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | issue with globals. This change is motivated by an upcoming change to the metadata representation used for CFI. The indirect function call checker needs type information for external function declarations in order to correctly generate jump table entries for such declarations. We currently associate such type information with declarations using a global metadata node, but I plan [1] to move all such metadata to global object attachments. In bitcode, metadata attachments for function declarations appear in the global metadata block. This seems reasonable to me because I expect metadata attachments on declarations to be uncommon. In the long term I'd also expect this to be the case for CFI, because we'd want to use some specialized bitcode format for this metadata that could be read as part of the ThinLTO thin-link phase, which would mean that it would not appear in the global metadata block. To solve the lazy loaded metadata issue I was seeing with D20147, I use the same bitcode representation for metadata attachments for global variables as I do for function declarations. Since there's a use case for metadata attachments in the global metadata block, we might as well use that representation for global variables as well, at least until we have a mechanism for lazy loading global variables. In the assembly format, the metadata attachments appear after the "declare" keyword in order to avoid a parsing ambiguity. [1] http://lists.llvm.org/pipermail/llvm-dev/2016-June/100462.html Differential Revision: http://reviews.llvm.org/D21052 llvm-svn: 273336
* Update llvm-obdump(1) to print FAT_MAGIC_64 for Darwin’s 64-bit universal ↵Kevin Enderby2016-06-211-3/+6
| | | | | | | | | | | | | files with the -macho and -universal-headers flags. Just a follow on to r273207, I missed updating the printing of the fat magic number when the universal file is a 64-bit universal file. rdar://26899493 llvm-svn: 273324
* Delete some dead code.Rafael Espindola2016-06-211-16/+0
| | | | | | Found by gcc 6. llvm-svn: 273303
* [build] Make sure to link main executable with pthreadsArtem Belevich2016-06-211-1/+7
| | | | | | | | | | Otherwise it gets linked in by one of the dependencies of shared libraries which may be too late and we end up with weird crashes in std::call_once(). Differential Revision: http://reviews.llvm.org/D21478 llvm-svn: 273302
* llvm-ar: correct typoSaleem Abdulrasool2016-06-211-1/+1
| | | | | | Default was misspelt. NFC. llvm-svn: 273287
* Apply another batch of fixes from clang-tidy's ↵Benjamin Kramer2016-06-172-20/+23
| | | | | | | | performance-unnecessary-value-param. Contains some manual fixes. No functionality change intended. llvm-svn: 273047
* [pdb] Don't error on missing FPO streamsReid Kleckner2016-06-171-35/+48
| | | | | | | | 64-bit PDBs never have FPO data. They have xdata instead. Also improve error recovery of stream summary dumping while I'm here. llvm-svn: 273046
* Don't use the new x86 relax relocations on the gold plugin.Rafael Espindola2016-06-171-0/+4
| | | | | | Should bring back the bots with old versions. llvm-svn: 273022
* Change the default of -relax-relocations.Rafael Espindola2016-06-171-3/+3
| | | | | | | | | | llvm-mc is a developer tool, as such it make sense for it to use new features by default. This doesn't change the user facing clang, which still defaults to non relaxable relocations. llvm-svn: 273014
* Resubmit "[pdb] Change type visitor pattern to be dynamic."Zachary Turner2016-06-162-8/+12
| | | | | | | There was a regression introduced during type stream merging when visiting a field list record. This has been fixed in this patch. llvm-svn: 272929
* Revert "[pdb] Change type visitor pattern to be dynamic."Zachary Turner2016-06-162-10/+6
| | | | | | | | This reverts commit fb0dd311e1ad945827b8ffd5354f4810e2be1579. This breaks some llvm-readobj tests. llvm-svn: 272927
* [pdb] Change type visitor pattern to be dynamic.Zachary Turner2016-06-162-6/+10
| | | | | | | | | | | | | | | This allows better catching of compiler errors since we can use the override keyword to verify that methods are actually overridden. Also in this patch I've changed from storing a boolean Error code everywhere to returning an llvm::Error, to propagate richer error information up the call stack. Reviewed By: ruiu, rnk Differential Revision: http://reviews.llvm.org/D21410 llvm-svn: 272926
* [llvm-objdump] Support detection of feature bits from the object and ↵Daniel Sanders2016-06-161-4/+2
| | | | | | | | | | | | | | | | | | | | implement this for Mips. Summary: The Mips implementation only covers the feature bits described by the ELF e_flags so far. Mips stores additional feature bits such as MSA in the .MIPS.abiflags section. Also fixed a small bug this revealed where microMIPS wouldn't add the EF_MIPS_MICROMIPS flag when using -filetype=obj. Reviewers: echristo, rafael Subscribers: rafael, mehdi_amini, dsanders, sdardis, llvm-commits Differential Revision: http://reviews.llvm.org/D21125 llvm-svn: 272880
* [Bugpoint] Erase comdat annotations after removing a global's initializer.Justin Lebar2016-06-152-0/+4
| | | | | | | | | | | | | | | Summary: This is necessary to keep the verifier happy after bugpoint removes an initializer from a global variable with a comdat annotation, because globals without initializers may not have comdats. Reviewers: majnemer, rnk Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D21274 llvm-svn: 272854
OpenPOWER on IntegriCloud