[llvm] 9e2cfb0 - [ORC] Make ExecutorAddrDiff an alias for uint64_t.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 5 18:48:19 PST 2022
Author: Lang Hames
Date: 2022-01-06T13:48:11+11:00
New Revision: 9e2cfb061a8821236944b3c8f40641846ab6bc94
URL: https://github.com/llvm/llvm-project/commit/9e2cfb061a8821236944b3c8f40641846ab6bc94
DIFF: https://github.com/llvm/llvm-project/commit/9e2cfb061a8821236944b3c8f40641846ab6bc94.diff
LOG: [ORC] Make ExecutorAddrDiff an alias for uint64_t.
We don't need to restrict operations on ExecutorAddrDiff as carefully as we do
for ExecutorAddr.
Added:
Modified:
llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h
llvm/include/llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h
llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h
index 3c0b2b9edd52e..2d316b9de0076 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h
@@ -21,17 +21,7 @@
namespace llvm {
namespace orc {
-/// Represents the
diff erence between two addresses in the executor process.
-class ExecutorAddrDiff {
-public:
- ExecutorAddrDiff() = default;
- explicit ExecutorAddrDiff(uint64_t Value) : Value(Value) {}
-
- uint64_t getValue() const { return Value; }
-
-private:
- int64_t Value = 0;
-};
+using ExecutorAddrDiff = uint64_t;
/// Represents an address in the executor process.
class ExecutorAddr {
@@ -99,12 +89,12 @@ class ExecutorAddr {
ExecutorAddr operator--(int) { return ExecutorAddr(Addr--); }
ExecutorAddr &operator+=(const ExecutorAddrDiff Delta) {
- Addr += Delta.getValue();
+ Addr += Delta;
return *this;
}
ExecutorAddr &operator-=(const ExecutorAddrDiff Delta) {
- Addr -= Delta.getValue();
+ Addr -= Delta;
return *this;
}
@@ -121,13 +111,13 @@ inline ExecutorAddrDiff operator-(const ExecutorAddr &LHS,
/// Adding an offset and an address yields an address.
inline ExecutorAddr operator+(const ExecutorAddr &LHS,
const ExecutorAddrDiff &RHS) {
- return ExecutorAddr(LHS.getValue() + RHS.getValue());
+ return ExecutorAddr(LHS.getValue() + RHS);
}
/// Adding an address and an offset yields an address.
inline ExecutorAddr operator+(const ExecutorAddrDiff &LHS,
const ExecutorAddr &RHS) {
- return ExecutorAddr(LHS.getValue() + RHS.getValue());
+ return ExecutorAddr(LHS + RHS.getValue());
}
/// Represents an address range in the exceutor process.
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h b/llvm/include/llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h
index 0e8b7e7d345a0..9e329594012ec 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h
@@ -85,7 +85,7 @@ struct WrapperFunctionCall {
shared::CWrapperFunctionResult(const char *ArgData, size_t ArgSize);
return shared::WrapperFunctionResult(
Func.toPtr<FnTy *>()(ArgData.Start.toPtr<const char *>(),
- static_cast<size_t>(ArgData.size().getValue())));
+ static_cast<size_t>(ArgData.size())));
}
/// Run call and deserialize result using SPS.
diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp b/llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp
index 4c15e25b1d898..1f9d7955acfae 100644
--- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp
@@ -120,8 +120,7 @@ llvm_orc_registerJITLoaderGDBWrapper(const char *Data, uint64_t Size) {
return WrapperFunction<void(SPSExecutorAddrRange)>::handle(
Data, Size,
[](ExecutorAddrRange R) {
- registerJITLoaderGDBImpl(R.Start.toPtr<char *>(),
- R.size().getValue());
+ registerJITLoaderGDBImpl(R.Start.toPtr<char *>(), R.size());
})
.release();
}
More information about the llvm-commits
mailing list