summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
Commit message (Collapse)AuthorAgeFilesLines
* Fix llvm-size to exit with non zero when it can’t open a file.Kevin Enderby2016-05-021-1/+1
| | | | | | rdar://26027819 llvm-svn: 268313
* [dsymutil] Create the temporary files in the system temp directory.Frederic Riss2016-05-021-3/+1
| | | | | | | | | | llvm-dsymutil used to create the temporary files in the output directory. This works fine except when the output directory contains a '%' char, which is then replaced by llvm::sys::fs::createUniqueFile() generating an invalid path. Just use the default temp dir for those files. llvm-svn: 268304
* [llvm-readobj] Dump hash as part of -version-info.Davide Italiano2016-05-021-0/+3
| | | | llvm-svn: 268210
* [llvm-cov] Don't emit 'nan%' in reportsVedant Kumar2016-04-291-2/+4
| | | | llvm-svn: 267971
* Fix a bug in llvm-objdump for -private-headers printing the ↵Kevin Enderby2016-04-282-0/+7
| | | | | | | | LC_CODE_SIGNATURE Mach-O load command. rdar://25985653 llvm-svn: 267940
* Update llvm-objdump for disassembly of ARM Mach-O files to always include ↵Kevin Enderby2016-04-281-4/+4
| | | | | | | | | | the opcode bytes. As this is the expected behavior of the old darwin otool(1) for ARM Mach-O files. rdar://25896249 llvm-svn: 267929
* Fix bugs in llvm-objdump printing the last word for -section in non i386 and ↵Kevin Enderby2016-04-272-1/+5
| | | | | | | | | | | x86 files. Two problems, 1) for the last 4 bytes it would print them as separate bytes not a word and 2) it would print the same last byte for those bytes less than a word. rdar://25938224 llvm-svn: 267819
* Fix a bug in llvm-objdump printing of 32-bit addresses for -section in non ↵Kevin Enderby2016-04-272-0/+4
| | | | | | | | i386 and x86 files. rdar://25896202 llvm-svn: 267807
* Add a test case for the crash fixed with r267037. David Blaikie said it ↵Kevin Enderby2016-04-272-0/+3
| | | | | | | | | would be nice to have! This was crashing llvm-objdump with -macho -objc-meta-data when trying dump a non-existent section. So the test binary is simply created from an empty .s file compiled with: clang -arch armv7 empty.s -c llvm-svn: 267782
* [PDB] Fix function names for private symbols in PDBsReid Kleckner2016-04-274-14/+22
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: llvm-symbolizer wants to get linkage names of functions for historical reasons. Linkage names are only recorded in the PDB for public symbols, and the linkage name is apparently stored separately in some "public symbol" record. We had a workaround in PDBContext which would look for such symbols when the user requested linkage names. However, when given an address that was truly in a private function and public funciton, we would accidentally find nearby public symbols and return those function names. The fix is to look for both function symbols and public symbols and only prefer the public symbol name if the addresses of the symbols agree. Fixes PR27492 Reviewers: zturner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19571 llvm-svn: 267732
* Remove size 1 from check as that isn't part of what the test is meant to be ↵Kristof Beyls2016-04-271-1/+1
| | | | | | | | | | | | | testing. This test also runs on e.g. ARM-native builds when the X86 backend is also built. This test produces code for the default instruction set, even though it is in a "X86" sub-directory. Given that this test doesn't seem to be testing anything architecture-specific, it seems it's best to adapt the check to not check for an architecture-dependent value (the size of the function), rather than hard-code the test to target x86. llvm-svn: 267722
* [ThinLTO] Use valueid instead of bitcode offsets in combined index fileTeresa Johnson2016-04-272-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: With the removal of support for lazy parsing of combined index summary records (e.g. r267344), we no longer need to include the summary record bitcode offset in the VST entries for definitions. Change the combined index format to be similar to the per-module index format in using value ids to cross-reference from the summary record to the VST entry (rather than the summary record bitcode offset to cross-reference in the other direction). The visible changes are: 1) Add the value id to the combined summary records 2) Remove the summary offset from the combined VST records, which has the following effects: - No longer need the VST_CODE_COMBINED_GVDEFENTRY record, as all combined index VST entries now only contain the value id and corresponding GUID. - No longer have duplicate VST entries in the case where there are multiple definitions of a symbol (e.g. weak/linkonce), as they all have the same value id and GUID. An implication of #2 above is that in order to hook up an alias to the correct aliasee based on the value id of the aliasee recorded in the combined index alias record, we need to scan the entries in the index for that GUID to find the one from the same module (i.e. the case where there are multiple entries for the aliasee). But the reader no longer has to maintain a special map to hook up the alias/aliasee. Reviewers: joker.eph Subscribers: joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D19481 llvm-svn: 267712
* LTOCodeGenerator: turns linkonce(_odr) into weak_(odr) when present ↵Mehdi Amini2016-04-271-3/+5
| | | | | | | | | | | | | | | | | "MustPreserve" set Summary: If the linker requested to preserve a linkonce function, we should honor this even if we drop all uses. Reviewers: dexonsmith Subscribers: llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D19527 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 267644
* [gold] Fix linkInModule and extend common.ll test.Evgeniy Stepanov2016-04-254-9/+29
| | | | | | | | | | Fix early exit from linkInModule. IRMover::move returns false on success and true on error. Add a few more cases of merged common linkage variables with different sizes and alignments. llvm-svn: 267437
* dsymutil: Only warn about clang module DWO id mismatches in verbose mode.Adrian Prantl2016-04-251-1/+1
| | | | | | | | | | Until PR27449 (https://llvm.org/bugs/show_bug.cgi?id=27449) is fixed in clang this warning is pointless, since ASTFileSignatures will change randomly when a module is rebuilt. rdar://problem/25610919 llvm-svn: 267427
* [Coverage] Restore the correct count value after processing a nested region ↵Igor Kudrin2016-04-251-2/+2
| | | | | | | | | | | | | in case of combined regions. If several regions cover the same area of code, we have to restore the combined value for that area when return from a nested region. This patch achieves that by combining regions before calling buildSegments. Differential Revision: http://reviews.llvm.org/D18610 llvm-svn: 267390
* Also check the IR.Rafael Espindola2016-04-241-0/+4
| | | | llvm-svn: 267367
* Add a test for how we handle protected visibility.Rafael Espindola2016-04-242-0/+22
| | | | llvm-svn: 267366
* llvm/test/tools/gold/X86/thinlto.ll: Possible fix corresponding to r267318.NAKAMURA Takumi2016-04-241-0/+1
| | | | llvm-svn: 267334
* Add a version field in the bitcode for the summaryMehdi Amini2016-04-241-0/+1
| | | | | | | Differential Revision: http://reviews.llvm.org/D19456 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 267318
* [gold] Gate value name discarding under save-tempsTeresa Johnson2016-04-233-10/+6
| | | | | | | | | | | | | | Summary: This removes a couple of flags added to control this behavior, and simply keeps all value names when save-temps is specified. Reviewers: rafael Subscribers: llvm-commits, pcc, davide Differential Revision: http://reviews.llvm.org/D19384 llvm-svn: 267279
* llvm-objdump: deal with invalid ARM encodings slightly better.Tim Northover2016-04-222-2/+10
| | | | | | | | | | | | | | Before we printed a warning to stderr and left the actual output stream in a mess. This tries to print a .long or .short representation of what we saw (as if there was a data-in-code directive). This isn't guaranteed to restore synchronization in Thumb-mode (if the invalid instruction was supposed to be 32-bits, we may be off-by-16 for the rest of the function). But there's no certain way to deal with that, and it's invalid code anyway (if the data really wasn't an instruction, the user can add proper .data_in_code directives if they care) llvm-svn: 267250
* MachO: remove weird ARM/Thumb interface from MachOObjectFileTim Northover2016-04-224-5/+15
| | | | | | | | | | | | | | | | Only one consumer (llvm-objdump) actually cared about the fact that there were two triples. Others were actively working around the fact that the Triple returned by getArch might have been invalid. As for llvm-objdump, it needs to be acutely aware of both Triples anyway, so being generic in the exposed API is no benefit. Also rename the version of getArch returning a Triple. Users were having to pass an unwanted nullptr to disambiguate the two, which was nasty. The only functional change here is that armv7m and armv7em object files no longer crash llvm-objdump. llvm-svn: 267249
* [sancov] using normalized filenames for blacklist checks.Mike Aizatsky2016-04-2110-29/+28
| | | | | | Differential Revision: http://reviews.llvm.org/D19395 llvm-svn: 267078
* Re-enable "[gold-plugin] Disable name for values other than GlobalValue"Teresa Johnson2016-04-203-0/+38
| | | | | | | | | | This restores r266871 with a fix for gold tests relying on the value names, when using a release compiler, by adding a way to disable the default discarding. Update affected tests to use the new mechanism so that value names are preserved as expected, regardless of how the compiler was built. llvm-svn: 266881
* Revert "[gold-plugin] Disable name for values other than GlobalValue"Teresa Johnson2016-04-201-35/+0
| | | | | | | | This reverts commit r266871. Setting the default based on the NDEBUG flag is causing test failures. Need to figure out whether to change this approach or update tests. llvm-svn: 266872
* [gold-plugin] Disable name for values other than GlobalValueTeresa Johnson2016-04-201-0/+35
| | | | | | | | | | | | | | | Summary: Applies Mehdi's optimization (r263086) to disable value names other than for GlobalValues to LTO/ThinLTO performed via the gold-plugin, in the same manner as it is applied in libLTO. Reviewers: rafael, joker-eph Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19269 llvm-svn: 266871
* [LLVM] Remove unwanted --check-prefix=CHECK from unit tests. NFC.Mandeep Singh Grang2016-04-193-3/+3
| | | | | | | | | | | | Summary: Removed unwanted --check-prefix=CHECK from numerous unit tests. Reviewers: t.p.northover, dblaikie, uweigand, MatzeB, tstellarAMD, mcrosier Subscribers: mcrosier, dsanders Differential Revision: http://reviews.llvm.org/D19279 llvm-svn: 266834
* Fix Gold test after r266750 (ModuleLinker: Do not import linkonce/weak as ↵Mehdi Amini2016-04-192-2/+2
| | | | | | | "external_weak") From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266752
* Reapply "[Coverage] Prevent detection of false instantiations in case of ↵Igor Kudrin2016-04-185-1/+52
| | | | | | | | | | | | | | | | | | macro expansion." The root of the problem was that findMainViewFileID(File, Function) could return some ID for any given file, even though that file was not the main file for that function. This patch ensures that the result of this function is conformed with the result of findMainViewFileID(Function). This commit reapplies r266436, which was reverted by r266458, with the .covmapping file serialized in v1 format. Differential Revision: http://reviews.llvm.org/D18787 llvm-svn: 266620
* Revert "[Coverage] Prevent detection of false instantiations in case of ↵Igor Kudrin2016-04-155-52/+1
| | | | | | | | macro expansion." This reverts commit r266436 as it broke buildbot. llvm-svn: 266458
* [PR27284] Reverse the ownership between DICompileUnit and DISubprogram.Adrian Prantl2016-04-154-14/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently each Function points to a DISubprogram and DISubprogram has a scope field. For member functions the scope is a DICompositeType. DIScopes point to the DICompileUnit to facilitate type uniquing. Distinct DISubprograms (with isDefinition: true) are not part of the type hierarchy and cannot be uniqued. This change removes the subprograms list from DICompileUnit and instead adds a pointer to the owning compile unit to distinct DISubprograms. This would make it easy for ThinLTO to strip unneeded DISubprograms and their transitively referenced debug info. Motivation ---------- Materializing DISubprograms is currently the most expensive operation when doing a ThinLTO build of clang. We want the DISubprogram to be stored in a separate Bitcode block (or the same block as the function body) so we can avoid having to expensively deserialize all DISubprograms together with the global metadata. If a function has been inlined into another subprogram we need to store a reference the block containing the inlined subprogram. Attached to https://llvm.org/bugs/show_bug.cgi?id=27284 is a python script that updates LLVM IR testcases to the new format. http://reviews.llvm.org/D19034 <rdar://problem/25256815> llvm-svn: 266446
* [Coverage] Prevent detection of false instantiations in case of macro expansion.Igor Kudrin2016-04-155-1/+52
| | | | | | | | | | | | | The root of the problem was that findMainViewFileID(File, Function) could return some ID for any given file, even though that file was not the main file for that function. This patch ensures that the result of this function is conformed with the result of findMainViewFileID(Function). Differential Revision: http://reviews.llvm.org/D18787 llvm-svn: 266436
* Move summary creation out of llvm-as into optMehdi Amini2016-04-124-7/+7
| | | | | | | | | | | | | | | | | | Summary: Let keep llvm-as "dumb": it converts textual IR to bitcode. This commit removes the dependency from llvm-as to libLLVMAnalysis. We'll add back summary in llvm-as if we get to a textual representation for it at some point. In the meantime, opt seems like a better place for that. Reviewers: tejohnson Subscribers: joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D19032 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266131
* [llvm-readobj] Add ELF hash histogram printingHemant Kulkarni2016-04-111-0/+27
| | | | | | Differential Revision: http://reviews.llvm.org/D18907 llvm-svn: 265967
* Revert r265817Colin LeMahieu2016-04-0810-29/+29
| | | | | | lld tests need to be addressed. llvm-svn: 265822
* [llvm-objdump] Printing hex instead of dec by defaultColin LeMahieu2016-04-0810-29/+29
| | | | | | Differential Revision: http://reviews.llvm.org/D18770 llvm-svn: 265817
* Thread Expected<...> up from createMachOObjectFile() to allow llvm-objdump ↵Kevin Enderby2016-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to produce a real error message Produce the first specific error message for a malformed Mach-O file describing the problem instead of the generic message for object_error::parse_failed of "Invalid data was encountered while parsing the file”.  Many more good error messages will follow after this first one. This is built on Lang Hames’ great work of adding the ’Error' class for structured error handling and threading Error through MachOObjectFile construction. And making createMachOObjectFile return Expected<...> . So to to get the error to the llvm-obdump tool, I changed the stack of these methods to also return Expected<...> : object::ObjectFile::createObjectFile() object::SymbolicFile::createSymbolicFile() object::createBinary() Then finally in ParseInputMachO() in MachODump.cpp the error can be reported and the specific error message can be printed in llvm-objdump and can be seen in the existing test case for the existing malformed binary but with the updated error message. Converting these interfaces to Expected<> from ErrorOr<> does involve touching a number of places. To contain the changes for now use of errorToErrorCode() and errorOrToExpected() are used where the callers are yet to be converted. Also there some were bugs in the existing code that did not deal with the old ErrorOr<> return values. So now with Expected<> since they must be checked and the error handled, I added a TODO and a comment: “// TODO: Actually report errors helpfully” and a call something like consumeError(ObjOrErr.takeError()) so the buggy code will not crash since needed to deal with the Error. Note there is one fix also needed to lld/COFF/InputFiles.cpp that goes along with this that I will commit right after this. So expect lld not to built after this commit and before the next one. llvm-svn: 265606
* [gold] Save bitcode for module partitions (save-temps + split codegen).Evgeniy Stepanov2016-04-061-0/+6
| | | | llvm-svn: 265583
* llvm-dwp: Handle GCC's use of multiple debug_types.dwo sections in a single ↵David Blaikie2016-04-051-0/+9
| | | | | | | | .dwo file (also includes the .test file missing from my previous commit, r265452) llvm-svn: 265457
* llvm-dwp: Handle dwo files produced by GCCDavid Blaikie2016-04-051-0/+0
| | | | | | | To start with, handle DW_FORM_string names. Follow up commit will handle the interesting quirk with type units I was originally aiming for here. llvm-svn: 265452
* testcase gardening: update the emissionKind enum to the new syntax. (NFC)Adrian Prantl2016-04-015-5/+5
| | | | llvm-svn: 265081
* Preserve blockaddress use edges in the module splitter.Evgeniy Stepanov2016-03-311-0/+37
| | | | | | | | "blockaddress" can not apply to an external function. All blockaddress constant uses must belong to the same module as the definition of the target function. llvm-svn: 265061
* Preserve extern_weak linkage in CloneModule.Evgeniy Stepanov2016-03-311-0/+12
| | | | | | | Only force "extern" linkage if the function used to be a definition in the source module. Declarations keep their original linkage. llvm-svn: 265043
* Fix some bugs in the posix output of llvm-nm. Which is documented onKevin Enderby2016-03-294-5/+10
| | | | | | | | | | | | | | http://pubs.opengroup.org/onlinepubs/9699919799/utilities/nm.html . 1) For Mach-O files the code was not printing the values in hex as is the default. 2) The values printed had leading zeros which they should not have. 3) The address for undefined symbols was printed as spaces instead of 0. 4) With the -A option with posix output for an archive did not use square brackets around the archive member name. rdar://25311883 and rdar://25299678 llvm-svn: 264778
* [Coverage] Fix the expected counts in instrprof-comdat.hVedant Kumar2016-03-281-6/+3
| | | | llvm-svn: 264675
* Remove personality for declarations in CloneModule.Evgeniy Stepanov2016-03-281-0/+18
| | | | | | | | | | Personality is copied as part of copyFunctionAttributes, but it is invalid on a declaration. Remove the personality attribute it the function body is not cloned. Also add a verifier run over output modules in the llvm-split tool. llvm-svn: 264667
* Reapply (2x) "[PGO] Fix name encoding for ObjC-like functions"Vedant Kumar2016-03-289-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | Function names in ObjC can have spaces in them. This interacts poorly with name compression, which uses spaces to separate PGO names. Fix the issue by using a different separator and update a test. I chose "\01" as the separator because 1) it's non-printable, 2) we strip it from PGO names, and 3) it's the next natural choice once "\00" is discarded (that one's overloaded). What's changed since the original commit? - I fixed up the covmap-V2 binary format tests using a linux VM. - I weakened the CHECK lines in instrprof-comdat.h to account for the fact that there have been bugfixes to clang coverage. These will be fixed up in a follow-up. - I added an assert to make sure we don't get bitten by this again. - I constructed the c-general.profraw file without name compression enabled to appease some bots. Differential Revision: http://reviews.llvm.org/D18516 llvm-svn: 264658
* Revert "Reapply "[PGO] Fix name encoding for ObjC-like functions""Vedant Kumar2016-03-289-12/+7
| | | | | | | This reverts commit r264641 to investigate why c-general.test is failing on the bots. llvm-svn: 264643
* Reapply "[PGO] Fix name encoding for ObjC-like functions"Vedant Kumar2016-03-289-7/+12
| | | | | | | | | | | | | | | | | | | | | Function names in ObjC can have spaces in them. This interacts poorly with name compression, which uses spaces to separate PGO names. Fix the issue by using a different separator and update a test. I chose "\01" as the separator because 1) it's non-printable, 2) we strip it from PGO names, and 3) it's the next natural choice once "\00" is discarded (that one's overloaded). This reverts the revert commit beaf3d18. What's changed? - I fixed up the covmap-V2 binary format tests using a linux VM. - I updated the expected counts in instrprof-comdat.h to account for the fact that there have been bugfixes to clang coverage. - I added an assert to make sure we don't get bitten by this again. Differential Revision: http://reviews.llvm.org/D18516 llvm-svn: 264641
OpenPOWER on IntegriCloud