Commit Graph

6 Commits

Author SHA1 Message Date
Lang Hames f828135f91 Reapply "[ORC] Add "wrap" and "unwrap" steps to ExecutorAddr..." with fixes.
Reapplies f14cb494a3 (which was reverted in 2f08f8426c) with a fix for UB in
the ExecutorAddr::Unwrap::Unwrap constructor (which caused failures on some
bots).
2022-08-26 14:53:51 -07:00
Lang Hames 2f08f8426c Revert "[ORC] Add "wrap" and "unwrap" steps to ExecutorAddr toPtr/fromPtr."
This reverts commit f14cb494a3.

Reverting while I investigate bot failures, e.g.
https://lab.llvm.org/buildbot#builders/117/builds/8701
2022-08-26 13:54:30 -07:00
Lang Hames f14cb494a3 [ORC] Add "wrap" and "unwrap" steps to ExecutorAddr toPtr/fromPtr.
The wrap/unwrap operations are applied to pointers after/before conversion to/from
raw addresses. They can be used to tag, untag, sign, or strip signing from
pointers. They currently default to 'rawPtr' (identity) on all platforms, but it
is expected that the default will be set based on the host architecture, e.g.
they would default to signing/stripping for arm64e.
2022-08-26 12:32:44 -07:00
Lang Hames 98616cfc02 [ORC] Add an ExecutorAddr::toPtr overload for function types.
In the common case of converting an ExecutorAddr to a function pointer type,
this eliminates the need for the '(*)' boilerplate to explicitly specify a
function pointer. E.g.:

auto *F = A.toPtr<int(*)()>();

can now be written as

auto *F = A.toPtr<int()>();
2022-05-05 12:37:23 -07:00
Lang Hames 37f1b7a3f3 [ORC] Allow construction of an ExecutorAddrRange from an addr and a size. 2021-09-24 14:35:50 -07:00
Lang Hames c0d889995e [ORC] Add 'contains' and 'overlaps' operations to ExecutorAddrRange.
Also includes unit tests for not-yet tested operations like comparison and
to/from pointer conversion.
2021-09-24 13:29:11 -07:00