- Aug 27, 2014
-
-
Craig Topper authored
Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or just letting them be implicitly created. llvm-svn: 216525
-
Rafael Espindola authored
By taking a reference we can do the ownership transfer in one place instead of expecting every caller to do it. llvm-svn: 216492
-
- Aug 26, 2014
-
-
Rafael Espindola authored
The attached patch simplifies a few interfaces that don't need to take ownership of a buffer. For example, both parseAssembly and parseBitcodeFile will parse the entire buffer before returning. There is no need to take ownership. Using a MemoryBufferRef makes it obvious in the type signature that there is no ownership transfer. llvm-svn: 216488
-
Rafael Espindola authored
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
-
Rafael Espindola authored
Thanks to David Blaikie for the suggestion. llvm-svn: 216468
-
Rafael Espindola authored
llvm-svn: 216466
-
Rafael Espindola authored
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
-
- Aug 25, 2014
-
-
Rafael Espindola authored
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
-
Craig Topper authored
llvm-svn: 216351
-
- Aug 24, 2014
-
-
Aaron Ballman authored
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
-
Patrik Hagglund authored
llvm-svn: 216344
-
- Aug 23, 2014
-
-
Rafael Espindola authored
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
-
Alex Lorenz authored
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
-
- Aug 22, 2014
-
-
Kevin Enderby authored
This adds the printing of the mach header. Load command printing will be next. llvm-svn: 216285
-
- Aug 21, 2014
-
-
Robin Morisset authored
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
-
David Blaikie authored
llvm-svn: 216223
-
Rafael Espindola authored
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
-
Rafael Espindola authored
This will avoid code duplication in the next commit which calls it directly from the gold plugin. llvm-svn: 216211
-
Rafael Espindola authored
llvm-svn: 216206
-
Rafael Espindola authored
No functionality change. llvm-svn: 216178
-
Rafael Espindola authored
llvm-svn: 216174
-
Elena Demikhovsky authored
By Arch Robison. llvm-svn: 216159
-
- Aug 20, 2014
-
-
Rafael Espindola authored
llvm-svn: 216071
-
- Aug 19, 2014
-
-
Duncan P. N. Exon Smith authored
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
-
Duncan P. N. Exon Smith authored
llvm-svn: 216022
-
Rafael Espindola authored
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
-
Rafael Espindola authored
* 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
-
Rafael Espindola authored
llvm-svn: 215967
-
Duncan P. N. Exon Smith authored
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
-
- Aug 18, 2014
-
-
Kevin Enderby authored
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
-
- Aug 17, 2014
-
-
Rafael Espindola authored
This matches the behavior of GNU objdump. llvm-svn: 215844
-
Rafael Espindola authored
It would prevent the display of a single byte instruction before a label. Patch by Steve King! llvm-svn: 215837
-
- Aug 14, 2014
-
-
Aaron Ballman authored
llvm-svn: 215643
-
- Aug 13, 2014
-
-
Rafael Espindola authored
llvm-svn: 215566
-
Benjamin Kramer authored
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
-
- Aug 12, 2014
-
-
Tim Northover authored
llvm-svn: 215437
-
- Aug 11, 2014
-
-
Rafael Espindola authored
llvm-svn: 215378
-
Tim Northover authored
Third time lucky. This should finally fix the ARM (& MIPS, I think) bots. llvm-svn: 215349
-
- Aug 08, 2014
-
-
Rafael Espindola authored
llvm-svn: 215219
-
Rafael Espindola authored
llvm-svn: 215218
-