forked from OSchip/llvm-project
Orc] Drop PageSize member from Orc architecture support class in favour of
Process::getPageSize() - the former is redundant. NFC. llvm-svn: 257310
This commit is contained in:
parent
c91bb22bd6
commit
1e3c38ca82
|
@ -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(),
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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(),
|
||||
|
|
Loading…
Reference in New Issue