#include "VETargetMachine.h"
#include "TargetInfo/VETargetInfo.h"
#include "VE.h"
#include "VEMachineFunctionInfo.h"
#include "VETargetTransformInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/MC/TargetRegistry.h"
#include <optional>
usingnamespacellvm;
#define DEBUG_TYPE …
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeVETarget() { … }
static std::string computeDataLayout(const Triple &T) { … }
static Reloc::Model getEffectiveRelocModel(std::optional<Reloc::Model> RM) { … }
namespace {
class VEELFTargetObjectFile : public TargetLoweringObjectFileELF { … };
}
static std::unique_ptr<TargetLoweringObjectFile> createTLOF() { … }
VETargetMachine::VETargetMachine(const Target &T, const Triple &TT,
StringRef CPU, StringRef FS,
const TargetOptions &Options,
std::optional<Reloc::Model> RM,
std::optional<CodeModel::Model> CM,
CodeGenOptLevel OL, bool JIT)
: … { … }
VETargetMachine::~VETargetMachine() = default;
TargetTransformInfo
VETargetMachine::getTargetTransformInfo(const Function &F) const { … }
MachineFunctionInfo *VETargetMachine::createMachineFunctionInfo(
BumpPtrAllocator &Allocator, const Function &F,
const TargetSubtargetInfo *STI) const { … }
namespace {
class VEPassConfig : public TargetPassConfig { … };
}
TargetPassConfig *VETargetMachine::createPassConfig(PassManagerBase &PM) { … }
void VEPassConfig::addIRPasses() { … }
bool VEPassConfig::addInstSelector() { … }
void VEPassConfig::addPreEmitPass() { … }