1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00
Commit Graph

483 Commits

Author SHA1 Message Date
Joseph Tremoulet
59d64a8443 [ORC] Update ObjectTransformLayer signature
Summary:
Update ObjectTransformLayer::addObjectSet to take the object set by
value rather than reference and pass it to the base layer with move
semantics rather than copy, to match r258185's changes to
ObjectLinkingLayer.

Update the unit test to verify that ObjectTransformLayer's signature stays
in sync with ObjectLinkingLayer's.


Reviewers: lhames

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D16414

llvm-svn: 258630
2016-01-23 18:36:01 +00:00
Lang Hames
aabde6c57a [Orc] 'this' qualify more lambda-captured members.
More workaround attempts for GCC ICEs.

llvm-svn: 258288
2016-01-20 05:10:59 +00:00
Lang Hames
09c3ea7fd6 [Orc] More qualifications of lambda-captured member variables to fix GCC ICEs.
llvm-svn: 258286
2016-01-20 04:32:05 +00:00
Lang Hames
b3263313ef [Orc] Qualify captured variable to work around GCC ICE.
llvm-svn: 258278
2016-01-20 03:12:40 +00:00
Lang Hames
1805d7e728 [Orc] Oops - lambda capture changed in r258206 was correct.
Fully qualify reference to Finalized in the body of the lambda instead to work
around GCC ICE.

llvm-svn: 258208
2016-01-19 22:32:58 +00:00
Lang Hames
0f7fb08594 [Orc] Add missing capture to lambda.
llvm-svn: 258206
2016-01-19 22:31:01 +00:00
Lang Hames
563a3b3f49 [Orc] Qualify call to make_unique to avoid ambiguity with std::make_unique.
This should fix some of the bot failures associated with r258185.

llvm-svn: 258204
2016-01-19 22:22:43 +00:00
Lang Hames
8017e50962 [Orc] Fix a stale comment.
llvm-svn: 258187
2016-01-19 21:13:54 +00:00
Lang Hames
526cf61162 [Orc] Refactor ObjectLinkingLayer::addObjectSet to defer loading objects until
they're needed.

Prior to this patch objects were loaded (via RuntimeDyld::loadObject) when they
were added to the ObjectLinkingLayer, but were not relocated and finalized until
a symbol address was requested. In the interim, another object could be loaded
and finalized with the same memory manager, causing relocation/finalization of
the first object to fail (as the first finalization call may have marked the
allocated memory for the first object read-only).

By deferring the loadObject call (and subsequent memory allocations) until an
object file is needed we can avoid prematurely finalizing memory.

llvm-svn: 258185
2016-01-19 21:06:38 +00:00
Lang Hames
ca5c16a964 [Orc] Remove some reinterpret casts in debugging output.
These casts were from function pointer to data pointer type, which some
compilers (including GCC) may warn about. In all cases where these casts were
used the original value was still available as a TargetAddress (uint64_t), so
we can just print a formatted version of that instead.

llvm-svn: 257932
2016-01-15 21:14:05 +00:00
Lang Hames
0bb1f5277a [Orc] Add a void cast to work around a GCC diagnostic bug.
llvm-svn: 257927
2016-01-15 19:37:14 +00:00
David Blaikie
9107ffd0e3 Orc: Simplify some things with NSDMIs and some braced init.
llvm-svn: 257840
2016-01-14 23:33:43 +00:00
Lang Hames
825d101c30 [Orc] Add support for EH-frame registration to the Orc Remote Target utility
classes.

OrcRemoteTargetClient::RCMemoryManager will now register EH frames with the
server automatically. This allows remote-execution of code that uses exceptions.

llvm-svn: 257816
2016-01-14 22:02:03 +00:00
Rui Ueyama
dca64dbccc Update to use new name alignTo().
llvm-svn: 257804
2016-01-14 21:06:47 +00:00
Lang Hames
65d215138b [ORC] Add extra debugging output to OrcRemoteTargetServer.
llvm-svn: 257577
2016-01-13 06:34:57 +00:00
Lang Hames
a0e46cd9d4 [ORC] Fix typo in debugging output.
llvm-svn: 257576
2016-01-13 06:08:07 +00:00
Lang Hames
4bc8070510 [ORC] More cleanup, partially aimed at working around GCC ICE.
llvm-svn: 257501
2016-01-12 19:01:49 +00:00
Lang Hames
2a97df2ff4 [Orc] Replace lambda with a helper method.
This is good cleanup, but I'm also hoping it'll fix some more GCC ICEs.

llvm-svn: 257498
2016-01-12 18:17:23 +00:00
Lang Hames
f47a39aea4 [Orc] Clang-format.
llvm-svn: 257487
2016-01-12 17:06:32 +00:00
Lang Hames
475699ce0b [Orc] Take another shot at working around the GCC 4.7 ICE in
http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/27486

llvm-svn: 257486
2016-01-12 17:04:12 +00:00
Lang Hames
918799e0ad [Orc] Comment out debugging output in OrcRemoteTargetClient::reserveMem to see
whether this affects the GCC 4.7 ICE on
http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75 .

llvm-svn: 257458
2016-01-12 07:26:28 +00:00
Lang Hames
3ec88cdc93 [ORC] Remove extraneous '&'.
llvm-svn: 257455
2016-01-12 07:10:10 +00:00
Lang Hames
65803871bd [ORC] Replace some more 'auto' uses with std::error_code.
One of the GCC 4.7 bots doesn't seem to like auto, and is currently suffering
from an ICE. I'm hoping this will help.

llvm-svn: 257454
2016-01-12 07:09:41 +00:00
Lang Hames
f37b24374f [Orc] Add overloads of RPC::handle and RPC::expect that take member functions as
handlers.

It is expected that RPC handlers will usually be member functions. Accepting them
directly in handle and expect allows for the remove of a lot of lambdas an
explicit error variables.

This patch also uses this new feature to substantially tidy up the
OrcRemoteTargetServer class.

llvm-svn: 257452
2016-01-12 06:48:52 +00:00
NAKAMURA Takumi
049c623237 OrcRemoteTargetServer.h: Suppress a warning. [-Wunused-variable]
FIXME: It may return ErrorOr.
llvm-svn: 257431
2016-01-12 01:23:43 +00:00
Lang Hames
cf27cdf11f [ORC] Add explicit move construction/assignment to
OrcRemoteTargetClient::ObjectAllocs.

More MSVC bot appeasement.

llvm-svn: 257382
2016-01-11 20:52:33 +00:00
Lang Hames
fcaa6caed5 [ORC] More MSVC error wrangling.
llvm-svn: 257377
2016-01-11 20:25:25 +00:00
Lang Hames
789b9a4918 [Orc] Fix missing return.
llvm-svn: 257373
2016-01-11 19:40:25 +00:00
Lang Hames
9f11bb5b33 [Orc] Add explicit move construction/assignment to RCMemoryManager.
Yet another attempt to pacify MSVC.

llvm-svn: 257372
2016-01-11 19:39:49 +00:00
David Blaikie
e31830eba8 Fix some GCC 4.7 issues with the new Orc remote JIT support
I'm still seeing GCC ICE locally, but figured I'd throw this at the wall
& see if it sticks for the bots at least. Will continue investigating
the ICE in any case.

llvm-svn: 257367
2016-01-11 19:26:01 +00:00
Lang Hames
fed2407e06 [ORC] Explicitly delete copy constructors for RCMemoryManager::Alloc.
More MSVC bot appeasement.

llvm-svn: 257364
2016-01-11 19:05:45 +00:00
Lang Hames
4857d16b5d [Orc] Include <system_error> in OrcTargetClient.
Another shot at appeasing the clang-x86_64-ubuntu-gdb-75 builder.

llvm-svn: 257362
2016-01-11 18:48:37 +00:00
Lang Hames
a872375ec6 [Orc] More explicit move construction/assignment to appease MSVC.
llvm-svn: 257358
2016-01-11 17:32:03 +00:00
Lang Hames
eff773999e [ORC] Pacify MSVC by adding explicit move construction/assignment to
OrcRemoteTargetServer::Allocator.

llvm-svn: 257350
2016-01-11 16:56:24 +00:00
Lang Hames
1753332c86 [ORC] Change 'auto' to 'std::error_code' to try to coax GCC builder into
providing a more helpful error diagnostic.

llvm-svn: 257349
2016-01-11 16:52:11 +00:00
Lang Hames
0c18396b3b [LLI] Replace the LLI remote-JIT support with the new ORC remote-JIT components.
The new ORC remote-JITing support provides a superset of the old code's
functionality, so we can replace the old stuff. As a bonus, a couple of
previously XFAILed tests have started passing.

llvm-svn: 257343
2016-01-11 16:35:55 +00:00
Lang Hames
10ff8aebeb [ORC] Move ORC RPC helper classes that rely on partial specialization into a
non-template base class.

Hopefully this should fix the issues with the windows bots arrising from
r257305.

llvm-svn: 257316
2016-01-11 05:44:39 +00:00
Lang Hames
673deb3f03 [Orc] Remove the empty class definitions in RPCUtils.h in the hope of working
around MSVC's C2783 error.

llvm-svn: 257312
2016-01-11 04:04:20 +00:00
Lang Hames
9e749a8bf3 Orc] Drop PageSize member from Orc architecture support class in favour of
Process::getPageSize() - the former is redundant.

NFC.

llvm-svn: 257310
2016-01-11 02:41:17 +00:00
Lang Hames
bd29b673ab [Orc] Remove the FPRPCChannel class from RPCChannel.h - it requires unistd.h,
which was removed in r257306.

llvm-svn: 257309
2016-01-11 02:15:12 +00:00
Lang Hames
bed94788cf [Orc] Include the IndirectionUtils header in OrcRemoteTargetClient.
This should fix the modules builder.

llvm-svn: 257307
2016-01-11 01:59:35 +00:00
Lang Hames
61dee24618 [Orc] Remote the <unistd> include introduced in r257305 - it's not needed, and
broke the windows bots.

llvm-svn: 257306
2016-01-11 01:55:19 +00:00
Lang Hames
dac7e64ae5 [Orc] Add support for remote JITing to the ORC API.
This patch adds utilities to ORC for managing a remote JIT target. It consists
of:

1. A very primitive RPC system for making calls over a byte-stream.  See
RPCChannel.h, RPCUtils.h.

2. An RPC API defined in the above system for managing memory, looking up
symbols, creating stubs, etc. on a remote target. See OrcRemoteTargetRPCAPI.h.

3. An interface for creating high-level JIT components (memory managers,
callback managers, stub managers, etc.) that operate over the RPC API. See
OrcRemoteTargetClient.h.

4. A helper class for building servers that can handle the RPC calls. See
OrcRemoteTargetServer.h.

The system is designed to work neatly with the existing ORC components and
functionality. In particular, the ORC callback API (and consequently the
CompileOnDemandLayer) is supported, enabling lazy compilation of remote code.

Assuming this doesn't trigger any builder failures, a follow-up patch will be
committed which tests these utilities by using them to replace LLI's existing
remote-JITing demo code.

llvm-svn: 257305
2016-01-11 01:40:11 +00:00
Lang Hames
ecc377c6e6 [Orc] Rename OrcTargetSupport to OrcArchitectureSupport to avoid confusion with
the upcoming remote-target support classes.

llvm-svn: 257302
2016-01-11 00:56:15 +00:00
Lang Hames
26e35e4614 [Orc] Add error codes and a new std::error_category for remote-jit errors.
These will be used by an upcoming patch that adds remote-jit support utilities
to ORC.

llvm-svn: 257297
2016-01-11 00:34:13 +00:00
Lang Hames
e5c7dde8bf [RuntimeDyld] Add a notifyObjectLoaded method to RuntimeDyld::MemoryManager.
This is a more generic version of the MCJITMemoryManager::notifyObjectLoaded
method: It provides only a RuntimeDyld reference (rather than an
ExecutionEngine), and so can be used with ORC JIT stacks.

llvm-svn: 257296
2016-01-10 23:59:41 +00:00
Lang Hames
387a94a205 [RuntimeDyld] Add alignment arguments to the reserveAllocationSpace method of
RuntimeDyld::MemoryManager.

The RuntimeDyld::MemoryManager::reserveAllocationSpace method is called when
object files are loaded, and gives clients a chance to pre-allocate memory for
all segments. Previously only the size of each segment (code, ro-data, rw-data)
was supplied but not the alignment. This hasn't caused any problems so far, as
most clients allocate via the MemoryBlock interface which returns page-aligned
blocks. Adding alignment arguments enables finer grained allocation while still
satisfying alignment restrictions.

llvm-svn: 257294
2016-01-10 18:51:50 +00:00
Lang Hames
cd4f591ec9 [Orc] Fix MSVC build errors due to r257265 by adding explicit move construction
and assignment to LogicalDylibResources.

llvm-svn: 257269
2016-01-09 22:05:08 +00:00
Lang Hames
7d118365e3 [Orc] Enable user-supplied memory managers in the CompileOnDemand layer.
Previously the CompileOnDemand layer was hard-coded to use a new
SectionMemoryManager for each function when it was called.

llvm-svn: 257265
2016-01-09 20:55:18 +00:00
Lang Hames
f1200209c6 [Orc][RuntimeDyld] Prevent duplicate calls to finalizeMemory on shared memory
managers.

Prior to this patch, recursive finalization (where finalization of one
RuntimeDyld instance triggers finalization of another instance on which the
first depends) could trigger memory access failures: When the inner (dependent)
RuntimeDyld instance and its memory manager are finalized, memory allocated
(but not yet relocated) by the outer instance is locked, and relocation in the
outer instance fails with a memory access error.

This patch adds a latch to the RuntimeDyld::MemoryManager base class that is
checked by a new method: RuntimeDyld::finalizeWithMemoryManagerLocking, ensuring
that shared memory managers are only finalized by the outermost RuntimeDyld
instance.

This allows ORC clients to supply the same memory manager to multiple calls to
addModuleSet. In particular it enables the use of user-supplied memory managers
with the CompileOnDemandLayer which must reuse the supplied memory manager for
each function that is lazily compiled.

llvm-svn: 257263
2016-01-09 19:50:40 +00:00