summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
Commit message (Collapse)AuthorAgeFilesLines
...
* [MCJIT] Simplify immediate decoding code in the RuntimeDyldMachO hierarchy.Lang Hames2014-08-086-44/+49
| | | | | | | | | | | Cleanup only: no functional change. This patch makes RuntimeDyldMachO targets directly responsible for decoding immediates, rather than letting them implement catch a callback from generic code. Since this is a very target specific operation, it makes sense to let the target-specific code drive it. llvm-svn: 215255
* Temporarily Revert "Nuke the old JIT." as it's not quite ready toEric Christopher2014-08-0717-12/+2295
| | | | | | | | | | | 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
* [MCJIT] Replace a c-style cast with reinterpret_cast + static_cast.Lang Hames2014-08-071-4/+4
| | | | | | | | | | C-style casts (and reinterpret_casts) result in implementation defined values when a pointer is cast to a larger integer type. On some platforms this was leading to bogus address computations in RuntimeDyldMachOAArch64. This should fix http://llvm.org/PR20501. llvm-svn: 215143
* fix configure+make buildRafael Espindola2014-08-071-1/+1
| | | | llvm-svn: 215116
* Nuke the old JIT.Rafael Espindola2014-08-0716-2294/+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
* Remove the TargetMachine forwards for TargetSubtargetInfo basedEric Christopher2014-08-042-9/+11
| | | | | | information and update all callers. No functional change. llvm-svn: 214781
* [MCJIT] Fix an overly-aggressive check in RuntimeDyldMachOARM.Lang Hames2014-08-021-5/+0
| | | | | | | This should fix the MachO_ARM_PIC_relocations.s test failures on some 32-bit testers. llvm-svn: 214613
* Include Archive.hRafael Espindola2014-08-011-0/+1
| | | | | | MSVC was complaining about Archive being an incomplete type. llvm-svn: 214542
* Move virtual method out of line.Rafael Espindola2014-08-011-0/+4
| | | | | | Should fix the MSVC build. llvm-svn: 214539
* Replace comment about ownership with std::unique_ptr.Rafael Espindola2014-08-012-9/+5
| | | | llvm-svn: 214533
* Use range loop.Rafael Espindola2014-08-011-7/+3
| | | | llvm-svn: 214530
* Remove some calls to std::move.Rafael Espindola2014-08-011-1/+1
| | | | | | | | | Instead of moving out the data in a ErrorOr<std::unique_ptr<Foo>>, get a reference to it. Thanks to David Blaikie for the suggestion. llvm-svn: 214516
* Use std::unique_ptr to make the ownership explicit.Rafael Espindola2014-07-311-1/+1
| | | | llvm-svn: 214377
* Delete dead code.Rafael Espindola2014-07-313-10/+4
| | | | llvm-svn: 214370
* [MCJIT] Fix the ARM BR24 relocation in RuntimeDyldMachO.Lang Hames2014-07-306-12/+31
| | | | | | | | | | We now (1) correctly decode the branch immediate, (2) modify the immediate to corretly treat it as PC-rel, and (3) properly populate the stub entry. Previously we had been doing each of these wrong. <rdar://problem/17750739> llvm-svn: 214285
* [MCJIT] Add options to llvm-rtdyld to describe a phony target address space forLang Hames2014-07-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | use in -verify mode. This patch adds three hidden command line options to llvm-rtdyld: -target-addr-start <start-addr> : Specify the start of the virtual address space on the phony target. -target-addr-end <end-addr> : Specify the end of the virtual address space on the phony target. -target-section-sep <sep> : Specify the separation (in bytes) between the end of one section and the start of the next. These options automatically default to sane values for the target platform. In particular, they allow narrow (e.g. 32-bit, 16-bit) targets to be tested from wider (e.g. 64-bit, 32-bit) hosts without overflowing pointers. The section separation option defaults to zero, but can be set to a large number (e.g. 1 << 32) to force large separations between sections in order to stress-test large-code-model code. llvm-svn: 214255
* [MCJIT] Make sure we print the full 64-bit result of exprs in ↵Lang Hames2014-07-291-2/+2
| | | | | | RuntimeDyldChecker. llvm-svn: 214227
* [MCJIT] Make the RuntimeDyldChecker stub_addr builtin use file names rather thanLang Hames2014-07-292-2/+4
| | | | | | | | | | full paths for its first argument. This allows us to remove the annoying sed lines in the test cases, and write direct references to file names in stub_addr calls (rather than <filename> placeholders). llvm-svn: 214211
* [RuntimeDyld][AArch64] Make encode/decodeAddend also work on big-endian hosts.Juergen Ributzka2014-07-291-18/+31
| | | | llvm-svn: 214205
* [RuntimeDyld][AArch64] Make encode/decodeAddend more typesafe by using the ↵Juergen Ributzka2014-07-293-9/+12
| | | | | | relocation enum type. NFCI. llvm-svn: 214204
* Remove dead code.Rafael Espindola2014-07-242-66/+0
| | | | | | Every user has been switched to using EngineBuilder. llvm-svn: 213871
* ExecutionEngine: remove a stray semicolonSaleem Abdulrasool2014-07-231-1/+1
| | | | | | Detected via GCC 4.8 [-Wpedantic]. llvm-svn: 213776
* AArch64: remove arm64 triple enumerator.Tim Northover2014-07-234-11/+4
| | | | | | | | | | | | Having both Triple::arm64 and Triple::aarch64 is extremely confusing, and invites bugs where only one is checked. In reality, the only legitimate difference between the two (arm64 usually means iOS) is also present in the OS part of the triple and that's what should be checked. We still parse the "arm64" triple, just canonicalise it to Triple::aarch64, so there aren't any LLVM-side test changes. llvm-svn: 213743
* RuntimeDyldMachOAArch64.h: Fix a warning. [-Wunused-variable]NAKAMURA Takumi2014-07-231-0/+1
| | | | llvm-svn: 213710
* [MCJIT] Make stub_addr functionality in RuntimeDyldChecker work in release mode.Lang Hames2014-07-221-2/+0
| | | | | | | | | There's no reason to restrict this particular piece of RuntimeDyldChecker functionality to +Asserts builds. This should fix failures in MachO_x86-64_PIC_relocations.s on release bots. llvm-svn: 213708
* [MCJIT] Teach RuntimeDyldChecker to handle underscores at the start of symbols.Lang Hames2014-07-221-1/+1
| | | | | | | | RuntimeDyldChecker had been testing isalpha(Expr[0]) to recognise symbol tokens, and throwing unrecognized token errors when it hit symbols with leading underscores. This fixes that. llvm-svn: 213706
* [MCJIT] Improve stub_addr file-not-found diagnostic to help track down aLang Hames2014-07-221-2/+17
| | | | | | buildbot failure. llvm-svn: 213701
* [MCJIT] Refactor and add stub inspection to the RuntimeDyldChecker framework.Lang Hames2014-07-225-548/+777
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a 'stub_addr' builtin that can be used to find the address of the stub for a given (<file>, <section>, <symbol>) tuple. This address can be used both to verify the contents of stubs (by loading from the returned address) and to verify references to stubs (by comparing against the returned address). Example (1) - Verifying stub contents: Load 8 bytes (assuming a 64-bit target) from the stub for 'x' in the __text section of f.o, and compare that value against the addres of 'x'. # rtdyld-check: *{8}(stub_addr(f.o, __text, x) = x Example (2) - Verifying references to stubs: Decode the immediate of the instruction at label 'l', and verify that it's equal to the offset from the next instruction's PC to the stub for 'y' in the __text section of f.o (i.e. it's the correct PC-rel difference). # rtdyld-check: decode_operand(l, 4) = stub_addr(f.o, __text, y) - next_pc(l) l: movq y@GOTPCREL(%rip), %rax Since stub inspection requires cooperation with RuntimeDyldImpl this patch pimpl-ifies RuntimeDyldChecker. Its implementation is moved in to a new class, RuntimeDyldCheckerImpl, that has access to the definition of RuntimeDyldImpl. llvm-svn: 213698
* Appease the buildbots.Juergen Ributzka2014-07-221-0/+1
| | | | llvm-svn: 213694
* [RuntimeDyld][MachO][AArch64] Add a helper function for encoding addends in ↵Juergen Ributzka2014-07-221-75/+110
| | | | | | | | | | | | | instructions. Factor out the addend encoding into a helper function and simplify the processRelocationRef. Also add a few simple rtdyld tests. More tests to come once GOTs can be tested too. Related to <rdar://problem/17768539> llvm-svn: 213689
* [RuntimeDyld][MachO][AArch64] Implement the decodeAddend method.Juergen Ributzka2014-07-221-0/+92
| | | | | | | This adds the required functionality to decode the immediate encoded in an instruction that is referenced in a relocation entry. llvm-svn: 213688
* [RuntimeDyld][MachO][AArch64] Add assertion to check for duplicate addend ↵Juergen Ributzka2014-07-221-4/+4
| | | | | | | | | | definition. In MachO for AArch64 it is possible to have an explicit addend defined by the ARM64_RELOC_ADDEND relocation or having an addend encoded within the instruction. Only one of them are allowed per relocation. llvm-svn: 213687
* [RuntimeDyld] Change the return type of decodeAddend to match the storage type.Juergen Ributzka2014-07-222-6/+6
| | | | llvm-svn: 213686
* Fixing an MSVC conversion warning about implicitly converting the shift ↵Aaron Ballman2014-07-211-1/+1
| | | | | | results to 64-bits. No functional change intended. llvm-svn: 213515
* [PowerPC] ELFv2 dynamic loader supportUlrich Weigand2014-07-203-20/+47
| | | | | | | | | | | | | | | | | | | | | This patch enables the new ELFv2 ABI in the runtime dynamic loader. The loader has to implement the following features: - In the ELFv2 ABI, do not look up a function descriptor in .opd, but instead use the local entry point when resolving a direct call. - Update the TOC restore code to use the new TOC slot linkage area offset. - Create PLT stubs appropriate for the ELFv2 ABI. Note that this patch also adds common-code changes. These are necessary because the loader must check the newly added ELF flags: the e_flags header bits encoding the ABI version, and the st_other symbol table entry bits encoding the local entry point offset. There is currently no way to access these, so I've added ObjectFile::getPlatformFlags and SymbolRef::getOther accessors. Reviewed by Hal Finkel. llvm-svn: 213491
* [MCJIT] Add a 'decodeAddend' method to RuntimeDyldMachO and teachLang Hames2014-07-192-26/+33
| | | | | | | | | | getBasicRelocationEntry to use this rather than 'memcpy' to get the relocation addend. Targets with non-trivial addend encodings (E.g. AArch64) can override decodeAddend to handle immediates with interesting encodings. No functional change. llvm-svn: 213435
* [MCJIT] [AArch64] Make sure to propegate ARM64_RELOC_ADDEND values into theLang Hames2014-07-181-1/+3
| | | | | | | | | | RelocationEntry. No test case yet, as this primarily hits GOT entries, which RuntimeDyldChecker can't examine yet. I'm actively working on features that will enable us to test this. llvm-svn: 213408
* [MCJIT] Fix the alignment requirements for ARM and AArch64 which were mistakenlyLang Hames2014-07-172-2/+2
| | | | | | | | | | relaxed in the big RuntimeDyldMachO cleanup of r213293. No test case yet - this was found via inspection and there's no easy way to test GOT alignment in RuntimeDyldChecker at the moment. I'm working on adding support for this now, and hope to have a test case for this soon. llvm-svn: 213331
* Drop the udis86 wrapper from llvm::sysAlp Toker2014-07-171-7/+0
| | | | | | | | This optional dependency on the udis86 library was added some time back to aid JIT development, but doesn't make much sense to link into LLVM binaries these days. llvm-svn: 213300
* [MCJIT] Significantly refactor the RuntimeDyldMachO class.Lang Hames2014-07-177-826/+1097
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation of RuntimeDyldMachO mixed logic for all targets within a single class, creating problems for readability, maintainability, and performance. To address these issues, this patch strips the RuntimeDyldMachO class down to just target-independent functionality, and moves all target-specific functionality into target-specific subclasses RuntimeDyldMachO. The new class hierarchy is as follows: class RuntimeDyldMachO Implemented in RuntimeDyldMachO.{h,cpp} Contains logic that is completely independent of the target. This consists mostly of MachO helper utilities which the derived classes use to get their work done. template <typename Impl> class RuntimeDyldMachOCRTPBase<Impl> : public RuntimeDyldMachO Implemented in RuntimeDyldMachO.h Contains generic MachO algorithms/data structures that defer to the Impl class for target-specific behaviors. RuntimeDyldMachOARM : public RuntimeDyldMachOCRTPBase<RuntimeDyldMachOARM> RuntimeDyldMachOARM64 : public RuntimeDyldMachOCRTPBase<RuntimeDyldMachOARM64> RuntimeDyldMachOI386 : public RuntimeDyldMachOCRTPBase<RuntimeDyldMachOI386> RuntimeDyldMachOX86_64 : public RuntimeDyldMachOCRTPBase<RuntimeDyldMachOX86_64> Implemented in their respective *.h files in lib/ExecutionEngine/RuntimeDyld/MachOTargets Each of these contains the relocation logic specific to their target architecture. llvm-svn: 213293
* [MCJIT] Improve a RuntimeDyldChecker diagnostic.Lang Hames2014-07-161-3/+7
| | | | | | | When a RuntimeDyldChecker test requests an invalid operand for an instruction, print the decoded instruction to aid diagnosis. llvm-svn: 213202
* [RuntimeDyld] Revert r211652 - MachO object GDB registration support.Lang Hames2014-07-152-144/+21
| | | | | | | | The registration scheme used in r211652 violated the read-only contract of MemoryBuffer. This caused crashes in llvm-rtdyld where macho objects were backed by read-only mmap'd memory. llvm-svn: 213086
* [RuntimeDyld] Handle endiannes differences between the host and target whileLang Hames2014-07-141-14/+19
| | | | | | | | | | reading MachO files magic numbers in RuntimeDyld. This is required now that we're testing cross-platform JITing (via RuntimeDyldChecker), and should fix some issues that David Fang has seen on PPC builds. llvm-svn: 213012
* [RuntimeDyld] Fix stub size and offset for AArch64 in RuntimeDyldMachO.h.Lang Hames2014-07-121-2/+10
| | | | | | <rdar://problem/17648000> llvm-svn: 212864
* [RuntimeDyld] Add GOT support for AArch64 to RuntimeDyldMachO.Lang Hames2014-07-111-24/+174
| | | | | | | | Test cases to follow once RuntimeDyldChecker supports introspection of stubs. Fixes <rdar://problem/17648000> llvm-svn: 212859
* [RuntimeDyld] Improve error diagnostic in RuntimeDyldChecker.Lang Hames2014-07-101-4/+15
| | | | | | | | | The compiler often emits assembler-local labels (beginning with 'L') for use in relocation expressions, however these aren't included in the object files. Teach RuntimeDyldChecker to warn the user if they try to use one of these in an expression, since it will never work. llvm-svn: 212777
* ExecutionEngine::create(): fix interpreter fallback when JIT is unavailableAlp Toker2014-07-011-7/+8
| | | | | | | | | | | ForceInterpreter=false shouldn't disable the interpreter completely because it can still be necessary to interpret if the target doesn't support JIT. No obvious way to test this in LLVM, but this matches what LLVMCreateExecutionEngineForModule() does and fixes the clang-interpreter example in the clang source tree which uses the ExecutionEngine. llvm-svn: 212086
* Fix build following r211956Alp Toker2014-06-281-1/+1
| | | | | | | RuntimeDyld now uses MCInst::dump_pretty() which introduces a dependency on 'MC'. llvm-svn: 211978
* [RuntimeDyld] Use a raw_ostream and llvm::format for int-to-string conversions.Lang Hames2014-06-271-17/+17
| | | | | | Some users' C++11 standard libraries don't support std::to_string yet. llvm-svn: 211961
* [RuntimeDyld] #include <cctype> header in RuntimeDyldChecker.cpp.Lang Hames2014-06-271-0/+1
| | | | | | Hopefully this will unbreak the windows bots. llvm-svn: 211958
OpenPOWER on IntegriCloud