//
//===----------------------------------------------------------------------===//
-#ifndef XCORETARGETMACHINE_H
-#define XCORETARGETMACHINE_H
+#ifndef LLVM_LIB_TARGET_XCORE_XCORETARGETMACHINE_H
+#define LLVM_LIB_TARGET_XCORE_XCORETARGETMACHINE_H
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetData.h"
-#include "XCoreFrameLowering.h"
#include "XCoreSubtarget.h"
-#include "XCoreInstrInfo.h"
-#include "XCoreISelLowering.h"
-#include "XCoreSelectionDAGInfo.h"
+#include "llvm/Target/TargetMachine.h"
namespace llvm {
class XCoreTargetMachine : public LLVMTargetMachine {
+ std::unique_ptr<TargetLoweringObjectFile> TLOF;
+ const DataLayout DL; // Calculates type size & alignment
XCoreSubtarget Subtarget;
- const TargetData DataLayout; // Calculates type size & alignment
- XCoreInstrInfo InstrInfo;
- XCoreFrameLowering FrameLowering;
- XCoreTargetLowering TLInfo;
- XCoreSelectionDAGInfo TSInfo;
public:
XCoreTargetMachine(const Target &T, StringRef TT,
StringRef CPU, StringRef FS, const TargetOptions &Options,
Reloc::Model RM, CodeModel::Model CM,
CodeGenOpt::Level OL);
+ ~XCoreTargetMachine() override;
- virtual const XCoreInstrInfo *getInstrInfo() const { return &InstrInfo; }
- virtual const XCoreFrameLowering *getFrameLowering() const {
- return &FrameLowering;
- }
- virtual const XCoreSubtarget *getSubtargetImpl() const { return &Subtarget; }
- virtual const XCoreTargetLowering *getTargetLowering() const {
- return &TLInfo;
- }
+ const DataLayout *getDataLayout() const override { return &DL; }
+ const XCoreSubtarget *getSubtargetImpl() const override { return &Subtarget; }
- virtual const XCoreSelectionDAGInfo* getSelectionDAGInfo() const {
- return &TSInfo;
- }
+ // Pass Pipeline Configuration
+ TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
- virtual const TargetRegisterInfo *getRegisterInfo() const {
- return &InstrInfo.getRegisterInfo();
+ TargetIRAnalysis getTargetIRAnalysis() override;
+ TargetLoweringObjectFile *getObjFileLowering() const override {
+ return TLOF.get();
}
- virtual const TargetData *getTargetData() const { return &DataLayout; }
-
- // Pass Pipeline Configuration
- virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
};
} // end namespace llvm