summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
* [dsymutil] Do not create temporary files in -no-output mode.Frederic Riss2015-08-051-5/+19
| | | | | | | | | The files were never written to and then deleted, but they were created nonetheless. To prevent that, create a wrapper around the 2 variants of createUniqueFile and use the one that only does an access(Exists) call to check for name unicity in -no-output mode. llvm-svn: 244172
* [dsymutil] Add support for the -arch option.Frederic Riss2015-08-053-13/+50
| | | | | | | | This option allows to select a subset of the architectures when performing a universal binary link. The filter is done completely in the mach-o specific part of the code. llvm-svn: 244160
* Replace &vector[0] with vector.data() to avoid invalid dereference caught by ↵Nick Lewycky2015-08-051-4/+5
| | | | | | debug STL. Also move a '*' for consistency and fix an 80-col violation. llvm-svn: 244134
* -Wdeprecated clean by making LogBuilder move constructible so it can be ↵David Blaikie2015-08-052-4/+9
| | | | | | returned by value (in DifferenceEngine::logf) llvm-svn: 244129
* Revert "Fix `llvm-config` to emit the linker flag for the combined shared ↵Richard Diamond2015-08-054-50/+2
| | | | | | | | | | object built by autoconfig/make instead of the individual components." It seems I was wrong thinking `autoconf`/`make` only installed shared libraries if configured with `--enable-shared`, even if `--disable-static` is present. I'll re-address with a followup patch. This reverts commit r243297 for causing PR#24154. llvm-svn: 244108
* [dsymutil] Implement support for handling mach-o universal binaries as main ↵Frederic Riss2015-08-058-40/+203
| | | | | | | | | | | | | | | | | input/output. The DWARF linker isn't touched by this, the implementation links individual files and merges them together into a fat binary by calling out to the 'lipo' utility. The main change is that the MachODebugMapParser can now return multiple debug maps for a single binary. The test just verifies that lipo would be invoked correctly, but doesn't actually generate a binary. This mimics the way clang tests its external iplatform tools integration. llvm-svn: 244087
* [dsymutil] Introduce exit helper. NFC.Frederic Riss2015-08-052-3/+12
| | | | | | | | llvm-dsymutil will start creating temporary files in a followup commit. To ease the correct cleanup of this files, introduce a helper called to exit dsymutil. llvm-svn: 244086
* [dsymutil] Split some logic into a helper function. NFCFrederic Riss2015-08-051-10/+10
| | | | llvm-svn: 244085
* [llvm-objdump] Call exit(1) on error, i.e. fail early.Davide Italiano2015-08-054-89/+42
| | | | | | | | | | | | | Previously we kept going on partly corrupted input, which might result in garbage being printed, or even worse, random crashes. Rafael mentioned that this is the GNU behavior as well, but after some discussion we both agreed it's probably better to emit a reasonable error message and exit. As a side-effect of this commit, now we don't rely on global state for error codes anymore. objdump was the last tool in the toolchain which needed to be converted. Hopefully the old behavior won't sneak into the tree again. llvm-svn: 244019
* [llvm-objdump] Range-loopify. NFC intended.Davide Italiano2015-08-031-3/+2
| | | | llvm-svn: 243905
* [dwarfdump] Add support for dumping mach-o universal objectfilesFrederic Riss2015-08-031-8/+16
| | | | llvm-svn: 243862
* [dwarfdump] Move dumping to a helper function NFCFrederic Riss2015-08-031-6/+10
| | | | llvm-svn: 243861
* DwarfLinker: Use DIEValueList instead of DIE, NFCDuncan P. N. Exon Smith2015-08-021-2/+3
| | | | | | | Use `DIEValueList` as a pointer to either `DIEBlock` or `DIELoc` instead of `DIE`, since soon they won't inherit from the latter. llvm-svn: 243857
* [Mips] Support DT_MIPS_RLD_MAP_REL dynamic section tag in the llvm-readobjSimon Atanasyan2015-08-011-0/+2
| | | | llvm-svn: 243833
* [dsymutil] Support multiple input files on the command lineFrederic Riss2015-07-311-23/+33
| | | | llvm-svn: 243777
* New EH representation for MSVC compatibilityDavid Majnemer2015-07-311-0/+5
| | | | | | | | | | This introduces new instructions neccessary to implement MSVC-compatible exception handling support. Most of the middle-end and none of the back-end haven't been audited or updated to take them into account. Differential Revision: http://reviews.llvm.org/D11097 llvm-svn: 243766
* Fix lli with OrcLazyJIT: the default DataLayout was used.Mehdi Amini2015-07-301-0/+1
| | | | | | | Set the correct one using the TargetMachine instead. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 243664
* [COFF] Add IMAGE_SCN_TYPE_NOLOAD to SectionCharacteristicsDavid Majnemer2015-07-301-0/+1
| | | | llvm-svn: 243658
* [dsymutil] Re-add command line option -v this time printing the version.Frederic Riss2015-07-291-0/+6
| | | | llvm-svn: 243584
* [dsymutil] Use option categories.Frederic Riss2015-07-291-9/+22
| | | | | | | | Prevent all the unrelated LLVM options to appear in the -help output by introducing a tool specific option category. As a drive-by improve the wording of the help message. llvm-svn: 243583
* [dsymutil] Rename -v option to -verboseFrederic Riss2015-07-291-1/+1
| | | | | | | | | | | | The dsymutil-classic -v option dumps the tool version rather than putting it in verbose mode. Rename -v to -verbose and update the tests that use it (in the process removing it from a few tests that didn't require it anymore since the -dump-debug-map option was introduced). A followup commit will reintroduce the -v option that dumps the version. llvm-svn: 243582
* [llvm-objdump] Inverting logic to match the word "predicate". Returning ↵Colin LeMahieu2015-07-291-4/+4
| | | | | | true when we want it rather than when we want to discard it. llvm-svn: 243558
* [llvm-objdump] Merging MachO DumpSections in to FilterSections. Simplifying ↵Colin LeMahieu2015-07-293-26/+21
| | | | | | some predicate logic. llvm-svn: 243556
* [llvm-objdump] Added -j flag to filter sections that are operated on.Colin LeMahieu2015-07-292-16/+88
| | | | llvm-svn: 243526
* [RuntimeDyld] Remove a memory-leak that was introduced in r243456. Thanks to BenLang Hames2015-07-281-1/+1
| | | | | | Kramer for catching this. llvm-svn: 243476
* [RuntimeDyld] Make LoadedObjectInfo::getLoadedSectionAddress take a SectionRefLang Hames2015-07-281-1/+2
| | | | | | rather than a string section name. llvm-svn: 243456
* Fix `llvm-config` to emit the linker flag for the combined shared object ↵JF Bastien2015-07-274-2/+50
| | | | | | | | | | | | | | | | | | | built by autoconfig/make instead of the individual components. Summary: When LLVM is configured to build shared libraries, CMake builds each component as it's own shared object, while autoconfig/make builds them statically and then links them all together to create a single shared object. This change adds compile time config flags to `llvm-config` so it can know whether LLVM's components are separated or not and act accordingly. This fixes `llvm-config` instead of fixing the makefiles to behave like CMake because, AIUI, LLVM's autoconfig/make build system is on the way out anyway. This change only affects `llvm-config` from builds that use autoconfig/make. Reviewers: jfb Subscribers: echristo, dschuff, llvm-commits Differential Revision: http://reviews.llvm.org/D11392 llvm-svn: 243297
* bugpoint: make the number of trim iterations a compile-time constantTobias Grosser2015-07-261-3/+9
| | | | | | | | | | | | Around 10 year ago Chris limited this code to a single iteration by just dropping a break into the loop body. We now make the number of trim iterations a compile time constant to be able to play with it and see if this can improve the bugpoint results. We currently use with '3' still a small and conservative value, but this can be adjusted in the future, if needed. I tried to look for a trivial test case, but did not succeed yet. llvm-svn: 243247
* [llvm-dwarfump] Don't rely on global state, part 3.Davide Italiano2015-07-261-11/+6
| | | | | | | | | Some tools used to rely on a global static variable to keep track of the return value for main(). I changed llvm-cxxdump to use exit(1) and Rafael shortly after did the same with llvm-readobj. This is (yet) another step towards the goal. llvm-svn: 243240
* Update for r243115 which changed the DataLayout API on TargetMachine butChandler Carruth2015-07-241-2/+1
| | | | | | didn't update the gold-plugin. llvm-svn: 243121
* Remove access to the DataLayout in the TargetMachineMehdi Amini2015-07-243-16/+16
| | | | | | | | | | | | | | | | | | | | | | Summary: Replace getDataLayout() with a createDataLayout() method to make explicit that it is intended to create a DataLayout only and not accessing it for other purpose. This change is the last of a series of commits dedicated to have a single DataLayout during compilation by using always the one owned by the module. Reviewers: echristo Subscribers: jholewinski, llvm-commits, rafael, yaron.keren Differential Revision: http://reviews.llvm.org/D11103 (cherry picked from commit 5609fc56bca971e5a7efeaa6ca4676638eaec5ea) From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 243114
* [dsymutil] Implement support for universal mach-o object files.Frederic Riss2015-07-245-107/+220
| | | | | | | | | | | | | This patch allows llvm-dsymutil to read universal (aka fat) macho object files and archives. The patch touches nearly everything in the BinaryHolder, but it is fairly mechinical: the methods that returned MemoryBufferRefs or ObjectFiles now return a vector of those, and the high-level access function takes a triple argument to select the architecture. There is no support yet for handling fat executables and thus no support for writing fat object files. llvm-svn: 243096
* [dsymutil] Make the triple detection more strict.Frederic Riss2015-07-243-8/+14
| | | | | | | | MachOObjectFile offers a method for detecting the correct triple, use it instead of the previous approximation. This doesn't matter right now, but it will become important for mach-o universal (fat) binaries. llvm-svn: 243095
* [dsymutil] Refactor BinaryHolder internals. NFCFrederic Riss2015-07-242-4/+15
| | | | | | | | Call a helper that resets all the internal state of the BinaryHolder when we change the underlying memory buffer. Makes a followup patch a tiny bit smaller. llvm-svn: 243094
* Revert "Remove access to the DataLayout in the TargetMachine"Mehdi Amini2015-07-243-16/+16
| | | | | | | | | | This reverts commit 0f720d984f419c747709462f7476dff962c0bc41. It breaks clang too badly, I need to prepare a proper patch for clang first. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 243089
* [llvm-reaobj] Display COFF-specific sections/tables only if the object is COFF.Davide Italiano2015-07-241-9/+10
| | | | | | Just skip them otherwise. llvm-svn: 243086
* Remove access to the DataLayout in the TargetMachineMehdi Amini2015-07-243-16/+16
| | | | | | | | | | | | | | | | | | | | | | Summary: Replace getDataLayout() with a createDataLayout() method to make explicit that it is intended to create a DataLayout only and not accessing it for other purpose. This change is the last of a series of commits dedicated to have a single DataLayout during compilation by using always the one owned by the module. Reviewers: echristo Subscribers: jholewinski, llvm-commits, rafael, yaron.keren Differential Revision: http://reviews.llvm.org/D11103 (cherry picked from commit 5609fc56bca971e5a7efeaa6ca4676638eaec5ea) From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 243083
* [llvm-objdump] Add -D and --disassemble-all flags that attempt disassembly ↵Colin LeMahieu2015-07-232-3/+13
| | | | | | on all sections instead of just text sections. llvm-svn: 243041
* Use helper function. NFC.Rafael Espindola2015-07-231-4/+1
| | | | llvm-svn: 243012
* Add a version of getSymbol with an explicit symbol table. Use it. NFC.Rafael Espindola2015-07-231-4/+5
| | | | llvm-svn: 243011
* Support printing relocations in files with no section table.Rafael Espindola2015-07-231-4/+9
| | | | llvm-svn: 242998
* Use typdef to simplify the code. NFC.Rafael Espindola2015-07-231-40/+41
| | | | llvm-svn: 242995
* [dsymutil] Check archive members timestamps.Frederic Riss2015-07-226-28/+66
| | | | | | | | | The debug map contains the timestamp of the object files in references. We do not check these in the general case, but it's really useful if you have archives where different versions of an object file have been appended. This allows llvm-dsymutil to find the right one. llvm-svn: 242965
* Delete ELFEntityIterator. NFC.Rafael Espindola2015-07-221-31/+34
| | | | llvm-svn: 242901
* [dsymutil] Remove extra semicolon. NFC.Benjamin Kramer2015-07-221-1/+1
| | | | llvm-svn: 242894
* [dsymutil] Implement ODR uniquing for C++ code.Frederic Riss2015-07-213-41/+490
| | | | | | | | | | | | | | | | | This optimization allows the DWARF linker to reuse definition of types it has emitted in previous CUs rather than reemitting them in each CU that references them. The size and link time gains are huge. For example when linking the DWARF for a debug build of clang, this generates a ~150M dwarf file instead of a ~700M one (the numbers date back a bit and must not be totally accurate these days). As with all the other parts of the llvm-dsymutil codebase, the goal is to keep bit-for-bit compatibility with dsymutil-classic. The code is littered with a lot of FIXMEs that should be addressed once we can get rid of the compatibilty goal. llvm-svn: 242847
* Don't iterate over the program headers in the constructor of ELFFile.Rafael Espindola2015-07-211-28/+162
| | | | | | | | | Not every program needs this information. In particular, it is necessary and sufficient for a static linker to scan the section table. llvm-svn: 242833
* Make printValue a member function.Rafael Espindola2015-07-211-6/+7
| | | | | | We were already passing 3 values it can get from ELFDumper. llvm-svn: 242829
* Remove always null argument.Rafael Espindola2015-07-211-2/+1
| | | | llvm-svn: 242828
* Remove getStaticSymbolName.Rafael Espindola2015-07-211-3/+11
| | | | | | Every user now keeps track of the correct string table to use. llvm-svn: 242818
OpenPOWER on IntegriCloud