#include "bolt/Rewrite/ExecutableFileMemoryManager.h"
#include "bolt/Rewrite/JITLinkLinker.h"
#include "bolt/Rewrite/RewriteInstance.h"
#include "llvm/ExecutionEngine/JITLink/JITLink.h"
#include "llvm/Support/MemAlloc.h"
#undef DEBUG_TYPE
#define DEBUG_TYPE …
usingnamespacellvm;
usingnamespaceobject;
usingnamespacebolt;
namespace llvm {
namespace bolt {
namespace {
SmallVector<jitlink::Section *> orderedSections(jitlink::LinkGraph &G) { … }
size_t sectionAlignment(const jitlink::Section &Section) { … }
StringRef sectionName(const jitlink::Section &Section,
const BinaryContext &BC) { … }
struct SectionAllocInfo { … };
struct AllocInfo { … };
struct BOLTInFlightAlloc : ExecutableFileMemoryManager::InFlightAlloc { … };
}
void ExecutableFileMemoryManager::updateSection(
const jitlink::Section &JLSection, uint8_t *Contents, size_t Size,
size_t Alignment) { … }
void ExecutableFileMemoryManager::allocate(const jitlink::JITLinkDylib *JD,
jitlink::LinkGraph &G,
OnAllocatedFunction OnAllocated) { … }
void ExecutableFileMemoryManager::deallocate(
std::vector<FinalizedAlloc> Allocs, OnDeallocatedFunction OnDeallocated) { … }
}
}