[llvm] r257310 - Orc] Drop PageSize member from Orc architecture support class in favour of
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 10 18:41:18 PST 2016
Author: lhames
Date: Sun Jan 10 20:41:17 2016
New Revision: 257310
URL: http://llvm.org/viewvc/llvm-project?rev=257310&view=rev
Log:
Orc] Drop PageSize member from Orc architecture support class in favour of
Process::getPageSize() - the former is redundant.
NFC.
Modified:
llvm/trunk/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcArchitectureSupport.h
llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h
Modified: llvm/trunk/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h?rev=257310&r1=257309&r2=257310&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h Sun Jan 10 20:41:17 2016
@@ -22,6 +22,7 @@
#include "llvm/IR/Mangler.h"
#include "llvm/IR/Module.h"
#include "llvm/Transforms/Utils/ValueMapper.h"
+#include "llvm/Support/Process.h"
#include <sstream>
namespace llvm {
@@ -179,14 +180,15 @@ private:
std::error_code EC;
auto TrampolineBlock =
sys::OwningMemoryBlock(
- sys::Memory::allocateMappedMemory(TargetT::PageSize, nullptr,
+ sys::Memory::allocateMappedMemory(sys::Process::getPageSize(), nullptr,
sys::Memory::MF_READ |
sys::Memory::MF_WRITE, EC));
assert(!EC && "Failed to allocate trampoline block");
unsigned NumTrampolines =
- (TargetT::PageSize - TargetT::PointerSize) / TargetT::TrampolineSize;
+ (sys::Process::getPageSize() - TargetT::PointerSize) /
+ TargetT::TrampolineSize;
uint8_t *TrampolineMem = static_cast<uint8_t*>(TrampolineBlock.base());
TargetT::writeTrampolines(TrampolineMem, ResolverBlock.base(),
Modified: llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcArchitectureSupport.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcArchitectureSupport.h?rev=257310&r1=257309&r2=257310&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcArchitectureSupport.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcArchitectureSupport.h Sun Jan 10 20:41:17 2016
@@ -20,13 +20,13 @@
#include "IndirectionUtils.h"
#include "llvm/Support/Memory.h"
+#include "llvm/Support/Process.h"
namespace llvm {
namespace orc {
class OrcX86_64 {
public:
- static const unsigned PageSize = 4096;
static const unsigned PointerSize = 8;
static const unsigned TrampolineSize = 8;
static const unsigned ResolverCodeSize = 0x78;
@@ -51,7 +51,6 @@ public:
friend class OrcX86_64;
public:
const static unsigned StubSize = 8;
- const static unsigned PtrSize = 8;
IndirectStubsInfo() : NumStubs(0) {}
IndirectStubsInfo(IndirectStubsInfo &&Other)
Modified: llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h?rev=257310&r1=257309&r2=257310&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h Sun Jan 10 20:41:17 2016
@@ -325,13 +325,14 @@ private:
auto TrampolineBlock =
sys::OwningMemoryBlock(sys::Memory::allocateMappedMemory(
- TargetT::PageSize, nullptr,
+ sys::Process::getPageSize(), nullptr,
sys::Memory::MF_READ | sys::Memory::MF_WRITE, EC));
if (EC)
return EC;
unsigned NumTrampolines =
- (TargetT::PageSize - TargetT::PointerSize) / TargetT::TrampolineSize;
+ (sys::Process::getPageSize() - TargetT::PointerSize) /
+ TargetT::TrampolineSize;
uint8_t *TrampolineMem = static_cast<uint8_t *>(TrampolineBlock.base());
TargetT::writeTrampolines(TrampolineMem, ResolverBlock.base(),
More information about the llvm-commits
mailing list