summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
* llvm-lto2: Simpler workaround for PR30396.Peter Collingbourne2016-11-301-17/+10
| | | | | | | | | | | Maintain the command line resolutions as a map to a list of resolutions rather than a single resolution, and apply the resolutions in the order observed. This is not only simpler but allows us to test the scenario where the two symbols have different resolutions. Differential Revision: https://reviews.llvm.org/D27285 llvm-svn: 288288
* [WebAssembly] Add llvm-objdump support for wasm file formatDerek Schuff2016-11-304-0/+32
| | | | | | | | | | | This is the first part of an effort to add wasm binary support across all llvm tools. Patch by Sam Clegg Differential Revision: https://reviews.llvm.org/D26172 llvm-svn: 288251
* Apply clang-tidy's 'performance-faster-string-find' check to LLVM.Benjamin Kramer2016-11-303-3/+3
| | | | | | No functionality change intended. llvm-svn: 288235
* Add another missing dependency.Peter Collingbourne2016-11-291-0/+1
| | | | llvm-svn: 288217
* Add llvm-modextract tool.Peter Collingbourne2016-11-294-0/+105
| | | | | | | | | | This program is for testing features that rely on multi-module bitcode files. It takes a multi-module bitcode file, extracts one of the modules and writes it to the output file. Differential Revision: https://reviews.llvm.org/D26778 llvm-svn: 288201
* Add to llvm-objdump the -no-leading-headers option with the use of the ↵Kevin Enderby2016-11-291-6/+11
| | | | | | | | | | | | | -macho option. In some cases the leading headers of the file name, archive member and architecture slice name in the output of lvm-objdump is not wanted so the tool’s output can be directly used by scripts. This matches the -X option of the Apple otool(1) program. rdar://28491674 llvm-svn: 288199
* Add missing dependency.Peter Collingbourne2016-11-292-1/+2
| | | | llvm-svn: 288198
* Bitcode: Introduce BitcodeWriter interface.Peter Collingbourne2016-11-294-0/+106
| | | | | | | | | | This interface allows clients to write multiple modules to a single bitcode file. Also introduce the llvm-cat utility which can be used to create a bitcode file containing multiple modules. Differential Revision: https://reviews.llvm.org/D26179 llvm-svn: 288195
* Object: Add IRObjectFile::getTargetTriple().Peter Collingbourne2016-11-241-8/+2
| | | | | | | | This lets us remove a use of IRObjectFile::getModule() in llvm-nm. Differential Revision: https://reviews.llvm.org/D27074 llvm-svn: 287846
* llvm-nm: Print correct symbol types for init and fini sectionsMeador Inge2016-11-231-0/+3
| | | | | | | | | This patch fixes a small bug where symbols defined in the INIT and FINI sections were incorrectly getting a type of 'n'. Differential Revision: https://reviews.llvm.org/D26937 llvm-svn: 287803
* llvm-nm: Don't print value or size for undefined or weak symbolsMeador Inge2016-11-231-7/+15
| | | | | | | | | | | | | | | | | Undefined and weak symbols don't have a meaningful size or value. As such, nothing should be printed for those attributes (this is already done for the address with 'U') with the BSD format. This matches what GNU nm does. Note that for the POSIX.2 format [1] zero values are still printed for the size and value. This seems in spirit with the format strings in that specification, but is debatable. [1] http://pubs.opengroup.org/onlinepubs/9699919799/ Differential Revision: https://reviews.llvm.org/D26936 llvm-svn: 287802
* llvm-readobj: Use hash tables to print dynamic symbols.Hemant Kulkarni2016-11-231-1/+108
| | | | | | | -symbols prints both .symtab and .dynsym symbols for GNU style in ELF. -dyn-symbols prints symbols looking up through hash tables. This helps validate hash tables. llvm-svn: 287786
* [llvm-cov] Avoid 0% when reporting something that's 0/0Alex Lorenz2016-11-212-20/+36
| | | | | | | | | | | | | This commit makes llvm-cov avoid showing 0% (0/0) coverage for things like file function coverage, etc. in reports and HTML output. This can happen for files like headers that have macros but no functions. This commit makes llvm-cov report - (0/0) instead. rdar://29246480 Differential Revision: https://reviews.llvm.org/D26615 llvm-svn: 287539
* Fix spelling mistakes in Tools/Tests comments. NFC.Simon Pilgrim2016-11-205-6/+6
| | | | | | Identified by Pedro Giffuni in PR27636. llvm-svn: 287489
* Change setDiagnosticsOutputFile to take a unique_ptr from a raw pointer (NFC)Mehdi Amini2016-11-191-1/+2
| | | | | | | | | | | | | | Summary: This makes it explicit that ownership is taken. Also replace all `new` with make_unique<> at call sites. Reviewers: anemet Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D26884 llvm-svn: 287449
* [CMake] llvm-lto2 depends on intrinsics_genChris Bieneman2016-11-191-0/+3
| | | | | | | | | | | | | | | llvm-lto2.cpp has the following include chain: llvm/LTO/Caching.h llvm/LTO/LTO.h llvm/CodeGen/Analysis.h llvm/IR/CallSite.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means llvm-lto2 needs to depend on intrinsics_gen. llvm-svn: 287434
* [CMake] opt depends on intrinsics_genChris Bieneman2016-11-191-0/+3
| | | | | | | | | | | | | AnalysisWrappers.cpp has the following include chain: llvm/Analysis/CallGraph.h llvm/IR/CallSite.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means opt needs to depend on intrinsics_gen. llvm-svn: 287433
* [CMake] llvm-nm depends on intrinsics_genChris Bieneman2016-11-191-0/+3
| | | | | | | | | | | | | llvm-nm.cpp has the following include chain: llvm/IR/Function.h llvm/IR/Argument.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means llvm-nm needs to depend on intrinsics_gen. llvm-svn: 287432
* [CMake] llvm-link depends on intrinsics_genChris Bieneman2016-11-191-0/+3
| | | | | | | | | | | | | | | | llvm-link.cpp has the following include chain: llvm/Bitcode/BitcodeWriter.h llvm/IR/ModuleSummaryIndex.h llvm/IR/Module.h llvm/IR/Function.h llvm/IR/Argument.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means llvm-link needs to depend on intrinsics_gen. llvm-svn: 287431
* [CMake] llvm-extract depends on intrinsics_genChris Bieneman2016-11-191-0/+3
| | | | | | | | | | | | | | | llvm-extract.cpp has the following include chain: llvm/Bitcode/BitcodeWriterPass.h llvm/IR/PassManager.h llvm/IR/Function.h llvm/IR/Argument.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means llvm-extract needs to depend on intrinsics_gen. llvm-svn: 287430
* [CMake] llvm-dwp depends on intrinsics_genChris Bieneman2016-11-191-0/+3
| | | | | | | | | | | | | | | | | | llvm-dwp.cpp has the following include chain: llvm/CodeGen/AsmPrinter.h llvm/CodeGen/MachineFunctionPass.h llvm/CodeGen/MachineFunction.h llvm/CodeGen/MachineBasicBlock.h llvm/CodeGen/MachineInstr.h llvm/Analysis/AliasAnalysis.h llvm/IR/CallSite.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means llvm-dwp needs to depend on intrinsics_gen. llvm-svn: 287429
* [CMake] llvm-dis depends on intrinsics_genChris Bieneman2016-11-191-0/+3
| | | | | | | | | | | | | | | | llvm-dis.cpp has the following include chain: llvm/Bitcode/BitcodeReader.h llvm/IR/ModuleSummaryIndex.h llvm/IR/Module.h llvm/IR/Function.h llvm/IR/Argument.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means llvm-dis needs to depend on intrinsics_gen. llvm-svn: 287428
* [CMake] llvm-diff depends on intrinsics_genChris Bieneman2016-11-191-0/+3
| | | | | | | | | | | | | | llvm-diff.cpp has the following include chain: llvm/IR/Module.h llvm/IR/Function.h llvm/IR/Argument.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means llvm-diff needs to depend on intrinsics_gen. llvm-svn: 287427
* [CMake] llvm-stress depends on intrinsics_genChris Bieneman2016-11-191-0/+3
| | | | | | | | | | | | | | llvm-stress.cpp has the following include chain: llvm/Analysis/CallGraphSCCPass.h llvm/Analysis/CallGraph.h llvm/IR/CallSite.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means llvm-stress needs to depend on intrinsics_gen. llvm-svn: 287426
* [CMake] bugpoint-passes depends on intrinsics_genChris Bieneman2016-11-191-2/+4
| | | | | | | | | | | | | TestPasses.cpp has the following include chain: llvm/IR/InstVisitor.h llvm/IR/CallSite.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means bugpoint-passes needs to depend on intrinsics_gen. llvm-svn: 287425
* [CMake] llvm-bcanalyzer depends on intrinsics_genChris Bieneman2016-11-191-0/+3
| | | | | | | | | | | | | | | | llvm-bcanalyzer.cpp has the following include chain: llvm/Bitcode/BitcodeReader.h llvm/IR/ModuleSummaryIndex.h llvm/IR/Module.h llvm/IR/Function.h llvm/IR/Argument.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means llvm-bcanalyzer needs to depend on intrinsics_gen. llvm-svn: 287424
* [CMake] llvm-as depends on intrinsics_genChris Bieneman2016-11-191-0/+3
| | | | | | | | | | | | | | | | llvm-as.cpp has the following include chain: llvm/Bitcode/BitcodeWriter.h llvm/IR/ModuleSummaryIndex.h llvm/IR/Module.h llvm/IR/Function.h llvm/IR/Argument.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means llvm-as needs to depend on intrinsics_gen. llvm-svn: 287423
* [CMake] llc depends on intrinsics_genChris Bieneman2016-11-191-0/+3
| | | | | | | | | | | | | | llc.cpp has the following include chain: llvm/Analysis/TargetLibraryInfo.h llvm/IR/Function.h llvm/IR/Argument.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means llc needs to depend on intrinsics_gen. llvm-svn: 287422
* [CMake] lli-child-target depends on intrinsics genChris Bieneman2016-11-191-0/+3
| | | | | | Messed up in r287420, it isn't just lli, but also but lli-child-target that need to depend on intrinsics_gen. llvm-svn: 287421
* [CMake] lli depends on intrinsics_genChris Bieneman2016-11-191-0/+3
| | | | | | | | | | | | | | | | ChildTarget.cpp has the following include chain: llvm/ExecutionEngine/Orc/OrcABISupport.h llvm/ExecutionEngine/Orc/IndirectionUtils.h llvm/IR/IRBuilder.h llvm/IR/ConstantFolder.h llvm/IR/InstrTypes.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means lli needs to depend on intrinsics_gen. llvm-svn: 287420
* [CMake] llvm-dsymutil depends on intrinsics_genChris Bieneman2016-11-191-0/+3
| | | | | | | | | | | | | | | | | | DwarfLinker.cpp has the following include chain: llvm/CodeGen/AsmPrinter.h llvm/CodeGen/MachineFunctionPass.h llvm/CodeGen/MachineFunction.h llvm/CodeGen/MachineBasicBlock.h llvm/CodeGen/MachineInstr.h llvm/Analysis/AliasAnalysis.h llvm/IR/CallSite.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means llvm-dsymutil needs to depend on intrinsics_gen. llvm-svn: 287419
* [CMake] verify-uselistorder depends on intrinsics_genChris Bieneman2016-11-181-0/+3
| | | | | | | | | | | | | | | | verify-uselistorder.cpp has the following include chain: llvm/Bitcode/BitcodeReader.h llvm/IR/ModuleSummaryIndex.h llvm/IR/Module.h llvm/IR/Function.h llvm/IR/Argument.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means verify-uselistorder needs to depend on intrinsics_gen. llvm-svn: 287405
* [CMake] sanstats depends on intrinsics_genChris Bieneman2016-11-181-0/+3
| | | | | | | | | | | | | | | sanstats.cpp has the following include chain: llvm/Transforms/Utils/SanitizerStats.h llvm/IR/IRBuilder.h llvm/IR/ConstantFolder.h llvm/IR/InstrTypes.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means sanstats needs to depend on intrinsics_gen. llvm-svn: 287404
* [CMake] bugpoint depends on intrinsics_genChris Bieneman2016-11-181-0/+3
| | | | | | | | | | | | | | | CrashDebugger.cpp has the following include chain: llvm/Analysis/TargetTransformInfo.h llvm/IR/IntrinsicInst.h llvm/IR/Function.h llvm/IR/Argument.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means bugpoint needs to depend on intrinsics_gen. llvm-svn: 287402
* [CMake] llvm-split depends on intrinsics_genChris Bieneman2016-11-181-0/+3
| | | | | | | | | | | | | | | | llvm-split.cpp has the following include chain: llvm/Bitcode/BitcodeWriter.h llvm/IR/ModuleSummaryIndex.h llvm/IR/Module.h llvm/IR/Function.h llvm/IR/Argument.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means llvm-split needs to depend on intrinsics_gen. llvm-svn: 287399
* [CMake] llvm-lto depends on intrinsics_genChris Bieneman2016-11-181-0/+3
| | | | | | | | | | | | | | | | llvm-lto.cpp has the following include chain: llvm/Bitcode/BitcodeReader.h llvm/IR/ModuleSummaryIndex.h llvm/IR/Module.h llvm/IR/Function.h llvm/IR/Argument.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means llvm-lto needs to depend on intrinsics_gen. llvm-svn: 287398
* [CMake] llvm-ar depends on intrinsics_genChris Bieneman2016-11-181-0/+3
| | | | | | | | | | | | | | llvm-ar.cpp has the following include chain: llvm/IR/Module.h llvm/IR/Function.h llvm/IR/Argument.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means llvm-ar needs to depend on intrinsics_gen. llvm-svn: 287395
* [CMake] llvm-profdata depends on intrinsics_genChris Bieneman2016-11-181-0/+3
| | | | | | | | | | | | | | llvm-profdata.cpp has the following include chain: llvm/ProfileData/SampleProfReader.h llvm/IR/Function.h llvm/IR/Argument.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means llvm-profdata needs to depend on intrinsics_gen. llvm-svn: 287394
* [CMake] LTO depends on intrinsics_genChris Bieneman2016-11-181-1/+1
| | | | | | | | | | | | | | | | lto.cpp has the following include chain: llvm/Bitcode/BitcodeReader.h llvm/IR/ModuleSummaryIndex.h llvm/IR/Module.h llvm/IR/Function.h llvm/IR/Argument.h llvm/IR/Attributes.h llvm/IR/Attributes.gen This means LTO needs to depend on intrinsics_gen. llvm-svn: 287393
* [lli] Prefer `exit(1)` to `return 1` for consistency.Davide Italiano2016-11-171-1/+1
| | | | llvm-svn: 287277
* [lli] Factor out error handling. NFCI.Davide Italiano2016-11-171-18/+15
| | | | llvm-svn: 287276
* llvm-dis: Remove dead code.Peter Collingbourne2016-11-171-10/+1
| | | | llvm-svn: 287182
* General clean up of error handling in llvm-objdump to remove its use of ↵Kevin Enderby2016-11-162-40/+54
| | | | | | | | | | | | | | | | | | report_fatal_error(). No real functional change with this commit. The problem with report_fatal_error() is it does not include the tool name and the file name the for which the error message was generated. Uses of report_fatal_error() were change to report_error() or error() to get a better error and to make the code smaller and cleaner. Also changed things like error(errorToErrorCode(SOrErr.takeError())) to use report_error() with a file name and the llvm::Error (as well as the ArchitectureName if available) so the error message is printed. llvm-svn: 287163
* Fix "isn't a prototype" warningVitaly Buka2016-11-161-2/+2
| | | | llvm-svn: 287161
* [ELF] Convert ELF.h to Expected<T>.Davide Italiano2016-11-164-100/+102
| | | | | | | | | | | | This has two advantages: 1) We slowly move away from ErrorOr to the new handling interface, in the hope of having an uniform error handling in LLVM, eventually. 2) We're starting to have *meaningful* error messages for invalid object ELF files, rather than a generic "parse error". At some point we should include also the offset to improve the quality of the diagnostic. llvm-svn: 287081
* Fix build break when the host C compiler is C89.Richard Smith2016-11-161-3/+5
| | | | llvm-svn: 287075
* General clean up of Mach-O error handling in llvm-objdump.Kevin Enderby2016-11-151-173/+72
| | | | | | | | | | | | | | | | | | | | | To get a good error message for all files that could contain Mach-O files the code in llvm-objdump needs to use the archive member name and name of the architecture of a slice of a universal file in those cases where the error come from a Mach-O file in an archive or a universal file. Most of this is fixed by moving the call to checkSymbolTable() into ProcessMachO() and calling it when the operation needs the symbol table. And then calling the form of report_error() that has the ArchiveName and ArchitectureName arguments. One other place needed to call this form of report_error() also with these arguments. Also changed the code in MachODump.cpp to not use report_fatal_error() and use report_error() instead to make the code smaller and cleaner. All cases of this are for errors with the symbol table which should now never be tripped since checkSymbolTable() should be called first to get a good error message in these cases. llvm-svn: 287050
* [C API] Prevent nullptr dereferences in C API for counting attributes.Amaury Sechet2016-11-154-0/+84
| | | | | | | | See https://reviews.llvm.org/D26392 Patch by @maleadt llvm-svn: 287044
* llvm-objdump: deal with unexpected object files more gracefully.Tim Northover2016-11-151-8/+18
| | | | | | | Specifically, we don't want to segfault on release builds, so print the problem instead. llvm-svn: 287022
* Improve DWARF parsing speed by improving DWARFAbbreviationDeclarationGreg Clayton2016-11-151-7/+8
| | | | | | | | | | | | | | | | | | | | This patch gets a DWARF parsing speed improvement by having DWARFAbbreviationDeclaration instances know if they have a fixed byte size. If an abbreviation has a fixed byte size that can be calculated given a DWARFUnit, then parsing a DIE becomes two steps: parse ULEB128 abbrev code, and then add constant size to the offset. This patch also adds a fixed byte size to each DWARFAbbreviationDeclaration::AttributeSpec so that attributes can quickly skip their values if needed without the need to lookup the fixed for size. Notable improvements: - DWARFAbbreviationDeclaration::findAttributeIndex() now returns an Optional<uint32_t> instead of a uint32_t and we no longer have to look for the magic -1U return value - Optional<uint32_t> DWARFAbbreviationDeclaration::findAttributeIndex(dwarf::Attribute attr) const; - DWARFAbbreviationDeclaration now has a getAttributeValue() function that extracts an attribute value given a DIE offset that takes advantage of the DWARFAbbreviationDeclaration::AttributeSpec::ByteSize - bool DWARFAbbreviationDeclaration::getAttributeValue(const uint32_t DIEOffset, const dwarf::Attribute Attr, const DWARFUnit &U, DWARFFormValue &FormValue) const; - A DWARFAbbreviationDeclaration instance can return a fixed byte size for itself so DWARF parsing is faster: - Optional<size_t> DWARFAbbreviationDeclaration::getFixedAttributesByteSize(const DWARFUnit &U) const; - Any functions that used to take a "const DWARFUnit *U" that would crash if U was NULL now take a "const DWARFUnit &U" and are only called with a valid DWARFUnit Differential Revision: https://reviews.llvm.org/D26567 llvm-svn: 286924
OpenPOWER on IntegriCloud