#include "MSP430TargetMachine.h"
#include "MSP430.h"
#include "MSP430MachineFunctionInfo.h"
#include "TargetInfo/MSP430TargetInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/TargetRegistry.h"
#include <optional>
usingnamespacellvm;
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeMSP430Target() { … }
static Reloc::Model getEffectiveRelocModel(std::optional<Reloc::Model> RM) { … }
static std::string computeDataLayout(const Triple &TT, StringRef CPU,
const TargetOptions &Options) { … }
MSP430TargetMachine::MSP430TargetMachine(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)
: … { … }
MSP430TargetMachine::~MSP430TargetMachine() = default;
namespace {
class MSP430PassConfig : public TargetPassConfig { … };
}
TargetPassConfig *MSP430TargetMachine::createPassConfig(PassManagerBase &PM) { … }
MachineFunctionInfo *MSP430TargetMachine::createMachineFunctionInfo(
BumpPtrAllocator &Allocator, const Function &F,
const TargetSubtargetInfo *STI) const { … }
void MSP430PassConfig::addIRPasses() { … }
bool MSP430PassConfig::addInstSelector() { … }
void MSP430PassConfig::addPreEmitPass() { … }