48 lines
1.5 KiB
C++
48 lines
1.5 KiB
C++
#ifndef LLVM_LIB_TARGET_FOOT_FOOTTARGETMACHINE_H
|
|
#define LLVM_LIB_TARGET_FOOT_FOOTTARGETMACHINE_H
|
|
|
|
#include "FootSubtarget.h"
|
|
#include "llvm/CodeGen/CodeGenTargetMachineImpl.h"
|
|
#include "llvm/CodeGen/TargetPassConfig.h"
|
|
|
|
namespace llvm {
|
|
|
|
class FootTargetMachine : public CodeGenTargetMachineImpl {
|
|
mutable std::unique_ptr<FootSubtarget> SubtargetSingleton;
|
|
public:
|
|
FootTargetMachine(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);
|
|
~FootTargetMachine() override;
|
|
|
|
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
|
|
TargetLoweringObjectFile *getObjFileLowering() const override;
|
|
|
|
const FootSubtarget *getSubtargetImpl(const Function &) const override;
|
|
|
|
MachineFunctionInfo *
|
|
createMachineFunctionInfo(BumpPtrAllocator &Allocator, const Function &F,
|
|
const TargetSubtargetInfo *STI) const override;
|
|
};
|
|
|
|
class FootPassConfig : public TargetPassConfig {
|
|
public:
|
|
FootPassConfig(TargetMachine &TM, PassManagerBase &PM);
|
|
|
|
FootTargetMachine &getFootTargetMachine() const {
|
|
return getTM<FootTargetMachine>();
|
|
}
|
|
|
|
bool addInstSelector() override;
|
|
void addIRPasses() override;
|
|
void addPreEmitPass() override;
|
|
};
|
|
|
|
} // namespace llvm
|
|
|
|
#endif // LLVM_LIB_TARGET_FOOT_FOOTTARGETMACHINE_H
|