summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Remove always false parameter.Rafael Espindola2015-07-211-5/+4
| | | | llvm-svn: 242802
* Use range loop. NFC.Rafael Espindola2015-07-211-3/+3
| | | | llvm-svn: 242801
* Replace the last uses of ELF::getSymbolName in llvm-readobj.Rafael Espindola2015-07-212-2/+8
| | | | llvm-svn: 242798
* Use helper function. NFC.Rafael Espindola2015-07-211-3/+1
| | | | llvm-svn: 242795
* llvm-readobj: use the associated string table to print symbols. NFI.Rafael Espindola2015-07-211-16/+44
| | | | | | | This just removes some cases that require ELFFile to eagerly parse the ELF file. llvm-svn: 242794
* [CMake] Projects supported via LLVM_EXTERNAL_*_SOURCE_DIR need to be ↵Chris Bieneman2015-07-211-0/+7
| | | | | | | | explicitly specified. One part of my refactoring from r242705 is untenable due to how CMake caches variables. There is no way other than caching to allow variables to be set in one directory and globally readable, but we really don't want to cache the temporary value marking that a directory has already been included. llvm-svn: 242793
* Simplify printing the soname. NFC.Rafael Espindola2015-07-213-14/+7
| | | | llvm-svn: 242786
* Add missing c++ marker to .h file.Rafael Espindola2015-07-211-1/+1
| | | | llvm-svn: 242784
* Remove duplicated code.Rafael Espindola2015-07-201-4/+4
| | | | | | Both ELFObjectFile and ELFFile had an implementation of getLoadName. llvm-svn: 242725
* Simplify now that we can iterate backwards. NFC.Rafael Espindola2015-07-201-3/+16
| | | | llvm-svn: 242715
* [CMake] Cleanup tools/CMakeLists.txt to take advantage of the ↵Chris Bieneman2015-07-201-69/+21
| | | | | | | | | | | | | | | | | | | | | auto-registration that was already partially working. Re-landing r242059 which re-landed r241621... I'm really bad at this. Summary (r242059): This change re-lands r241621, with an additional fix that was required to allow tool sources to live outside the llvm checkout. It also no longer renames LLVM_EXTERNAL_*_SOURCE_DIR. This change was reverted in r241663, because it renamed several variables of the format LLVM_EXTERNAL_*_* to LLVM_TOOL_*_*. Summary (r241621): The tools CMakeLists file already had implicit tool registration, but there were a few things off about it that needed to be altered to make it work. This change addresses all that. The changes in this patch are: * factored out canonicalizing tool names from paths to CMake variables * removed the LLVM_IMPLICIT_PROJECT_IGNORE mechanism in favor of LLVM_EXTERNAL_${nameUPPER}_BUILD which I renamed to LLVM_TOOL_${nameUPPER}_BUILD because it applies to internal and external tools * removed ignore_llvm_tool_subdirectory() in favor of just setting LLVM_TOOL_${nameUPPER}_BUILD to Off * Added create_llvm_tool_options() to resolve a bug in add_llvm_external_project() - the old LLVM_EXTERNAL_${nameUPPER}_BUILD would not work on a clean CMake directory because the option could be created after it was set in code. * Removed all but the minimum required calls to add_llvm_external_project from tools/CMakeLists.txt Differential Revision: http://reviews.llvm.org/D10665 llvm-svn: 242705
* Remove Elf_Rela_Iter and Elf_Rel_Iter.Rafael Espindola2015-07-202-34/+24
| | | | | | Use just the pointers and check for invalid relocation sections. llvm-svn: 242700
* Simplify iterating over program headers and detect corrupt ones.Rafael Espindola2015-07-202-33/+23
| | | | | | We now use a simple pointer and have range loops. llvm-svn: 242669
* llvm-readobj: Handle invalid references to the string table.Rafael Espindola2015-07-203-7/+16
| | | | llvm-svn: 242658
* llvm-readobj: call exit(1) on error.Rafael Espindola2015-07-206-91/+61
| | | | | | | | | llvm-readobj exists for testing llvm. We can safely stop the program the first time we know the input in corrupted. This is in preparation for making it handle a few more broken files. llvm-svn: 242656
* Refactor duplicated code. NFC.Rafael Espindola2015-07-201-8/+9
| | | | llvm-svn: 242655
* [llvm-cxxdump] Don't rely on global stateDavide Italiano2015-07-171-41/+18
| | | | | | Differential Revision: http://reviews.llvm.org/D11227 llvm-svn: 242509
* Delete an unused function.Rafael Espindola2015-07-161-16/+0
| | | | | | Patch by Xan López! llvm-svn: 242429
* For new archive member we only need to store the full path.Rafael Espindola2015-07-151-9/+7
| | | | | | | We were storing both the path and the file name, which was redundant and easy to get confused up with. llvm-svn: 242347
* Simplify a few uses of remove_filename by using parent_path instead.Rafael Espindola2015-07-151-2/+1
| | | | llvm-svn: 242334
* Handle the error of trying to convert a regular archive to a thin one.Rafael Espindola2015-07-151-2/+13
| | | | | | While at it, test that we can add to a thin archive. llvm-svn: 242330
* Initial support for writing thin archives.Rafael Espindola2015-07-151-3/+7
| | | | llvm-svn: 242269
* Add support for reading members out of thin archives.Rafael Espindola2015-07-141-2/+4
| | | | | | | | | | For now the Archive owns the buffers of the thin archive members. This makes for a simple API, but all the buffers are destructed only when the archive is destructed. This should be fine since we close the files after mmap so we should not hit an open file limit. llvm-svn: 242215
* llvm-ar: Don't try to extract from thin archives.Rafael Espindola2015-07-141-0/+5
| | | | | | This matches the gnu ar behavior. llvm-svn: 242162
* llvm-ar: print an error when the requested member is not found.Rafael Espindola2015-07-141-3/+12
| | | | llvm-svn: 242156
* Use a range loop. NFC.Rafael Espindola2015-07-141-19/+17
| | | | llvm-svn: 242153
* Revert "Fix `llvm-config` to emit the linker flag for the combined shared ↵JF Bastien2015-07-144-50/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | object built by autoconfig/make instead of the individual components." This reverts commit 01446706b4c0a86bb64768f307079cab5c514aa3. Causes breakage, seems to be related to 'svn' in the file's name: CC=gcc CXX=g++ \ ../llvm/configure \ --prefix=/usr \ --sysconfdir=/etc \ --enable-shared \ --enable-libffi \ --enable-targets=all \ --disable-assertions \ --with-python=/usr/bin/python2 \ --enable-optimized make REQUIRES_RTTI=1 ENABLE_PIC=1 results: llvm[2]: Linking Release unit test Support (without symbols) llvm[2]: ======= Finished Linking Release Unit test Support (without symbols) make[3]: Entering directory '/build/llvm-svn/src/build/bindings/ocaml/llvm' make[3]: *** No rule to make target '/build/llvm- svn/src/build/Release/lib/ocaml/libLLVM-3.7.0svn.so', needed by 'build- deplibs'. Stop. make[3]: *** Waiting for unfinished jobs.... llvm[3]: Compiling llvm_ocaml.c for Release build make[3]: Leaving directory '/build/llvm-svn/src/build/bindings/ocaml/llvm' /build/llvm-svn/src/llvm/Makefile.rules:880: recipe for target 'all' failed /build/llvm-svn/src/llvm/Makefile.rules:965: recipe for target 'all' failed Differential Revision: http://reviews.llvm.org/D10716 llvm-svn: 242152
OpenPOWER on IntegriCloud