summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* Give ExecutionEngine of top level buffers.Rafael Espindola2014-08-261-3/+1
| | | | | | | Long term the idea if for the engine to not own the buffers, but for now this is consistent with the rest of the API. llvm-svn: 216484
* Invert the condition to have a single return.Rafael Espindola2014-08-261-4/+3
| | | | | | Thanks to David Blaikie for the suggestion. llvm-svn: 216468
* Return a std::unique_ptr from the IRReader.h functions. NFC.Rafael Espindola2014-08-268-33/+27
| | | | llvm-svn: 216466
* Return a std::unique_ptr from parseInputFile and propagate. NFC.Rafael Espindola2014-08-266-110/+89
| | | | | | | | The memory management in BugPoint is fairly convoluted, so this just unwraps one layer by changing the return type of functions that always return owned Modules. llvm-svn: 216464
* Modernize raw_fd_ostream's constructor a bit.Rafael Espindola2014-08-2516-86/+82
| | | | | | | | | | Take a StringRef instead of a "const char *". Take a "std::error_code &" instead of a "std::string &" for error. A create static method would be even better, but this patch is already a bit too big. llvm-svn: 216393
* Use range based for loops to avoid needing to re-mention SmallPtrSet size.Craig Topper2014-08-241-7/+5
| | | | llvm-svn: 216351
* This code is from r216285, which did not go out to the mailing list for some ↵Aaron Ballman2014-08-241-6/+1
| | | | | | | | reason. The switch statement would never fire due to the preceding break statement. Also, the switch statement has a default label with no case labels. Simplified the code, and allow it to execute. llvm-svn: 216346
* Silence gcc -Wpedantic.Patrik Hagglund2014-08-241-1/+1
| | | | llvm-svn: 216344
* Add support for comdats to the gold plugin.Rafael Espindola2014-08-221-12/+97
| | | | | | | | | | | | | | | | | | | | | | | There are two parts to this. First, the plugin needs to tell gold the comdat by setting comdat_key. What gets things a bit more complicated is that gold only seems symbols. In particular, if A is an alias to B, it only sees the symbols A and B. It can then ask us to keep symbol A but drop symbol B. What we have to do instead is to create an internal version of B and make A an alias to that. At some point some of this logic should be moved to lib/Linker so that we don't map a Constant to an internal version just to have lib/Linker map that again to the destination module. The reason for implementing this in tools/gold for now is simplicity. With it in place it should be possible to update clang to use comdats for constructors and destructors on ELF without breaking the LTO bootstrap. Once that is done I intend to come back and improve the interface lib/Linker exposes. llvm-svn: 216302
* llvm-cov: add code coverage tool that's based on coverage mapping format and ↵Alex Lorenz2014-08-2221-4/+2558
| | | | | | | | | | | | | clang's pgo. This commit expands llvm-cov's functionality by adding support for a new code coverage tool that uses LLVM's coverage mapping format and clang's instrumentation based profiling. The gcov compatible tool can be invoked by supplying the 'gcov' command as the first argument, or by modifying the tool's name to end with 'gcov'. Differential Revision: http://reviews.llvm.org/D4445 llvm-svn: 216300
* Add the start of the support for llvm-objdump’s -private-headers for ↵Kevin Enderby2014-08-223-0/+297
| | | | | | | | Mach-O files. This adds the printing of the mach header. Load command printing will be next. llvm-svn: 216285
* Rename AtomicExpandLoadLinked into AtomicExpandRobin Morisset2014-08-211-1/+1
| | | | | | | | | | | AtomicExpandLoadLinked is currently rather ARM-specific. This patch is the first of a group that aim at making it more target-independent. See http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-August/075873.html for details The command line option is "atomic-expand" llvm-svn: 216231
* Explicitly pass ownership of the MemoryBuffer to AddNewSourceBuffer using ↵David Blaikie2014-08-212-5/+6
| | | | | | std::unique_ptr llvm-svn: 216223
* Rewrite the gold plugin to fix pr19901.Rafael Espindola2014-08-213-147/+396
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a fundamental difference between how the gold API and lib/LTO view the LTO process. The gold API talks about a particular symbol in a particular file. The lib/LTO API talks about a symbol in the merged module. The merged module is then defined in terms of the IR semantics. In particular, a linkonce_odr GV is only copied if it is used, since it is valid to drop unused linkonce_odr GVs. In the testcase in pr19901 both properties collide. What happens is that gold asks us to keep a particular linkonce_odr symbol, but the IR linker doesn't copy it to the merged module and we never have a chance to ask lib/LTO to keep it. This patch fixes it by having a more direct implementation of the gold API. If it asks us to keep a symbol, we change the linkage so it is not linkonce. If it says we can drop a symbol, we do so. All of this before we even send the module to lib/Linker. Since now we don't have to produce LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN, during symbol resolution we can use a temporary LLVMContext and do lazy module loading. This allows us to keep the minimum possible amount of allocated memory around. This should also allow as much parallelism as we want, since there is no shared context. llvm-svn: 216215
* Move some logic to populateLTOPassManager.Rafael Espindola2014-08-211-11/+5
| | | | | | | This will avoid code duplication in the next commit which calls it directly from the gold plugin. llvm-svn: 216211
* llvm-gcc is dead.Rafael Espindola2014-08-211-4/+3
| | | | llvm-svn: 216206
* Handle inlining in populateLTOPassManager like in populateModulePassManager.Rafael Espindola2014-08-212-2/+5
| | | | | | No functionality change. llvm-svn: 216178
* Move DisableGVNLoadPRE from populateLTOPassManager to PassManagerBuilder.Rafael Espindola2014-08-212-2/+2
| | | | llvm-svn: 216174
* IntelJITEventListener updates to fix breaks by recent changes to ↵Elena Demikhovsky2014-08-211-3/+2
| | | | | | | | EngineBuilder and DIContext. By Arch Robison. llvm-svn: 216159
* Quick fix for an use after free.Rafael Espindola2014-08-201-1/+4
| | | | llvm-svn: 216071
* IR: Implement uselistorder assembly directivesDuncan P. N. Exon Smith2014-08-191-3/+6
| | | | | | | | | | Implement `uselistorder` and `uselistorder_bb` assembly directives, which allow the use-list order to be recovered when round-tripping to assembly. This is the bulk of PR20515. llvm-svn: 216025
* verify-uselistorder: Force -preserve-bc-use-list-orderDuncan P. N. Exon Smith2014-08-191-3/+2
| | | | llvm-svn: 216022
* Don't own the buffer in object::Binary.Rafael Espindola2014-08-1913-53/+72
| | | | | | | | | | | | | | | | | | | | | | | | | Owning the buffer is somewhat inflexible. Some Binaries have sub Binaries (like Archive) and we had to create dummy buffers just to handle that. It is also a bad fit for IRObjectFile where the Module wants to own the buffer too. Keeping this ownership would make supporting IR inside native objects particularly painful. This patch focuses in lib/Object. If something elsewhere used to own an Binary, now it also owns a MemoryBuffer. This patch introduces a few new types. * MemoryBufferRef. This is just a pair of StringRefs for the data and name. This is to MemoryBuffer as StringRef is to std::string. * OwningBinary. A combination of Binary and a MemoryBuffer. This is needed for convenience functions that take a filename and return both the buffer and the Binary using that buffer. The C api now uses OwningBinary to avoid any change in semantics. I will start a new thread to see if we want to change it and how. llvm-svn: 216002
* Modernize the .ll parsing interface.Rafael Espindola2014-08-192-2/+2
| | | | | | | | | | * Use StringRef instead of std::string& * Return a std::unique_ptr<Module> instead of taking an optional module to write to (was not really used). * Use current comment style. * Use current naming convention. llvm-svn: 215989
* Make it explicit that ExecutionEngine takes ownership of the modules.Rafael Espindola2014-08-191-8/+9
| | | | llvm-svn: 215967
* verify-uselistorder: Call verifyModule() and improve outputDuncan P. N. Exon Smith2014-08-181-29/+33
| | | | | | | | Call `verifyModule()` after parsing and after every transformation. Also convert some `DEBUG(dbgs())` to `errs()` to increase visibility into what's going on. llvm-svn: 215951
* Make llvm-objdump handle both arm and thumb disassembly from the same Mach-OKevin Enderby2014-08-181-10/+77
| | | | | | | | | | file with -macho, the Mach-O specific object file parser option. After some discussion I chose to do this implementation contained in the logic of llvm-objdump’s MachODump.cpp using a second disassembler for thumb when needed and with updates mostly contained in the MachOObjectFile class. llvm-svn: 215931
* llvm-objdump: don't print relocations in non-relocatable files.Rafael Espindola2014-08-171-0/+5
| | | | | | This matches the behavior of GNU objdump. llvm-svn: 215844
* Fix an off-by-one bug in the target independent llvm-objdump.Rafael Espindola2014-08-171-10/+5
| | | | | | | | It would prevent the display of a single byte instruction before a label. Patch by Steve King! llvm-svn: 215837
* Silencing some -Wcast-qual warnings and removing some C-style casts at the ↵Aaron Ballman2014-08-141-2/+3
| | | | | | same time. NFC. llvm-svn: 215643
* Simplify ownership with std::unique_ptr. NFC.Rafael Espindola2014-08-131-2/+3
| | | | llvm-svn: 215566
* Canonicalize header guards into a common format.Benjamin Kramer2014-08-1328-59/+59
| | | | | | | | | | Add header guards to files that were missing guards. Remove #endif comments as they don't seem common in LLVM (we can easily add them back if we decide they're useful) Changes made by clang-tidy with minor tweaks. llvm-svn: 215558
* llvm-objdump: print contents of MachO __unwind_info sectionsTim Northover2014-08-121-11/+249
| | | | llvm-svn: 215437
* Fix using -plugin-opt=apiflie when also using -plugin-opt=emit-llvm.Rafael Espindola2014-08-111-18/+25
| | | | llvm-svn: 215378
* llvm-objdump: fix remaining use of %x format specifier for 64-bit valuesTim Northover2014-08-111-1/+1
| | | | | | Third time lucky. This should finally fix the ARM (& MIPS, I think) bots. llvm-svn: 215349
* getLoadName is only implemented for ELF, make it ELF only.Rafael Espindola2014-08-081-1/+13
| | | | llvm-svn: 215219
* Use a simpler predicate. NFC.Rafael Espindola2014-08-082-4/+2
| | | | llvm-svn: 215218
* llvm-objdump: add missing % in format specifier.Tim Northover2014-08-081-2/+2
| | | | llvm-svn: 215198
* llvm-objdump: use portable format specifiers for info.Tim Northover2014-08-081-6/+6
| | | | | | | | ARM bots (& others, I think, now that I look) were failing because we were using incorrect printf-style format specifiers. They were wrong on almost any platform, actually, just mostly harmlessly so. llvm-svn: 215196
* Temporarily Revert "Nuke the old JIT." as it's not quite ready toEric Christopher2014-08-078-13/+41
| | | | | | | | | | | be deleted. This will be reapplied as soon as possible and before the 3.6 branch date at any rate. Approved by Jim Grosbach, Lang Hames, Rafael Espindola. This reverts commits r215111, 215115, 215116, 215117, 215136. llvm-svn: 215154
* fix configure+make buildRafael Espindola2014-08-072-2/+2
| | | | llvm-svn: 215116
* Nuke the old JIT.Rafael Espindola2014-08-076-39/+11
| | | | | | | | | I am sure we will be finding bits and pieces of dead code for years to come, but this is a good start. Thanks to Lang Hames for making MCJIT a good replacement! llvm-svn: 215111
* Add the -mcpu= option to llvm-objdump for use with the disassemblers.Kevin Enderby2014-08-063-4/+21
| | | | | | | Also make the disassembler created with the Mach-O parser (the -m option) pick up the Target specific attributes specified with -mattr option. llvm-svn: 215032
* [MCJIT] Make llvm-rtdyld check RuntimeDyld's error state when running in -verifyLang Hames2014-08-051-1/+8
| | | | | | | | | | mode. This will cause -verify mode to report failure when RuntimeDyld encounters an internal error (e.g. overflows in relocation computations). Previously we had let these errors slip past unreported. llvm-svn: 214925
* Don't internalize all but main by default.Rafael Espindola2014-08-052-8/+2
| | | | | | | | | | | | | | | This is mostly a cleanup, but it changes a fairly old behavior. Every "real" LTO user was already disabling the silly internalize pass and creating the internalize pass itself. The difference with this patch is for "opt -std-link-opts" and the C api. Now to get a usable behavior out of opt one doesn't need the funny looking command line: opt -internalize -disable-internalize -internalize-public-api-list=foo,bar -std-link-opts llvm-svn: 214919
* Remove the TargetMachine forwards for TargetSubtargetInfo basedEric Christopher2014-08-041-1/+2
| | | | | | information and update all callers. No functional change. llvm-svn: 214781
* verify-uselistorder: Reverse use-lists at every verificationDuncan P. N. Exon Smith2014-08-011-21/+69
| | | | | | | | | | | | | | | | | Updated `verify-uselistorder` to more than double the number of use-list orders it checks. - Every time it verifies an order, it then reverses the order and verifies again. - It now verifies the initial order, before running any shuffles. Changed the default to `-num-shuffles=1`, since this is already four checks, and after r214584 shuffling is guaranteed to make a new order. This is part of PR5680. llvm-svn: 214596
* verify-uselistorder: Add missing `static`Duncan P. N. Exon Smith2014-08-011-1/+1
| | | | llvm-svn: 214595
* verify-uselistorder: Move shuffleUseLists() out of lib/IRDuncan P. N. Exon Smith2014-08-011-5/+100
| | | | | | | | | | `shuffleUseLists()` is only used in `verify-uselistorder`, so move it there to avoid bloating other executables. As a drive-by, update some of the header docs. This is part of PR5680. llvm-svn: 214592
* verify-uselistorder: Make the verification logic easier to reuseDuncan P. N. Exon Smith2014-08-011-6/+10
| | | | llvm-svn: 214587
OpenPOWER on IntegriCloud