summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm-readobj] MachO: Dump segment command.Davide Italiano2015-09-023-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | Example output: File: <stdin> Format: Mach-O arm Arch: arm AddressSize: 32bit Segment { Cmd: LC_SEGMENT Name: Size: 260 vmaddr: 0x0 vmsize: 0x10 fileoff: 408 filesize: 408 maxprot: rwx initprot: rwx nsects: 3 flags: 0x0 } Differential Revision: http://reviews.llvm.org/D12542 llvm-svn: 246665
* Pass a symbol table to getRelocationSymbol instead of returning one.Rafael Espindola2015-09-023-32/+41
| | | | | | | This removes a report_fatal_error from library and avoids checking a section property for every section entry. llvm-svn: 246656
* gold-plugin: Implement parallel LTO code generation using llvm::splitCodeGen.Peter Collingbourne2015-09-011-34/+47
| | | | | | | | | Parallelism can be enabled using a new plugin option, jobs=N, where N is the number of code generation threads. Differential Revision: http://reviews.llvm.org/D12308 llvm-svn: 246584
* New bitcode linker flags:Artem Belevich2015-09-011-4/+21
| | | | | | | | | -only-needed -- link in only symbols needed by destination module -internalize -- internalize linked symbols Differential Revision: http://reviews.llvm.org/D12459 llvm-svn: 246561
* [llvm-readobj] MachO -- correctly dump section field 'Reserved3'Davide Italiano2015-09-011-0/+4
| | | | | | Before we incorrectly ignored it. llvm-svn: 246556
* Enable linking tools, shared libraries against libLLVMAndrew Wilkins2015-09-012-43/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Three closely related changes, to have a mode in which we link all executables and shared libraries against libLLVM. 1. Add a new LLVM_LINK_LLVM_DYLIB cmake option, which, when ON, will link executables and shared libraries against libLLVM. For this to work, it is necessary to also set LLVM_BUILD_LLVM_DYLIB and LLVM_DYLIB_EXPORT_ALL. It is not strictly necessary to set LLVM_DISABLE_LLVM_DYLIB_ATEXIT, but we also default to OFF in this mode, or tools tend to misbehave (e.g. stdout may not flush on exit when output is buffered.) llvm-config and Tablegen do not use libLLVM, as they are dependencies of libLLVM. 2. Modify llvm-go to take a new flag, "linkmode=component-libs|dylib". Depending on which one is passed (default is component-libs), we link with the individual libraries or libLLVM respectively. We pass in dylib when LLVM_LINK_LLVM_DYLIB is ON. 3. Fix LLVM_DYLIB_EXPORT_ALL on Linux, and expand the symbols exported to actually export all. Don't strip leading underscore from symbols on Linux, and make sure we get all exported symbols and weak-with-default symbols ("W" in nm output). Without these changes, passes won't load because the "Annotate..." symbols defined in lib/Support/Valigrind.cpp are not found. Testing: - Ran default build ("ninja") with LLVM, clang, compiler-rt, llgo, lldb. - Ran "check", "check-clang", "check-tsan", "check-libgo" targets. I've never had much success with LLDB tests, and llgoi is currently broken so check-llgo fails for an unrelated reason. - Ran "lldb" to ensure it loads. Reviewers: chandlerc, beanz, pcc, rnk Subscribers: rnk, chapuni, sylvestre.ledru, llvm-commits Differential Revision: http://reviews.llvm.org/D12488 llvm-svn: 246527
* [llvm-readobj] Dump MachO Dysymtab command.Davide Italiano2015-08-313-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example output: File: <stdin> Format: Mach-O 64-bit x86-64 Arch: x86_64 AddressSize: 64bit Dysymtab { ilocalsym: 0 nlocalsym: 6 iextdefsym: 6 nextdefsym: 2 iundefsym: 8 nundefsym: 0 tocoff: 0 ntoc: 0 modtaboff: 0 nmodtab: 0 extrefsymoff: 0 nextrefsyms: 0 indirectsymoff: 0 nindirectsyms: 0 extreloff: 0 nextrel: 0 locreloff: 0 nlocrel: 0 } Differential Revision: http://reviews.llvm.org/D12496 llvm-svn: 246474
* Build a lib/Fuzzer version for llvm-as.Karl Schimpf2015-08-312-0/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This CL is associated with a fuzzing effort to find bugs in LLVM. The first step is to fuzz llvm-as to find potential issues in generating IR. Both afl-fuzz and LLVM's lib/Fuzzer are being used. This CL introduces the executable that implements the in-process fuzzer using LLVM's lib/Fuzzer. The motivation for using lib/Fuzzer is based on time comparisons between afl-fuzz and lib/Fuzzer. Early results show that per-process, the lib/Fuzzer implemenation of llvm-as (i.e. this CL) generates over 30 times the number of mutations found by afl-fuzz, per hour runtime. The speedup is due to the removal of overhead of forking a process, and loading the executable into memory. I placed this under the tools directory, since it is an executable. It is also only conditionally built if (using cmake) the flag LLVM_USEE_SANITIZE_COVERAGE is used, so that it isn't built by default. Reviewers: kcc, filcab Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12438 llvm-svn: 246458
* [llvm-readobj] Add pair of missing braces.Davide Italiano2015-08-311-1/+2
| | | | | | This fixes a regression introduced in r246151. llvm-svn: 246453
* [dsymutil] Do not mistakenly reuse the current object file when the next one ↵Frederic Riss2015-08-311-1/+3
| | | | | | isn't found. llvm-svn: 246412
* [dsymutil] Do not crash on empty debug_range range.Frederic Riss2015-08-311-9/+11
| | | | | | | | | | The fix is trivial (The actual patch is 2 lines, but as it changes indentation it looks like more). clang does not produce this kind of (slightly bogus) debug info anymore, thus I had to rely on a hand-crafted assembly test to trigger that case. llvm-svn: 246410
* [dsymutil] Fix caching of current range. NFC.Frederic Riss2015-08-311-2/+3
| | | | | | | The current range cache will will just be hit more often, no visible external change. llvm-svn: 246409
* [dsymutil] Fix handling of inlined_subprogram low_pcsFrederic Riss2015-08-311-3/+14
| | | | | | | | | The value of an inlined subprogram low_pc attribute should not get relocated, but it can happen that it matches the enclosing function's start address and thus gets the generic treatment. Special case it to avoid applying the PC offset twice. llvm-svn: 246406
* [dsymutil] Do not construct a StringRef from a std::string temporaryFrederic Riss2015-08-311-2/+1
| | | | llvm-svn: 246404
* [dsymutil] Implement -symtab/-s option.Frederic Riss2015-08-313-0/+193
| | | | | | | This option dumps the STAB entries that define the debug map(s) stored in the input binaries, and then exits. llvm-svn: 246403
* llvm-readobj: Dump more info for COFF import libraries.Rui Ueyama2015-08-284-7/+57
| | | | | | This patch teaches llvm-readobj to print out COFF import file header fields. llvm-svn: 246291
* Re-apply r246276 - Object: Teach llvm-ar to create symbol table for COFF ↵Rui Ueyama2015-08-281-0/+9
| | | | | | | | | | | short import files This patch includes a fix for a llvm-readobj test. With this patch, the tool does no longer print out COFF headers for the short import file, but that's probably desirable because the header for the short import file is dummy. llvm-svn: 246283
* CodeGen: Introduce splitCodeGen and teach LTOCodeGenerator to use it.Peter Collingbourne2015-08-271-11/+33
| | | | | | | | | | | | | | | llvm::splitCodeGen is a function that implements the core of parallel LTO code generation. It uses llvm::SplitModule to split the module into linkable partitions and spawning one code generation thread per partition. The function produces multiple object files which can be linked in the usual way. This has been threaded through to LTOCodeGenerator (and llvm-lto for testing purposes). Separate patches will add parallel LTO support to the gold plugin and lld. Differential Revision: http://reviews.llvm.org/D12260 llvm-svn: 246236
* [yaml2obj] Support numeric indexes to create invalid files. Will be used by ↵Michael J. Spencer2015-08-271-3/+5
| | | | | | lld test. llvm-svn: 246233
* [llvm-readobj] Add support for dumping MachO min version load command.Davide Italiano2015-08-273-0/+45
| | | | | | | | | | | | | | | | | | Example output: File: <stdin> Format: Mach-O arm Arch: arm AddressSize: 32bit MinVersion { Cmd: LC_VERSION_MIN_IPHONEOS Size: 16 Version: 99.8.7 SDK: n/a } Differential Revision: http://reviews.llvm.org/D12373 llvm-svn: 246151
* [llvm-objdump] Use the new MinVersion API introduced in r245938. NFC.Davide Italiano2015-08-261-8/+12
| | | | llvm-svn: 246031
* Revert "[dsymutil] Emit real dSYM companion binaries."Frederic Riss2015-08-263-436/+3
| | | | | | | This reverts commit r246012. Some bots do not like it (mips/s390). llvm-svn: 246019
* [dsymutil] Emit real dSYM companion binaries.Frederic Riss2015-08-263-3/+436
| | | | | | | | | | | | | | | | | | | The binaries containing the linked DWARF generated by dsymutil are not standard relocatable object files like emitted did previsously. They should be dSYM companion files, which means they have a different file type in the header, but also a couple other peculiarities: - they contain the segments and sections from the original binary in their load commands, but not the actual contents. This means they get an address and a size, but their offset is always 0 (but these are not virtual sections) - they also conatin all the defined symbols from the original binary This makes MC a really bad fit to emit these kind of binaries. The approach that was used in this patch is to leverage MC's section layout for the debug sections, but to use a replacement for MachObjectWriter that lives in MachOUtils.cpp. Some of the low-level helpers from MachObjectWriter were reused too. llvm-svn: 246012
* [dsymutil] Store an optional BinaryPath in the debug map.Frederic Riss2015-08-263-2/+9
| | | | | | | | | llvm-dsymutil needs to emit dSYM companion bundles. These are binary files that replicate some of the orignal binary file properties (sections and symbols). To get acces to these properties, pass the binary path in the debug map. llvm-svn: 246011
* [dsymutil] Make the warn and error helpers globally available. NFC.Frederic Riss2015-08-262-11/+14
| | | | llvm-svn: 246010
* [dsymutil] Split NonRelocatableStringPool into its own file. NFC.Frederic Riss2015-08-262-86/+103
| | | | llvm-svn: 246009
* [dsymutil] Reapply r245960.Frederic Riss2015-08-253-1/+11
| | | | | | | | | | | | | | | | | | There was an issue in the test setup because the test requires an arch that wasn't filtered by the lit.local.cfg, but given the set of bots that failed, I'm not confident this is the (only) issue. So this commit also adds more output to the test to help me track down the failure if it happens again. Original commit message: [dsymutil] Rewrite thumb triple names in user visible messages. We autodetect triples from the input file(s) while reading the mach-o debug map. As we need to create a Target from those triples, we always chose the thumb variant (because the arm variant might not be 'instantiable' eg armv7m). The user visible architecture names should still be 'arm' and not 'thumb' variants though. llvm-svn: 245988
* Revert "[dsymutil] Rewrite thumb triple names in user visible messages."Frederic Riss2015-08-253-11/+1
| | | | | | | | This reverts commit r245960. Multiple bots are failing on the new test. It seemd like llvm-dsymutil exits with an error. Investigating. llvm-svn: 245964
* [dsymutil] Rewrite thumb triple names in user visible messages.Frederic Riss2015-08-253-1/+11
| | | | | | | | | | We autodetect triples from the input file(s) while reading the mach-o debug map. As we need to create a Target from those triples, we always chose the thumb variant (because the arm variant might not be 'instantiable' eg armv7m). The user visible architecture names should still be 'arm' and not 'thumb' variants though. llvm-svn: 245960
* [dsymutil] Not finding any debug info is not a fatal errorFrederic Riss2015-08-252-5/+4
| | | | llvm-svn: 245959
* LTO: Simplify merged module ownership.Peter Collingbourne2015-08-242-2/+2
| | | | | | | | | | | This change moves LTOCodeGenerator's ownership of the merged module to a field of type std::unique_ptr<Module>. This helps simplify parts of the code and clears the way for the module to be consumed by LLVM CodeGen (see D12132 review comments). Differential Revision: http://reviews.llvm.org/D12205 llvm-svn: 245891
* [llvm-readobj/ELF] Factor out common code.Davide Italiano2015-08-231-12/+11
| | | | llvm-svn: 245813
* LTO: Change signature of LTOCodeGenerator::setCodePICModel() to take a ↵Peter Collingbourne2015-08-212-15/+17
| | | | | | | | | Reloc::Model. This allows us to remove a bunch of code in LTOCodeGenerator and llvm-lto and has the side effect of improving error handling in the libLTO C API. llvm-svn: 245756
* [llvm-readobj] Add support for MachO DataInCodeDataCommand.Davide Italiano2015-08-213-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example output: File: <stdin> Format: Mach-O arm Arch: arm AddressSize: 32bit DataInCode { Data offset: 300 Data size: 32 Data Regions [ DICE { Index: 0 Offset: 0 Length: 4 Kind: 1 } DICE { Index: 1 Offset: 4 Length: 4 Kind: 4 } DICE { Index: 2 Offset: 8 Length: 2 Kind: 3 } DICE { Index: 3 Offset: 10 Length: 1 Kind: 2 } ] } Differential Revision: http://reviews.llvm.org/D12084 llvm-svn: 245732
* llvm-lto: Re-order code.Peter Collingbourne2015-08-211-12/+10
| | | | | | | This saves us from needing to asave a pointer, and will be needed for an upcoming ownership change. llvm-svn: 245722
* TransformUtils: Introduce module splitter.Peter Collingbourne2015-08-216-1/+120
| | | | | | | | | | | | | The module splitter splits a module into linkable partitions. It will be used to implement parallel LTO code generation. This initial version of the splitter does not attempt to deal with the somewhat subtle symbol visibility issues around module splitting. These will be dealt with in a future change. Differential Revision: http://reviews.llvm.org/D12132 llvm-svn: 245662
* Replace some calls to isa<LandingPadInst> with isEHPad()David Majnemer2015-08-191-1/+1
| | | | | | No functionality change is intended. llvm-svn: 245487
* [PM/AA] Remove the last relics of the separate IPA library from LLVM,Chandler Carruth2015-08-186-6/+1
| | | | | | | | | | | | | | | | | | | | | folding the code into the main Analysis library. There already wasn't much of a distinction between Analysis and IPA. A number of the passes in Analysis are actually IPA passes, and there doesn't seem to be any advantage to separating them. Moreover, it makes it hard to have interactions between analyses that are both local and interprocedural. In trying to make the Alias Analysis infrastructure work with the new pass manager, it becomes particularly awkward to navigate this split. I've tried to find all the places where we referenced this, but I may have missed some. I have also adjusted the C API to continue to be equivalently functional after this change. Differential Revision: http://reviews.llvm.org/D12075 llvm-svn: 245318
* [CMake] Fix PR14200, llvm-config output misses -fno-rttiChris Bieneman2015-08-141-6/+9
| | | | | | | | This change adds RTTI and Exception flags to llvm-config's cxxflags. This solution is a minimal patch to solve the issue, and is recommended for the 3.7 release branch. Tom Stellard's outstanding work is the longer term solution. Patch By: David Wiberg llvm-svn: 245064
* [llvm-cxxdump] Correctly process relocations when given multiple filesDavid Majnemer2015-08-131-16/+10
| | | | | | | Archive files wouldn't lead to us reprocessing the section relocations for the new object files. llvm-svn: 244932
* Remove and forbid raw_svector_ostream::flush() calls.Yaron Keren2015-08-131-2/+0
| | | | | | | | | | After r244870 flush() will only compare two null pointers and return, doing nothing but wasting run time. The call is not required any more as the stream and its SmallString are always in sync. Thanks to David Blaikie for reviewing. llvm-svn: 244928
* Remove raw_svector_ostream::resync and users. It's no-op after r244870.Yaron Keren2015-08-132-4/+0
| | | | llvm-svn: 244888
* [llvm-symbolizer] Remove underscores and other C mangling on WindowsReid Kleckner2015-08-102-29/+81
| | | | | | | | | | | | | | | Summary: This makes it so that reports symbolized after the fact with llvm-symbolizer are more similar to the ones we generate at runtime with in-process dbghelp. Reviewers: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11785 llvm-svn: 244512
* Don't iterate over all sections in the ELFFile constructor.Rafael Espindola2015-08-103-20/+51
| | | | | | | With this we finally have an ELFFile that is O(1) to construct. This is helpful for programs like lld which have to do their own section walk. llvm-svn: 244510
* Use higher level functions in llvm-objdump.Rafael Espindola2015-08-101-17/+12
| | | | | | | This matches the rest of llvm-objdump better and isolates it from upcoming changes to ELFFile. llvm-svn: 244500
* Delete getDotSymtabSec.Rafael Espindola2015-08-102-11/+19
| | | | | | Another step in avoiding iterating over all sections in the ELFFile constructor. llvm-svn: 244496
* Use continue to reduce indentation. NFC.Rafael Espindola2015-08-101-17/+19
| | | | llvm-svn: 244480
* Recommit r244470+ r244471 together, the bot failed between them.Yaron Keren2015-08-101-7/+5
| | | | llvm-svn: 244476
* Revert r244470 and 244471 while looking into it.Yaron Keren2015-08-101-5/+7
| | | | llvm-svn: 244472
* Second part of r244470 (source file was unsaved in editor).Yaron Keren2015-08-101-5/+5
| | | | llvm-svn: 244471
OpenPOWER on IntegriCloud