summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* Silence gcc 4.9.1 warning 'xyz' is used uninitialized in this function.Yaron Keren2014-12-121-7/+7
| | | | | | | | In release builds this is actually possible as without asserts there is no testing of the actual read bytes and the variables could be partially uninitialized. llvm-svn: 224114
* Pass output stream to AsLexInput instead of the whole tool_output_file.Craig Topper2014-12-121-46/+46
| | | | llvm-svn: 224109
* Use unique_ptr to remove an explicit delete. Change return type to pass the ↵Craig Topper2014-12-121-5/+4
| | | | | | unique_ptr to caller. llvm-svn: 224108
* Use make_unique instead of reset() and 'new'Craig Topper2014-12-121-1/+2
| | | | llvm-svn: 224107
* Use range-based for loop.Craig Topper2014-12-121-2/+2
| | | | llvm-svn: 224106
* Remove unnecessary calls to unique_ptr::get.Craig Topper2014-12-121-7/+7
| | | | llvm-svn: 224105
* Remove an unnecessary reference variable that pointed to a unique_ptr ↵Craig Topper2014-12-121-6/+5
| | | | | | variable. Just use the unique_ptr variable directly. llvm-svn: 224104
* Use unique_ptr operator= instead of constructor to make it explicit that ↵Craig Topper2014-12-121-2/+2
| | | | | | there's no conversion occurring. llvm-svn: 224103
* Bitcode: Add METADATA_NODE and METADATA_VALUEDuncan P. N. Exon Smith2014-12-111-0/+2
| | | | | | | | | | | | | | | | This reflects the typelessness of `Metadata` in the bitcode format, removing types from all metadata operands. `METADATA_VALUE` represents a `ValueAsMetadata`, and always has two fields: the type and the value. `METADATA_NODE` represents an `MDNode`, and unlike `METADATA_OLD_NODE`, doesn't store types. It stores operands at their ID+1 so that `0` can reference `nullptr` operands. Part of PR21532. llvm-svn: 224073
* Bitcode: Add `OLD_` prefix to metadata node recordsDuncan P. N. Exon Smith2014-12-111-2/+2
| | | | | | | | I'm about to change these, so move the old ones out of the way. Part of PR21532. llvm-svn: 224070
* Only seek once before writing the member offsets.Rafael Espindola2014-12-111-18/+20
| | | | | | | This cuts down the number on system calls done by a static llvm-ar producing lib/libclangSema.a from 9164 to 442. llvm-svn: 224025
* llvm-ar: close input files early.Rafael Espindola2014-12-111-16/+13
| | | | | | We already have them mapped into memory, so we can just close the file. llvm-svn: 224020
* Just use the Module unique_ptr object directly in many places instead of ↵Craig Topper2014-12-111-8/+6
| | | | | | separate pointer that's kept in sync with it. llvm-svn: 224004
* Use unique_ptr to remove an explicit delete. Change return type to pass the ↵Craig Topper2014-12-111-5/+5
| | | | | | unique_ptr to caller. llvm-svn: 224003
* Simplify the handling of aliases in the gold plugin.Rafael Espindola2014-12-101-49/+33
| | | | | | | | | | | | | | | The complicated situation is when we have to keep an alias but drop a GV that is part of the aliasee. We used to clone the dropped GV and make the clone internal. This is wasteful as we know the original will be dropped. With this patch what is done instead is set the linkage of the original to internal and replace all uses (but the one in the alias) with a new declaration that takes the name of the old GV. This saves us from having to copy the body. llvm-svn: 223863
* Return ErrorOr<std::unique_ptr<Archive>> form getAsArchive.Rafael Espindola2014-12-093-18/+25
| | | | | | This is the same return type of Archive::create. llvm-svn: 223827
* Rename createIRObjectFile to just create.Rafael Espindola2014-12-091-2/+2
| | | | | | | It is a static method of IRObjectFile, so having to use IRObjectFile::createIRObjectFile was redundant. llvm-svn: 223822
* Adding a new option to CMake to disable C++ atexit on llvm-shlib.Chris Bieneman2014-12-091-0/+7
| | | | | | | | | | | | | | | | | Summary: This is desirable for WebKit and other clients of the llvm-shlib because C++ exit time destructors have a tendency to crash when invoked from multi-threaded applications. Ideally this option will be temporary, because the ideal fix is to just not have exit time destructors. Reviewers: chapuni, ributzka Reviewed By: ributzka Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6572 llvm-svn: 223805
* Revert "Initial dsymutil tool commit."Frederic Riss2014-12-0913-668/+2
| | | | | | This reverts commit r223793. The review thread wasn't concluded. llvm-svn: 223794
* Initial dsymutil tool commit.Frederic Riss2014-12-0913-2/+668
| | | | | | | | | | | | | | | | | | | | | | | | The goal of this tool is to replicate Darwin's dsymutil functionality based on LLVM. dsymutil is a DWARF linker. Darwin's linker (ld64) does not link the debug information, it leaves it in the object files in relocatable form, but embbeds a `debug map` into the executable that describes where to find the debug information and how to relocate it. When releasing/archiving a binary, dsymutil is called to link all the DWARF information into a `dsym bundle` that can distributed/stored along with the binary. With this commit, the LLVM based dsymutil is just able to parse the STABS debug maps embedded by ld64 in linked binaries (and not all of them, for example archives aren't supported yet). Note that the tool directory is called dsymutil, but the executable is currently called llvm-dsymutil. This discrepancy will disappear once the tool will be feature complete. At this point the executable will be renamed to dsymutil, but until then you do not want it to override the system one. Differential Revision: http://reviews.llvm.org/D6242 llvm-svn: 223793
* Remember the unmangled name in the plugin.Rafael Espindola2014-12-091-3/+3
| | | | | | | | | This allows it to work with non trivial manglings like the one in COFF. Amusingly, this can be tested with gold, as emit-llvm causes the plugin to exit before any COFF is generated. llvm-svn: 223790
* Don't lookup an object symbol name in the module.Rafael Espindola2014-12-091-21/+27
| | | | | | | | | | | Instead, walk the obj symbol list in parallel to find the GV. This shouldn't change anything on ELF where global symbols are not mangled, but it is a step toward supporting other object formats. Gold itself is ELF only, but bfd ld supports COFF and the logic in the gold plugin could be reused on lld. llvm-svn: 223780
* [CMake] Fix installation of llvm-ranlib on multiconfig builder.NAKAMURA Takumi2014-12-082-1/+26
| | | | | | | Introduce install_symlink.cmake from clang/tools/driver/clang_symlink.cmake. FIXME: Would it be generalized? llvm-svn: 223655
* Be less conservative about when we build the gold plugin.Rafael Espindola2014-12-052-16/+2
| | | | | | | It is only build if LLVM_BINUTILS_INCDIR is explicitly given, so there is no point in having extra restrictions. llvm-svn: 223481
* Re-add support to llvm-objdump for Mach-O universal files and archives with ↵Kevin Enderby2014-12-042-18/+241
| | | | | | | | | | | -macho with fixes. Includes the move of tests for llvm-objdump for universal files to an X86 directory. And the fix where it was failing on linux Rafael tracked down with asan. I had both Jim Grosbach and Adam Hemet look over the second fix since I could not set up asan to reproduce with the old version but not with the fix. llvm-svn: 223416
* Add mach-o LC_RPATH support to llvm-objdumpJean-Daniel Dupas2014-12-041-0/+19
| | | | | | | | | | Summary: Add rpath load command support in Mach-O object and update llvm-objdump to use it. Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6512 llvm-svn: 223343
* Introduce "llvm-ranlib" as a name of targets since ↵NAKAMURA Takumi2014-12-041-1/+1
| | | | | | Object/archive-symtab.test requires llvm-ranlib. llvm-svn: 223332
* For copy, cmake needs the full path to llvm-ar.Rafael Espindola2014-12-041-1/+2
| | | | | | This should fix the windows build. llvm-svn: 223324
* Add missing dependency on llvm-ar. Should hopefully fix the bots.Rafael Espindola2014-12-041-1/+2
| | | | llvm-svn: 223321
* This reverts commit r223306 and r223277.Rafael Espindola2014-12-032-241/+18
| | | | | | The code is using uninitialized memory and failing on linux. llvm-svn: 223315
* Make llvm-ar a real build target and install it.Rafael Espindola2014-12-031-10/+5
| | | | llvm-svn: 223309
* Add support to llvm-objdump for Mach-O universal files and archives with -macho.Kevin Enderby2014-12-032-18/+241
| | | | llvm-svn: 223277
* Prologue supportPeter Collingbourne2014-12-031-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by Ben Gamari! This redefines the `prefix` attribute introduced previously and introduces a `prologue` attribute. There are a two primary usecases that these attributes aim to serve, 1. Function prologue sigils 2. Function hot-patching: Enable the user to insert `nop` operations at the beginning of the function which can later be safely replaced with a call to some instrumentation facility 3. Runtime metadata: Allow a compiler to insert data for use by the runtime during execution. GHC is one example of a compiler that needs this functionality for its tables-next-to-code functionality. Previously `prefix` served cases (1) and (2) quite well by allowing the user to introduce arbitrary data at the entrypoint but before the function body. Case (3), however, was poorly handled by this approach as it required that prefix data was valid executable code. Here we redefine the notion of prefix data to instead be data which occurs immediately before the function entrypoint (i.e. the symbol address). Since prefix data now occurs before the function entrypoint, there is no need for the data to be valid code. The previous notion of prefix data now goes under the name "prologue data" to emphasize its duality with the function epilogue. The intention here is to handle cases (1) and (2) with prologue data and case (3) with prefix data. References ---------- This idea arose out of discussions[1] with Reid Kleckner in response to a proposal to introduce the notion of symbol offsets to enable handling of case (3). [1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-May/073235.html Test Plan: testsuite Differential Revision: http://reviews.llvm.org/D6454 llvm-svn: 223189
* [MCJIT] Unique-ptrify the RTDyldMemoryManager member of MCJIT. NFC.Lang Hames2014-12-031-1/+5
| | | | llvm-svn: 223183
* DebugIR: Delete -debug-irDuncan P. N. Exon Smith2014-11-292-10/+0
| | | | llvm-svn: 222945
* [MCJIT] Update CMakeLists.txt for llvm-rtdyld to add Object as a requirement.Lang Hames2014-11-271-0/+1
| | | | | | | Hopefully this will fix http://bb.pgr.jp/builders/clang-3stage-x86_64-linux/builds/8271/steps/stage1_build/logs/stdio llvm-svn: 222866
* Teach LLVM about llgo subproject.Peter Collingbourne2014-11-272-3/+33
| | | | llvm-svn: 222860
* Object/COFF: Fix off-by-one error for object having lots of relocationsRui Ueyama2014-11-261-1/+3
| | | | | | | | | llvm-objdump printed out an error message for this off-by-one error, but because it always exits with 0 whether or not it found an error, the test (llvm-objdump/coff-many-relocs.test) succeeded. I made llvm-objdump exit with EXIT_FAILURE when an error is found. llvm-svn: 222852
* [MCJIT] Reapply r222828 and r222810-r222812 with fix for MSVC move-op issues.Lang Hames2014-11-264-22/+42
| | | | llvm-svn: 222840
* Reverting r222828 and r222810-r222812 as they broke the build on Windows.Aaron Ballman2014-11-264-42/+22
| | | | | | http://bb.pgr.jp/builders/ninja-clang-i686-msc17-R/builds/11753 llvm-svn: 222833
* [MCJIT] Clean up RuntimeDyld's quirky object-ownership/modification scheme.Lang Hames2014-11-264-22/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, when loading an object file, RuntimeDyld (1) took ownership of the ObjectFile instance (and associated MemoryBuffer), (2) potentially modified the object in-place, and (3) returned an ObjectImage that managed ownership of the now-modified object and provided some convenience methods. This scheme accreted over several years as features were tacked on to RuntimeDyld, and was both unintuitive and unsafe (See e.g. http://llvm.org/PR20722). This patch fixes the issue by removing all ownership and in-place modification of object files from RuntimeDyld. Existing behavior, including debugger registration, is preserved. Noteworthy changes include: (1) ObjectFile instances are now passed to RuntimeDyld by const-ref. (2) The ObjectImage and ObjectBuffer classes have been removed entirely, they existed to model ownership within RuntimeDyld, and so are no longer needed. (3) RuntimeDyld::loadObject now returns an instance of a new class, RuntimeDyld::LoadedObjectInfo, which can be used to construct a modified object suitable for registration with the debugger, following the existing debugger registration scheme. (4) The JITRegistrar class has been removed, and the GDBRegistrar class has been re-written as a JITEventListener. This should fix http://llvm.org/PR20722 . llvm-svn: 222810
* gold plugin: call llvm_shutdown so that -stats works.Rafael Espindola2014-11-251-0/+3
| | | | llvm-svn: 222787
* Correctly handle Tag_CPU_arch_profile.Charlie Turner2014-11-251-1/+1
| | | | | | | | Fix ARMAttributeParser::CPU_arch_profile so that it doesn't switch on the value '0' as a legal value of this build attribute. Change-Id: Ie05a08900a82bb10b78c841b437df747ce3bb38e llvm-svn: 222743
* Add a disable-output option to the gold plugin.Rafael Espindola2014-11-241-9/+20
| | | | | | This corresponds to the opt option and is handy for profiling. llvm-svn: 222687
* gold-plugin: Fix typo in error messageDuncan P. N. Exon Smith2014-11-191-1/+1
| | | | | | Spotted while reading code. llvm-svn: 222395
* Fix Use-of-uninitialized-value for adrp_addr and adrp_inst in MachODump.cppKevin Enderby2014-11-191-0/+4
| | | | | | Fixes PR21607 llvm-svn: 222385
* [llvm-readobj][NFC]Colin LeMahieu2014-11-191-1/+2
| | | | | | Appeasing mingw without C++11 std::to_string llvm-svn: 222369
* Remove StringMap::GetOrCreateValue in favor of StringMap::insertDavid Blaikie2014-11-191-5/+1
| | | | | | | | | | | | | | Having two ways to do this doesn't seem terribly helpful and consistently using the insert version (which we already has) seems like it'll make the code easier to understand to anyone working with standard data structures. (I also updated many references to the Entry's key and value to use first() and second instead of getKey{Data,Length,} and get/setValue - for similar consistency) Also removes the GetOrCreateValue functions so there's less surface area to StringMap to fix/improve/change/accommodate move semantics, etc. llvm-svn: 222319
* Make StringSet::insert return pair<iterator, bool> like other ↵David Blaikie2014-11-191-1/+1
| | | | | | | | | | | | self-associative containers StringSet is still a bit dodgy in that it exposes the raw iterator of the StringMap parent, which exposes the weird detail that StringSet actually has a 'value'... but anyway, this is useful for a handful of clients that want to reference the newly inserted/persistent string data in the StringSet/Map/Entry/thing. llvm-svn: 222302
* llvm-readobj: fix off-by-one error in COFFDumperRui Ueyama2014-11-191-4/+1
| | | | | | | | It printed out base relocation table header as table entry. This patch also makes llvm-readobj to not skip ABSOLUTE entries becuase it was confusing. llvm-svn: 222299
OpenPOWER on IntegriCloud