summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
* IPO: Introduce ThinLTOBitcodeWriter pass.Peter Collingbourne2016-12-161-1/+7
| | | | | | | | | | | | | | This pass prepares a module containing type metadata for ThinLTO by splitting it into regular and thin LTO parts if possible, and writing both parts to a multi-module bitcode file. Modules that do not contain type metadata are written unmodified as a single module. All globals with type metadata are added to the regular LTO module, and the rest are added to the thin LTO module. Differential Revision: https://reviews.llvm.org/D27324 llvm-svn: 289899
* [ARM] Implement execute-only support in CodeGenPrakhar Bahuguna2016-12-151-0/+8
| | | | | | | | | | | | | | | | | | | | This implements execute-only support for ARM code generation, which prevents the compiler from generating data accesses to code sections. The following changes are involved: * Add the CodeGen option "-arm-execute-only" to the ARM code generator. * Add the clang flag "-mexecute-only" as well as the GCC-compatible alias "-mpure-code" to enable this option. * When enabled, literal pools are replaced with MOVW/MOVT instructions, with VMOV used in addition for floating-point literals. As the MOVT instruction is required, execute-only support is only available in Thumb mode for targets supporting ARMv8-M baseline or Thumb2. * Jump tables are placed in data sections when in execute-only mode. * The execute-only text section is assigned section ID 0, and is marked as unreadable with the SHF_ARM_PURECODE flag with symbol 'y'. This also overrides selection of ELF sections for globals. llvm-svn: 289784
* Attempt to fix llvm-readobj crash on ppc64 due to r289674Yaxun Liu2016-12-151-1/+1
| | | | llvm-svn: 289777
* Add the ability to get attribute values as Optional<T>Greg Clayton2016-12-141-23/+21
| | | | | | | | | | | | | | | | | | | | | | When getting attributes it is sometimes nicer to use Optional<T> some of the time instead of magic values. I tried to cut over to only using the Optional values but it made many of the call sites very messy, so it makes sense the leave in the calls that can return a default value. Otherwise code that looks like this: uint64_t CallColumn = Die.getAttributeValueAsAddress(DW_AT_call_line, 0); Has to be turned into: uint64_t CallColumn = 0; if (auto CallColumnValue = Die.getAttributeValueAsAddress(DW_AT_call_line)) CallColumn = *CallColumnValue; The first snippet of code looks much better. But in cases where you want an offset that may or may not be there, the following code looks better: if (auto StmtOffset = Die.getAttributeValueAsSectionOffset(DW_AT_stmt_list)) { // Use StmtOffset } Differential Revision: https://reviews.llvm.org/D27772 llvm-svn: 289731
* AMDGPU: Emit runtime metadata version 2 as YAMLYaxun Liu2016-12-143-0/+42
| | | | | | Differential Revision: https://reviews.llvm.org/D25046 llvm-svn: 289674
* [ThinLTO] Add an API to trigger file-based API for returning objects to the ↵Mehdi Amini2016-12-143-1/+31
| | | | | | | | | | | | | | | | | | | | linker Summary: The motivation is to support better the -object_path_lto option on Darwin. The linker needs to write down the generate object files on disk for later use by lldb or dsymutil (debug info are not present in the final binary). We're moving this into libLTO so that we can be smarter when a cache is enabled and hard-link when possible instead of duplicating the files. Reviewers: tejohnson, deadalnix, pcc Subscribers: dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D27507 llvm-svn: 289631
* Switch functions that returned bool and filled in a DWARFFormValue arg with ↵Greg Clayton2016-12-131-6/+6
| | | | | | | | ones that return Optional<DWARFFormValue> Differential Revision: https://reviews.llvm.org/D27737 llvm-svn: 289611
* llvm-cat: Allow bitcode files to be created with no modules.Peter Collingbourne2016-12-131-1/+1
| | | | llvm-svn: 289610
* [llvm-config] Fixing one check where shared libs implied dylibChris Bieneman2016-12-131-2/+2
| | | | | | We shouldn't print the dylib if LinkDylib is false. llvm-svn: 289609
* llvm-config: Set LinkMode in addition to LinkDyLib when using --ignore-llvmDerek Schuff2016-12-131-2/+3
| | | | | | | | | | | | | | | Summary: LinkDyLib is only used (before arg processing) to set up the default for LinkMode. So reset LinkMode as well, and process before --link-shared or --link-static to allow those flags to continue to override it. Reviewers: beanz Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D27736 llvm-svn: 289608
* [llvm-config] Add --ignore-libllvmChris Bieneman2016-12-131-0/+3
| | | | | | This flag forces off linking libLLVM. This should resolve some issues reported on llvm-commits. llvm-svn: 289605
* [bpf] change llvm-objdump to print dec instead of hexAlexei Starovoitov2016-12-131-0/+23
| | | | | | | | | since bpf instruction stream is multiple of 8 change llvm-objdump to print decimal instruction number instead of hex address, so that users don't have to do this math manually to match kernel verifier output Signed-off-by: Alexei Starovoitov <ast@kernel.org> llvm-svn: 289569
* Make a DWARFDIE class that can help avoid using the wrong DWARFUnit when ↵Greg Clayton2016-12-131-128/+121
| | | | | | | | | | | | extracting attributes Many places pass around a DWARFDebugInfoEntryMinimal and a DWARFUnit. It is easy to get things wrong by using the wrong DWARFUnit with a DWARFDebugInfoEntryMinimal. This patch creates a DWARFDie class that contains the DWARFUnit and DWARFDebugInfoEntryMinimal objects so that they can't get out of sync. All attribute extraction has been moved out of DWARFDebugInfoEntryMinimal and into DWARFDie. DWARFDebugInfoEntryMinimal was also renamed to DWARFDebugInfoEntry. DWARFDie objects are temporary objects that are used by clients and contain 2 pointers that you always need to have anyway. Keeping them grouped will avoid errors and simplify many of the attribute extracting APIs by not having to pass in a DWARFUnit. Differential Revision: https://reviews.llvm.org/D27634 llvm-svn: 289565
* [llvm-config] Fix bug where `--libfiles` and `--names` would produceDan Liew2016-12-121-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | incorrect output when LLVM is built with `LLVM_BUILD_LLVM_DYLIB`. `llvm-config` previously produced output like this ``` $ llvm-config --libfiles /usr/lib/liblibLLVM-4.0svn.so.so $ llvm-config --libnames liblibLLVM-4.0svn.so.so ``` The library prefix and shared library extension were added to the library name twice which was wrong. I wanted to write a test cases for this but it looks like **all** `llvm-config` tests were disabled by r260386 so I'll leave this for now. Subscribers: llvm-commits, tstellarAMD Reviewers: beanz, DiamondLovesYou, axw Differential Revision: https://reviews.llvm.org/D27393 llvm-svn: 289488
* clang-format to fix post-commit feedbackChris Bieneman2016-12-121-3/+2
| | | | | | Thanks dblaikie! llvm-svn: 289485
* [ObjectYAML] Support for DWARF debug_arangesChris Bieneman2016-12-094-0/+56
| | | | | | This patch adds support for round tripping DWARF debug_aranges in and out of YAML. llvm-svn: 289161
* [ObjectYAML] Remove DWARF from class namesChris Bieneman2016-12-084-12/+12
| | | | | | Since all the DWARF classes are in a DWARFYAML namespace having every class start with DWARF seems like a bit of overkill. llvm-svn: 289080
* Prune unused libdeps.NAKAMURA Takumi2016-12-081-1/+0
| | | | llvm-svn: 289060
* LTO: Hash the parts of the LTO configuration that affect code generation.Peter Collingbourne2016-12-081-0/+42
| | | | | | | | | Most importantly, we need to hash the relocation model, otherwise we can end up trying to link non-PIC object files into PIEs or DSOs. Differential Revision: https://reviews.llvm.org/D27556 llvm-svn: 289024
* [yaml2obj] Refactor and abstract yaml2dwarf functionsChris Bieneman2016-12-074-15/+53
| | | | | | This abstracts the code for emitting DWARF binary from the DWARFYAML types into reusable interfaces that could be used by ELF and COFF. llvm-svn: 288990
* [obj2yaml] Refactor and abstract dwarf2yamlChris Bieneman2016-12-074-41/+69
| | | | | | This makes the dwarf2yaml code separated and reusable allowing ELF and COFF to share implementations with MachO. llvm-svn: 288986
* [ObjectYAML] Pull DWARF support into DWARFYAML namespaceChris Bieneman2016-12-071-2/+2
| | | | | | | | Since DWARF formatting is agnostic to the object file it is stored in, it doesn't make sense for this to be in the MachOYAML implementation. Pulling it into its own namespace means we could modify the ELF and COFF YAML tools to emit DWARF as well. In a follow-up patch I will better abstract this in obj2yaml and yaml2obj so that the DWARF bits in the tools can be re-used too. llvm-svn: 288984
* [ObjectYAML] Support for DWARF __debug_abbrev sectionChris Bieneman2016-12-072-1/+40
| | | | | | This patch adds support for round-tripping DWARF debug abbreviations through the obj<->yaml tools. llvm-svn: 288955
* [llc] Fix -stop-after=consthoist initializing the pass.Davide Italiano2016-12-061-0/+1
| | | | llvm-svn: 288864
* [llvm-readobj] - Teach readobj to print PT_OPENBSD_BOOTDATA headerGeorge Rimar2016-12-061-0/+1
| | | | | | | | | | | | | These are OpenBSD specific program headers. OpenBSD commit: https://github.com/openbsd/src/commit/d39116912b9536bd77326260dc5c6e593fd4ee24 It is required for fixing PR31288. Differential revision: https://reviews.llvm.org/D27456 llvm-svn: 288831
* [ObjectYAML] First bit of support for encoding DWARF in MachOChris Bieneman2016-12-063-1/+41
| | | | | | This patch adds the starting support for encoding data from the MachO __DWARF segment. The first section supported is the __debug_str section because it is the simplest. llvm-svn: 288774
* [llvm] Fix D26214: Move error handling out of MC and to the callers.Mandeep Singh Grang2016-12-061-2/+15
| | | | | | | | | | | | Summary: Related clang patch; https://reviews.llvm.org/D27360 Reviewers: t.p.northover, grosbach, compnerd, echristo Subscribers: compnerd, mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D27359 llvm-svn: 288763
* revert inadvertedly introduced build breakBob Haarman2016-12-061-9/+1
| | | | | | | | | | | | | Summary: r288722 introduced a build break due some code that should not have been part of the commit. This change removes the offending code. Reviewers: davide, ruiu Differential Revision: https://reviews.llvm.org/D27435 llvm-svn: 288742
* [pdb] handle missing pdb streams more gracefullyBob Haarman2016-12-051-3/+51
| | | | | | | | | | | | Summary: The code we use to read PDBs assumed that streams we ask it to read exist, and would read memory outside a vector and crash if this wasn't the case. This would, for example, cause llvm-pdbdump to crash on PDBs generated by lld. This patch handles such cases more gracefully: the PDB reading code in LLVM now reports errors when asked to get a stream that is not present, and llvm-pdbdump will report missing streams and continue processing streams that are present. Reviewers: ruiu, zturner Subscribers: thakis, amccarth Differential Revision: https://reviews.llvm.org/D27325 llvm-svn: 288722
* Always use / as the path separator.Rafael Espindola2016-12-041-1/+1
| | | | | | | It is not clear if it is worth the complexity to use \ on windows. This should fix the bots. llvm-svn: 288616
* Prefix path when displaying thin archives.Rafael Espindola2016-12-041-0/+5
| | | | | | Patch by Mark Santaniello. llvm-svn: 288615
* llvm-modextract: Call keep() on the output stream before exiting.Peter Collingbourne2016-12-011-0/+2
| | | | llvm-svn: 288435
* [dsymutil] Simplify a lazy-init condition/expressionDavid Blaikie2016-12-011-4/+3
| | | | llvm-svn: 288423
* Fix a bug with llvm-size and the -m option with multiple files not printing ↵Kevin Enderby2016-12-011-1/+3
| | | | | | the file names. llvm-svn: 288402
* This change removes the dependency on DwarfDebug that was used for ↵Greg Clayton2016-12-011-60/+66
| | | | | | | | | | | | | DW_FORM_ref_addr by making a new DIEUnit class in DIE.cpp. The DIEUnit class represents a compile or type unit and it owns the unit DIE as an instance variable. This allows anyone with a DIE, to get the unit DIE, and then get back to its DIEUnit without adding any new ivars to the DIE class. Why was this needed? The DIE class has an Offset that is always the CU relative DIE offset, not the "offset in debug info section" as was commented in the header file (the comment has been corrected). This is great for performance because most DIE references are compile unit relative and this means most code that accessed the DIE's offset didn't need to make it into a compile unit relative offset because it already was. When we needed to emit a DW_FORM_ref_addr though, we needed to find the absolute offset of the DIE by finding the DIE's compile/type unit. This class did have the absolute debug info/type offset and could be added to the CU relative offset to compute the absolute offset. With this change we can easily get back to a DIE's DIEUnit which will have this needed offset. Prior to this is required having a DwarfDebug and required calling: DwarfCompileUnit *DwarfDebug::lookupUnit(const DIE *CU) const; Now we can use the DIEUnit class to do so without needing DwarfDebug. All clients now use DIEUnit objects (the DwarfDebug stack and the DwarfLinker). A follow on patch for the DWARF generator will also take advantage of this. Differential Revision: https://reviews.llvm.org/D27170 llvm-svn: 288399
* [llvm] Implement support for -defsym assembler optionMandeep Singh Grang2016-12-011-16/+3
| | | | | | | | | | | | | | | Summary: Changes to llvm-mc to move common logic to separate function. Related clang patch: https://reviews.llvm.org/D26213 Reviewers: rafael, t.p.northover, colinl, echristo, rengolin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D26214 llvm-svn: 288396
* Object: Set SF_Indirect in ModuleSymbolTable.Peter Collingbourne2016-12-011-7/+2
| | | | | | | | This lets us remove the last use of IRObjectFile::getSymbolGV() in llvm-nm. Differential Revision: https://reviews.llvm.org/D27076 llvm-svn: 288321
* Object: Add SF_Executable symbol flag.Peter Collingbourne2016-12-011-16/+14
| | | | | | | | | | | | This allows us to remove a few uses of IRObjectFile::getSymbolGV() in llvm-nm. While here change host-dependent logic in llvm-nm to target-dependent logic. Differential Revision: https://reviews.llvm.org/D27075 llvm-svn: 288320
* Bitcode: Correctly handle Fixed and VBR arrays in BitstreamCursor::skipRecord().Peter Collingbourne2016-12-011-2/+6
| | | | | | | | | | | The assertions were wrong; we need to call getEncodingData() on the element, not the array. While here, simplify the skipRecord() implementation for Fixed and Char6 arrays. This is tested by the code I added to llvm-bcanalyzer which makes sure that we can skip any record. Differential Revision: https://reviews.llvm.org/D27241 llvm-svn: 288315
* 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
OpenPOWER on IntegriCloud