summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [PDB] Split item and type records when merging type streamsReid Kleckner2017-03-241-4/+52
| | | | | | | | | | | | Summary: MSVC does this when producing a PDB. Reviewers: ruiu Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31316 llvm-svn: 298717
* [ThinLTO] Add support for emitting minimized bitcode for thin linkTeresa Johnson2017-03-231-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The cumulative size of the bitcode files for a very large application can be huge, particularly with -g. In a distributed build environment, all of these files must be sent to the remote build node that performs the thin link step, and this can exceed size limits. The thin link actually only needs the summary along with a bitcode symbol table. Until we have a proper bitcode symbol table, simply stripping the debug metadata results in significant size reduction. Add support for an option to additionally emit minimized bitcode modules, just for use in the thin link step, which for now just strips all debug metadata. I plan to add a cc1 option so this can be invoked easily during the compile step. However, care must be taken to ensure that these minimized thin link bitcode files produce the same index as with the original bitcode files, as these original bitcode files will be used in the backends. Specifically: 1) The module hash used for caching is typically produced by hashing the written bitcode, and we want to include the hash that would correspond to the original bitcode file. This is because we want to ensure that changes in the stripped portions affect caching. Added plumbing to emit the same module hash in the minimized thin link bitcode file. 2) The module paths in the index are constructed from the module ID of each thin linked bitcode, and typically is automatically generated from the input file path. This is the path used for finding the modules to import from, and obviously we need this to point to the original bitcode files. Added gold-plugin support to take a suffix replacement during the thin link that is used to override the identifier on the MemoryBufferRef constructed from the loaded thin link bitcode file. The assumption is that the build system can specify that the minimized bitcode file has a name that is similar but uses a different suffix (e.g. out.thinlink.bc instead of out.o). Added various tests to ensure that we get identical index files out of the thin link step. Reviewers: mehdi_amini, pcc Subscribers: Prazek, llvm-commits Differential Revision: https://reviews.llvm.org/D31027 llvm-svn: 298638
* c++filt: support COFF import thunksSaleem Abdulrasool2017-03-221-0/+5
| | | | | | | The synthetic thunk for the import is prefixed with __imp_. Attempt to undecorate the names when they begin with the __imp_ prefix. llvm-svn: 298550
* Add the rest of the error checking for Mach-O dyld compact bind entry errorsKevin Enderby2017-03-2019-2/+52
| | | | | | | | | | | | | | | | | | | | | | | | | and test cases for each of the error checks. To do this more plumbing was needed so that the segment indexes and segment offsets can be checked. Basically what was done was the SegInfo from llvm-objdump’s MachODump.cpp was moved into libObject for Mach-O objects as BindRebaseSegInfo and it is only created when an iterator for bind or rebase entries are created. This commit really only adds the error checking and test cases for the bind table entires and the checking for the lazy bind and weak bind entries are still to be fully done as well as the rebase entires. Though some of the plumbing for those are added with this commit. Those other error checks and test cases will be added in follow on commits. Note, the two llvm_unreachable() calls should now actually be unreachable with the error checks in place and would take a logic bug in the error checking code to be reached if the segment indexes and segment offsets are used from a checked bind entry. Comments have been added to the methods that require the arguments to have been checked prior to calling. llvm-svn: 298292
* [PGO] Add omitted test cases.Rong Xu2017-03-171-0/+123
| | | | llvm-svn: 298115
* [llvm-config] Add minimal sanity tests for path optionsMichal Gorny2017-03-151-0/+21
| | | | | | | | | | Add minimal tests that check whether path options do not fail and output directories looking like expected. Requested in https://reviews.llvm.org/rL291218. Differential Revision: https://reviews.llvm.org/D28533 llvm-svn: 297807
* [PGO] Refactor profile dumping function for ease of adding other profile kindRong Xu2017-03-091-8/+8
| | | | | | | | Refactor the dumping function so that we can add other value profile kind easily. Differential Revision: https://reviews.llvm.org/D30752 llvm-svn: 297399
* Fix source-lines test on Windows.Zachary Turner2017-03-071-7/+7
| | | | llvm-svn: 297233
* llvm-objdump: handle line numbers and source options for amdgpu objectsKonstantin Zhuravlyov2017-03-073-0/+117
| | | | | | Differential Revision: https://reviews.llvm.org/D30679 llvm-svn: 297193
* Fix test and add missing return for llvm-lto2 error caseTeresa Johnson2017-03-071-0/+1
| | | | | | | | | | | | | | | | | Summary: This test was missing the target triple. Once I fixed that, the case with the invalid character error stopped returning 1 from llvm-lto2 and the test reported a failure. Fixed by adding the missing return from llvm-lto2. Apparently we were failing when we eventually tried to get the target. Reviewers: pcc Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D30585 llvm-svn: 297173
* [PGO] Text format profile reader needs to clear the value profileRong Xu2017-03-031-0/+9
| | | | | | | | | | | | | | | | Summary: Reset the ValueData for each function to avoid using the ones in the previous function. Reviewers: davidxl Reviewed By: davidxl Subscribers: llvm-commits, xur Differential Revision: https://reviews.llvm.org/D30479 llvm-svn: 296916
* [sancov] better input parameters validationMike Aizatsky2017-03-032-1/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D30370 llvm-svn: 296900
* LTO: When creating a local cache, create the cache directory if it does not ↵Peter Collingbourne2017-03-021-2/+2
| | | | | | | | already exist. Differential Revision: https://reviews.llvm.org/D30519 llvm-svn: 296726
* [mips] Drop unneeded REQUIRES line in test. NFCISimon Dardis2017-03-011-1/+0
| | | | | | rL296111 provides the proper fix. llvm-svn: 296622
* Actually add error handling to unpacking the dyld compact bind andKevin Enderby2017-02-281-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | other tables. Providing a helpful error message to what the error is and where the error occurred based on which opcode it was associated with. There have been handful of bug fixes dealing with bad bind info in object files, r294021 and r249845, which only put a band aid on the problem after a bad bind table was created after unpacking from its compact info. In these cases a bind table should have never been created and an error should have simply been generated. This change puts in place the plumbing to allow checking and returning of an error when the compact info is unpacked. This follows the model of iterators that can fail that Lang Hanes designed when fixing the problem for bad archives r275316 (or r275361). This change uses one of the existing test cases that now causes an error instead of printing <<bad library ordinal>> after a bad bind table is created. The error uses the offset into the opcode table as shown with the macOS dyldinfo(1) tool to indicate where the error is and which opcode and which parameter is in error. For example the exiting test case has this lazy binding opcode table: % dyldinfo -opcodes test/tools/llvm-objdump/Inputs/bad-ordinal.macho-x86_64 … lazy binding opcodes: 0x0000 BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB(0x02, 0x00000010) 0x0002 BIND_OPCODE_SET_DYLIB_ORDINAL_IMM(2) In the test case the binary only has one library so setting the library ordinal to the value of 2 in the BIND_OPCODE_SET_DYLIB_ORDINAL_IMM opcode at 0x0002 above is an error. This now produces this error message: % llvm-objdump -lazy-bind bad-ordinal.macho-x86_64 … llvm-objdump: 'bad-ordinal.macho-x86_64': truncated or malformed object (for BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB bad library ordinal: 2 (max 1) for opcode at: 0x2) This change provides the plumbing for the error handling and one example of an error message. Other error checks and test cases will be added in follow on commits. llvm-svn: 296527
* [llvm-cov] Error-out when an unsupported format is used (PR32087)Vedant Kumar2017-02-281-0/+2
| | | | llvm-svn: 296487
* [XRAY] A Color Choosing helper for XRay GraphDean Michael Berris2017-02-251-16/+16
| | | | | | | | | | | | | | | | | | | Summary: In Preparation for graph comparison, this patch breaks out the color choice code from xray-graph into a library and adds polynomials for the Sequential and Difference sets from ColorBrewer. Depends on D29005 Reviewers: dblaikie, chandlerc, dberris Reviewed By: dberris Subscribers: chandlerc, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D29363 llvm-svn: 296210
* [mips][mc] Fix a crash when disassembling odd sized sectionsSimon Dardis2017-02-241-0/+1
| | | | | | Attempt to fix failing test. llvm-svn: 296112
* Fixup r296105 - only run tests on MipsDiana Picus2017-02-241-0/+3
| | | | llvm-svn: 296111
* [mips][mc] Fix a crash when disassembling odd sized sectionsSimon Dardis2017-02-241-0/+16
| | | | | | Corresponding test. llvm-svn: 296106
* [llvm-cov] Strip redundant path components from filenames (fix PR31982)Vedant Kumar2017-02-232-7/+13
| | | | | | | | | Instead of stripping the longest common prefix off of the filenames in a report, strip out the longest chain of redundant path components. This fixes the case in PR31982, where there are two files with the same prefix, and stripping out the LCP makes things less intelligible. llvm-svn: 296029
* [WebAssembly] Update llvm-readobj tests for switch to version 0x1Derek Schuff2017-02-222-1/+1
| | | | llvm-svn: 295875
* [WebAssembly] Update llvm-objdump tests for the new wasm version number.Dan Gohman2017-02-222-1/+1
| | | | llvm-svn: 295869
* [XRAY] [x86_64] Adding a Flight Data filetype reader to the llvm-xray Trace ↵Dean Michael Berris2017-02-172-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | implementation. Summary: The file type packs function trace data onto disk from potentially multiple threads that are aggregated and flushed during the course of an instrumented program's runtime. It is named FDR mode or Flight Data recorder as an analogy to plane blackboxes, which instrument a running system without access to IO. The writer code is defined in compiler-rt in xray_fdr_logging.h/cc Reviewers: rSerge, kcc, dberris Reviewed By: dberris Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29697 llvm-svn: 295397
* Disable wrapping llvm-xray YAML outputDimitry Andric2017-02-1410-104/+52
| | | | | | | | | | | | | | | | | | | | | Summary: The YAML output produced by llvm-xray is supposed to be wrapped at the arbitrary default of 70 columns set by `yaml:Output`. Unfortunately, the wrapping is rather unpredictable, and can easily go past the set number of columns, depending on the execution environment. To make the YAML output environment-independent, disable wrapping instead. Reviewers: dberris Reviewed By: dberris Subscribers: fhahn, llvm-commits Differential Revision: https://reviews.llvm.org/D29962 llvm-svn: 295116
* Yet another fix llvm-objdump so it picks a good CPU based for Mach-O files,Kevin Enderby2017-02-103-1/+4
| | | | | | | | | | | in this case for CPU_SUBTYPE_ARM64_ALL. For this cpusubtype it should default to a cyclone CPU to give proper disassembly without a -mcpu= flag. rdar://27767188 llvm-svn: 294771
* Temporarily revert "For X86-64 linux and PPC64 linux align int128 to 16 bytes."Eric Christopher2017-02-101-1/+1
| | | | | | | | | until we can get better TargetMachine::isCompatibleDataLayout to compare - otherwise we can't code generate existing bitcode without a string equality data layout. This reverts commit r294702. llvm-svn: 294709
* For X86-64 linux and PPC64 linux align int128 to 16 bytes.Eric Christopher2017-02-101-1/+1
| | | | | | | | | | | | For other platforms we should find out what they need and likely make the same change, however, a smaller additional change is easier for platforms we know have it specified in the ABI. As part of this rewrite some of the handling in the backends for data layout and update a bunch of testcases. Based on a patch by Simonas Kazlauskas! llvm-svn: 294702
* [dsymutil] Fix handling of empty CUs in LTO links.Frederic Riss2017-02-091-0/+33
| | | | | | | | | r288399 introduced the DIEUnit class, and in the process broke the corner case where dsymutil generates an empty CU during an LTO link. This restores the logic and adds a test for the corner case. llvm-svn: 294618
* Tweak the implementation of llvm-objdump’s -objc-meta-data option soKevin Enderby2017-02-092-0/+62
| | | | | | | | | that it works when the ObjC metadata sections end up in the __DATA_CONST or __DATA_DIRTY segments. rdar://26315238 llvm-svn: 294599
* Move test from r294430 to target-specific directoryDiana Picus2017-02-082-0/+0
| | | | | | | The test is X86-specific, and it broke on the ARM bots because they don't build the X86 target. llvm-svn: 294446
* Use dynamic symbols for ELF disassemblySam Parker2017-02-082-0/+10
| | | | | | | | | | | Disassembly currently begins from addresses obtained from the objects symbol table. For ELF, add the dynamic symbols to the list if no static symbols are available so that we can more successfully disassemble stripped binaries. Differential Revision: https://reviews.llvm.org/D29632 llvm-svn: 294430
* Fix a bug in llvm-obdump(1) with the -macho and -info-plist optionsKevin Enderby2017-02-061-0/+10
| | | | | | | | | which caused it to print more than the (__TEXT,__info_plist) if that section did not end with a null. rdar://27378808 llvm-svn: 294236
* Get function start line number from DWARF infoDavid Blaikie2017-02-061-0/+3
| | | | | | | | | | | | | | | DWARF info contains info about the line number at which a function starts (DW_AT_decl_line). This patch creates a function to look up the start line number for a function, and returns it in DILineInfo when looking up debug info for a particular address. Patch by Simon Que! Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D27962 llvm-svn: 294231
* Fix a bug in llvm-obdump(1) with the -macho and -disassemble optionsKevin Enderby2017-02-062-0/+8
| | | | | | | | | | which caused it to not disassemble the bytes a the start of the section if the section had symbols and the first symbol was not at the start of the section. rdar://30143243 llvm-svn: 294212
* [llvm-cov] Don't show function summaries when filtering by filename (fixes ↵Vedant Kumar2017-02-052-3/+3
| | | | | | PR31395) llvm-svn: 294137
* [llvm-cov] Demangle symbols in function summaries (fixes PR31394)Vedant Kumar2017-02-051-0/+3
| | | | llvm-svn: 294136
* Fix a bug in llvm-obdump(1) with the -objc-meta-data flag with -machoKevin Enderby2017-02-032-0/+3
| | | | | | | | which caused a hang on a malformed binary with bad bind info. rdar://29672108 llvm-svn: 294021
* [ThinLTO] PrintStatistics when we exit early for thinlto-index-onlyTeresa Johnson2017-02-021-0/+7
| | | | | | | | | | | | | | Summary: This is necessary to get stats from the ThinLink printed before the early exit when compiling in a distributed build. Reviewers: mehdi_amini Subscribers: Prazek, llvm-commits Differential Revision: https://reviews.llvm.org/D29461 llvm-svn: 293908
* Make test case resilient to \ or / directory separatorsDavid Blaikie2017-02-011-3/+3
| | | | llvm-svn: 293786
* Add missing test cases from r293697/D29094David Blaikie2017-02-014-0/+49
| | | | | | Differential Revision: https://reviews.llvm.org/D29368 llvm-svn: 293785
* [XRay] Define the InstrumentationMap typeDean Michael Berris2017-02-018-31/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change implements the instrumentation map loading library which can understand both YAML-defined instrumentation maps, and ELF 64-bit object files that have the XRay instrumentation map section. We break it out into a library on its own to allow for other applications to deal with the XRay instrumentation map defined in XRay-instrumented binaries. This type provides both raw access to the logical representation of the instrumentation map entries as well as higher level functions for converting a function ID into a function address. At this point we only support ELF64 binaries and YAML-defined XRay instrumentation maps. Future changes should extend this to support 32-bit ELF binaries, as well as other binary formats (like MachO). As part of this change we also migrate all uses of the extraction logic that used to be defined in tools/llvm-xray/ to use this new type and interface for loading from files. We also remove the flag from the `llvm-xray` tool that required users to specify the type of the instrumentation map file being provided to instead make the library auto-detect the file type. Reviewers: dblaikie Subscribers: mgorny, varno, llvm-commits Differential Revision: https://reviews.llvm.org/D29319 llvm-svn: 293721
* Fix a bug in llvm-obdump(1) with the -macho flag disassembling an objectKevin Enderby2017-01-312-0/+3
| | | | | | | | | | | | | without symbols that makes calls through a symbol stub which were not correctly being annotated with “## symbol stub for: _foo”. Just adds the same parameters for getting the annotations from DisAsm->getInstruction() and passing them to IP->printInst() from the code above when boolean variable symbolTableWorked was true. rdar://29791952 llvm-svn: 293662
* [WebAssembly] Add wasm support for llvm-readobjDerek Schuff2017-01-303-0/+57
| | | | | | | | | | | Create a WasmDumper subclass of ObjDumper to support Webassembly binary files. Patch by Sam Clegg Differential Revision: https://reviews.llvm.org/D27355 llvm-svn: 293569
* Change the llvm-obdump(1) behavior with the -macho flag and inappropriate ↵Kevin Enderby2017-01-301-2/+3
| | | | | | | | | | | | | | | | | | file types. To better match the old darwin otool(1) behavior, when llvm-obdump(1) is used with the -macho option and the input file is not an object file simply print the file name and this message: foo: is not an object file and continue on to process other input files. Also in this case don’t exit non-zero. This should help in some OSS projects' with autoconf scripts that are expecting the old darwin otool(1) behavior. rdar://26828015 llvm-svn: 293547
* gold-plugin: Fix test case.Peter Collingbourne2017-01-261-1/+2
| | | | llvm-svn: 293137
* gold-plugin: Simplify naming of object files created with save-temps or ↵Peter Collingbourne2017-01-261-2/+2
| | | | | | | | | | obj-path. Now we never append a number to the file name for task ID 0. Differential Revision: https://reviews.llvm.org/D29160 llvm-svn: 293132
* Change the test added in r293099 so it does not have the string "llvm-nm" to fixKevin Enderby2017-01-251-1/+1
| | | | | | the clang-x86-windows-msvc2015 bot as the name is "llvm-nm.EXE" in that case. llvm-svn: 293114
* Add a warning when the llvm-nm -print-size flag is used on a Mach-O file asKevin Enderby2017-01-253-0/+5
| | | | | | | | | | | | Mach-O files don’t have size information about the symbols in the object file format unlike ELF. Also add the part of the fix to llvm-nm that was missed with r290001 so -arch armv7m works. rdar://25681018 llvm-svn: 293099
* Implemented color coding and Vertex labels in XRay GraphDean Michael Berris2017-01-254-2/+89
| | | | | | | | | | | | | | | | | | Summary: A patch to enable the llvm-xray graph subcommand to color edges and vertices based on statistics and to annotate vertices with statistics. Depends on D27243 Reviewers: dblaikie, dberris Reviewed By: dberris Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D28225 llvm-svn: 293031
OpenPOWER on IntegriCloud