summaryrefslogtreecommitdiffstats
path: root/llvm/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* uselistorder: Pull the bit through PrintModulePassDuncan P. N. Exon Smith2015-04-154-4/+11
| | | | | | | Now the callers of `PrintModulePass()` (etc.) that care about use-list order in assembly pass in the flag. llvm-svn: 234969
* uselistorder: Pull the assembly bit up out of the printerDuncan P. N. Exon Smith2015-04-153-10/+5
| | | | | | | | Pull the `-preserve-ll-uselistorder` bit up through all the callers of `Module::print()`. I converted callers of `operator<<` to `Module::print()` where necessary to pull the bit through. llvm-svn: 234968
* Change range-based for-loops to be -Wrange-loop-analysis clean.Richard Trieu2015-04-151-13/+16
| | | | | | No functionality change. llvm-svn: 234963
* uselistorder: Pull bit through BitcodeWriterPassDuncan P. N. Exon Smith2015-04-154-6/+12
| | | | | | | Now the callers of `BitcodeWriterPass` decide whether or not to preserve bitcode use-list order. llvm-svn: 234959
* Fix build error from r234957Duncan P. N. Exon Smith2015-04-151-2/+1
| | | | llvm-svn: 234958
* uselistorder: Pull the bit through WriteToBitcodFile()Duncan P. N. Exon Smith2015-04-155-11/+10
| | | | | | | | | | | Change the callers of `WriteToBitcodeFile()` to pass `true` or `shouldPreserveBitcodeUseListOrder()` explicitly. I left the callers that want to send `false` alone. I'll keep pushing the bit higher until hopefully I can delete the global `cl::opt` entirely. llvm-svn: 234957
* Use raw_pwrite_stream in the object writer/streamer.Rafael Espindola2015-04-142-5/+21
| | | | | | The ELF object writer will take advantage of that in the next commit. llvm-svn: 234950
* verify-uselistorder: More outs() and errs(), less dbgs()Duncan P. N. Exon Smith2015-04-141-14/+17
| | | | | | | | | | | | | | Change all the normally relevant output in `verify-uselistorder` from using `dbgs()` to using `outs()` and `errs()`. Now you don't need `-debug=uselistorder` to figure out what's going on (or at what stage verification failed, or to get the paths of the left-behind temporary files). This is a debugging tool, so I put the logging messages on `outs()` and the error messages on `errs()`. I also adjusted the output to be less ***loud***. Not sure why I was so `*`-happy when I first wrote this. llvm-svn: 234929
* IR: Set -preserve-bc-uselistorder=false by defaultDuncan P. N. Exon Smith2015-04-145-0/+28
| | | | | | | But keep it on by default in `llvm-as`, `opt`, `bugpoint`, `llvm-link`, `llvm-extract`, and `LTOCodeGenerator`. Part of PR5680. llvm-svn: 234921
* IR: Rename 'use-list-order' options to 'uselistorder'Duncan P. N. Exon Smith2015-04-141-8/+8
| | | | | | | Rename options to be consistent with the name of `verify-uselistorder`, and update `DEBUG_TYPE` (etc.) to be consistent. llvm-svn: 234919
* [Orc] Reapply r234815, outputting via stdout instead.Lang Hames2015-04-141-11/+12
| | | | llvm-svn: 234908
* Silencing a -Wreturn-type warning, as the switch is fully-covered; NFC.Aaron Ballman2015-04-141-0/+1
| | | | llvm-svn: 234884
* DebugInfo: Gut DISubprogram and DILexicalBlock*Duncan P. N. Exon Smith2015-04-141-3/+3
| | | | | | | Gut the `DIDescriptor` wrappers around `MDLocalScope` subclasses. Note that `DILexicalBlock` wraps `MDLexicalBlockBase`, not `MDLexicalBlock`. llvm-svn: 234850
* DebugInfo: Gut DINamespace and DITemplate*ParameterDuncan P. N. Exon Smith2015-04-141-4/+4
| | | | | | | Continue gutting `DIDescriptor` subclasses, turning them into as-bare-as-possible pointer wrappers. llvm-svn: 234843
* DebugInfo: Gut DIVariable and DIGlobalVariableDuncan P. N. Exon Smith2015-04-141-2/+2
| | | | | | | | | | Gut all the non-pointer API from the variable wrappers, except an implicit conversion from `DIGlobalVariable` to `DIDescriptor`. Note that if you're updating out-of-tree code, `DIVariable` wraps `MDLocalVariable` (`MDVariable` is a common base class shared with `MDGlobalVariable`). llvm-svn: 234840
* [Orc] Disambiguate call to make_unique. This should fix the builders broken byLang Hames2015-04-131-1/+2
| | | | | | r234805. llvm-svn: 234806
* [Orc] Add an Orc layer for applying arbitrary transforms to IR, use it to addLang Hames2015-04-132-7/+90
| | | | | | | debugging output to the LLI orc-lazy JIT, and update the orc-lazy "hello.ll" test to actually test for lazy compilation. llvm-svn: 234805
* [CMake] Updates to llvm-shlib to support overriding exports list and added ↵Chris Bieneman2015-04-131-10/+21
| | | | | | an option to export all symbols. llvm-svn: 234798
* llvm-readobj: teach it to handle MachO Universal Archive correctlyDavid Blaikie2015-04-131-7/+6
| | | | | | | | | | Patch by Chilledheart (rwindz0@gmail.com). Reviewed By: rafael Differential Revision: http://reviews.llvm.org/D8773 llvm-svn: 234758
* Mark empty default constructors as =default if it makes the type PODBenjamin Kramer2015-04-111-4/+1
| | | | | | NFC llvm-svn: 234694
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-114-4/+4
| | | | | | | | | | | | | | The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' \ -j=32 -fix -format http://reviews.llvm.org/D8925 llvm-svn: 234679
* Simplify use of formatted_raw_ostream.Rafael Espindola2015-04-093-12/+9
| | | | | | | | | | | | | | | formatted_raw_ostream is a wrapper over another stream to add column and line number tracking. It is used only for asm printing. This patch moves the its creation down to where we know we are printing assembly. This has the following advantages: * Simpler lifetime management: std::unique_ptr * We don't compute column and line number of object files :-) llvm-svn: 234535
* This reverts commit r234460 and r234461.Rafael Espindola2015-04-091-2/+3
| | | | | | | | | Revert "Add classof implementations to the raw_ostream classes." Revert "Use the cast machinery to remove dummy uses of formatted_raw_ostream." The underlying issue can be fixed without classof. llvm-svn: 234495
* Use the cast machinery to remove dummy uses of formatted_raw_ostream.Rafael Espindola2015-04-091-3/+2
| | | | | | | If we know we are producing an object, we don't need to wrap the stream in a formatted_raw_ostream anymore. llvm-svn: 234461
* IR: Stop using DIDescriptor::is*() and auto-castingDuncan P. N. Exon Smith2015-04-061-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | `DIDescriptor`'s subclasses allow construction from incompatible pointers, and `DIDescriptor` defines a series of `isa<>`-like functions (e.g., `isCompileUnit()` instead of `isa<MDCompileUnit>()`) that clients tend to use like this: if (DICompileUnit(N).isCompileUnit()) foo(DICompileUnit(N)); These construction patterns work together to make `DIDescriptor` behave differently from normal pointers. Instead, use built-in `isa<>`, `dyn_cast<>`, etc., and only build `DIDescriptor`s from pointers that are valid for their type. I've split this into a few commits for different parts of LLVM and clang (to decrease the patch size and increase the chance of review). Generally the changes I made were NFC, but in a few places I made things stricter if it made sense from the surrounded code. Eventually a follow-up commit will remove the API for the "old" way. llvm-svn: 234255
* Fix failure on builder clang-cmake-mips where it was printing a 32-bit addressKevin Enderby2015-04-061-1/+2
| | | | | | | incorrectly because it came from an expression using S.getAddress() which always returns a 64-bit value. llvm-svn: 234251
* For llvm-objdump added support for printing Objc2 32-bit runtime meta dataKevin Enderby2015-04-061-20/+887
| | | | | | with the existing -objc-meta-data and -macho options for Mach-O files. llvm-svn: 234185
* [opaque pointer type] API migration for GEP constant factoriesDavid Blaikie2015-04-021-1/+2
| | | | | | | | | | | | | Require the pointee type to be passed explicitly and assert that it is correct. For now it's possible to pass nullptr here (and I've done so in a few places in this patch) but eventually that will be disallowed once all clients have been updated or removed. It'll be a long road to get all the way there... but if you have the cahnce to update your callers to pass the type explicitly without depending on a pointer's element type, that would be a good thing to do soon and a necessary thing to do eventually. llvm-svn: 233938
* [Orc] Add support classes for inspecting and running C++ static ctor/dtors, andLang Hames2015-04-022-8/+56
| | | | | | | | | use these to add support for C++ static ctors/dtors to the Orc-lazy JIT in LLI. Replace the trivial_retval_1 regression test - the new 'hello' test is covering strictly more code. llvm-svn: 233885
* Fix sanitizer-x86_64-linux-fast failure that was not deleting the bindtable.Kevin Enderby2015-04-011-0/+3
| | | | llvm-svn: 233856
* Add the option -objc-meta-data to llvm-objdump used with -macho toKevin Enderby2015-04-013-12/+1230
| | | | | | | | | | print the Objective-C runtime meta data for Mach-O files. There are three types of Objective-C runtime meta data, Objc2 64-bit, Objc2 32-bit and Objc1 32-bit. This prints the first of these types. The changes to print the others will follow next. llvm-svn: 233840
* Add -mcpu=native support to opt.Craig Topper2015-04-011-1/+17
| | | | llvm-svn: 233789
* [Orc] Reflect process symbols into the LLI Orc-lazy JIT.Lang Hames2015-04-012-1/+21
| | | | | | | This makes symbol resolution essentially identical between MCJIT and the LLI Orc-lazy JIT. llvm-svn: 233786
* Make llc use getHostCPUFeatures when 'native' is specified for cpu.Craig Topper2015-03-311-7/+19
| | | | | | This is necessary for x86 where not all Sandybridge, Ivybrige, Haswell, and Broadwell CPUs support AVX. Currently we modify the CPU name back to Nehalem for this case, but that turns off additional features for these CPUs. llvm-svn: 233673
* tools: Unify how verifyModule() is calledDuncan P. N. Exon Smith2015-03-315-10/+14
| | | | | | | | | Unify the error messages for the various tools when `verifyModule()` fails on an input module. The "brave new way" is: lltool: path/to/input.ll: error: input module is broken! llvm-svn: 233667
* Replace the MCSubtargetInfo parameter with a Triple when creatingEric Christopher2015-03-314-7/+7
| | | | | | | an MCInstPrinter. Update all callers and use where we wanted a Triple previously. llvm-svn: 233648
* Fix PR23045.Rafael Espindola2015-03-302-10/+6
| | | | | | | | | Keep a note in the materializer that we are stripping debug info so that user doing a lazy read of the module don't hit outdated formats. Thanks to Duncan for suggesting the fix. llvm-svn: 233603
* llvm-dis: Use the new `DebugLoc` API, NFCDuncan P. N. Exon Smith2015-03-301-8/+4
| | | | | | Update tools/llvm-dis to use the new `DebugLoc` API. llvm-svn: 233590
* [Orc] Separate callback manager selection from callback manager construction forLang Hames2015-03-302-21/+29
| | | | | | | | OrcLazyJIT in lli. Separating these concerns enables more natural error handling. llvm-svn: 233579
* [MCJIT][Orc] Refactor RTDyldMemoryManager, weave RuntimeDyld::SymbolInfo throughLang Hames2015-03-303-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MCJIT. This patch decouples the two responsibilities of the RTDyldMemoryManager class, memory management and symbol resolution, into two new classes: RuntimeDyld::MemoryManager and RuntimeDyld::SymbolResolver. The symbol resolution interface is modified slightly, from: uint64_t getSymbolAddress(const std::string &Name); to: RuntimeDyld::SymbolInfo findSymbol(const std::string &Name); The latter passes symbol flags along with symbol addresses, allowing RuntimeDyld and others to reason about non-strong/non-exported symbols. The memory management interface removes the following method: void notifyObjectLoaded(ExecutionEngine *EE, const object::ObjectFile &) {} as it is not related to memory management. (Note: Backwards compatibility *is* maintained for this method in MCJIT and OrcMCJITReplacement, see below). The RTDyldMemoryManager class remains in-tree for backwards compatibility. It inherits directly from RuntimeDyld::SymbolResolver, and indirectly from RuntimeDyld::MemoryManager via the new MCJITMemoryManager class, which just subclasses RuntimeDyld::MemoryManager and reintroduces the notifyObjectLoaded method for backwards compatibility). The EngineBuilder class retains the existing method: EngineBuilder& setMCJITMemoryManager(std::unique_ptr<RTDyldMemoryManager> mcjmm); and includes two new methods: EngineBuilder& setMemoryManager(std::unique_ptr<MCJITMemoryManager> MM); EngineBuilder& setSymbolResolver(std::unique_ptr<RuntimeDyld::SymbolResolver> SR); Clients should use EITHER: A single call to setMCJITMemoryManager with an RTDyldMemoryManager. OR (exclusive) One call each to each of setMemoryManager and setSymbolResolver. This patch should be fully compatible with existing uses of RTDyldMemoryManager. If it is not it should be considered a bug, and the patch either fixed or reverted. If clients find the new API to be an improvement the goal will be to deprecate and eventually remove the RTDyldMemoryManager class in favor of the new classes. llvm-svn: 233509
* [Objdump] Pass the correct subtarget to printInst.Akira Hatanaka2015-03-281-2/+2
| | | | | | This fixes a bug I introduced in r233411. llvm-svn: 233484
* Verifier: Call verifyModule() from llc and optDuncan P. N. Exon Smith2015-03-272-4/+22
| | | | | | | | | | | | | | | | | | | | | | Change `llc` and `opt` to run `verifyModule()`. This ensures that we check the full module before `FunctionPass::doInitialization()` ever gets called (I was getting crashes in `DwarfDebug` instead of verifier failures when testing a WIP patch that checks operands of compile units). In `opt`, also move up debug-info-stripping so that it still runs before verification. There was a fair bit of broken code that was sitting in tree. Interestingly, some were cases of a `select` that referred to itself in `-instcombine` tests (apparently an intermediate result). I split them off to `*-noverify.ll` tests with RUN lines like this: opt < %s -S -disable-verify -instcombine | opt -S | FileCheck %s This avoids verifying the input file (so we can get the broken code into `-instcombine), but still verifies the output with a second call to `opt` (to verify that `-instcombine` will clean it up like it should). llvm-svn: 233432
* [MCInstPrinter] Enable MCInstPrinter to change its behavior based on theAkira Hatanaka2015-03-272-4/+4
| | | | | | | | | | | | | | | | | | | | per-function subtarget. Currently, code-gen passes the default or generic subtarget to the constructors of MCInstPrinter subclasses (see LLVMTargetMachine::addPassesToEmitFile), which enables some targets (AArch64, ARM, and X86) to change their instprinter's behavior based on the subtarget feature bits. Since the backend can now use different subtargets for each function, instprinter has to be changed to use the per-function subtarget rather than the default subtarget. This patch takes the first step towards enabling instprinter to change its behavior based on the per-function subtarget. It adds a bit "PassSubtarget" to AsmWriter which tells table-gen to pass a reference to MCSubtargetInfo to the various print methods table-gen auto-generates. I will follow up with changes to instprinters of AArch64, ARM, and X86. llvm-svn: 233411
* Add a -raw option to the -section mode of llvm-objdump.Adrian Prantl2015-03-272-3/+14
| | | | llvm-svn: 233390
* Work around pr23045 and make it easier to reproduce.Rafael Espindola2015-03-272-3/+11
| | | | | | | | | | | Dropping old debug format requires the entire module to be read upfront. This was failing only with the gold plugin, but that is just because llvm-link was not upgrading metadata. The new testcase using llvm-link shows the problem. llvm-svn: 233381
* bugpoint: Verify input filesDuncan P. N. Exon Smith2015-03-261-0/+6
| | | | | | Like r233229 for `llvm-link`, start verifying input files to `bugpoint`. llvm-svn: 233253
* bugpoint: Return early after error, NFCDuncan P. N. Exon Smith2015-03-261-10/+10
| | | | llvm-svn: 233252
* llvm-link: Verify input modulesDuncan P. N. Exon Smith2015-03-251-0/+6
| | | | | | | | | | Otherwise, broken input modules can cause assertions. I've updated two of the testcases that started failing (modules that had `Require` flags but didn't meet their own requirements), but Rafael and I decided that test/Linker/2011-08-22-ResolveAlias.ll should just be deleted outright -- it's a leftover of the way llvm-gcc used to implement weakref. llvm-svn: 233229
* llvm-jitlistener: Add missing include.Benjamin Kramer2015-03-251-1/+2
| | | | | | | This code is only compiled when LLVM_USE_INTEL_JITEVENTS, but at least we have one buildbot where that's the case :) llvm-svn: 233197
* [Orc] Remove another unnecessary typedef.Lang Hames2015-03-251-1/+1
| | | | llvm-svn: 233184
OpenPOWER on IntegriCloud