mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-11 21:57:55 +00:00
Orc] Drop PageSize member from Orc architecture support class in favour of
Process::getPageSize() - the former is redundant. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257310 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ed650a3bd9
commit
140f7b56a0
@ -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
Block a user