2008-11-07 18:59:00 +08:00
|
|
|
//===-- XCoreTargetMachine.h - Define TargetMachine for XCore ---*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file declares the XCore specific subclass of TargetMachine.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef XCORETARGETMACHINE_H
|
|
|
|
#define XCORETARGETMACHINE_H
|
|
|
|
|
2012-12-04 15:12:27 +08:00
|
|
|
#include "XCoreSubtarget.h"
|
2012-03-18 02:46:09 +08:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2008-11-07 18:59:00 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class XCoreTargetMachine : public LLVMTargetMachine {
|
|
|
|
XCoreSubtarget Subtarget;
|
|
|
|
public:
|
2011-07-19 14:37:02 +08:00
|
|
|
XCoreTargetMachine(const Target &T, StringRef TT,
|
2011-12-03 06:16:29 +08:00
|
|
|
StringRef CPU, StringRef FS, const TargetOptions &Options,
|
2011-11-16 16:38:26 +08:00
|
|
|
Reloc::Model RM, CodeModel::Model CM,
|
|
|
|
CodeGenOpt::Level OL);
|
2008-11-07 18:59:00 +08:00
|
|
|
|
2014-07-02 08:10:09 +08:00
|
|
|
const XCoreInstrInfo *getInstrInfo() const override {
|
|
|
|
return getSubtargetImpl()->getInstrInfo();
|
|
|
|
}
|
2014-04-29 15:57:00 +08:00
|
|
|
const XCoreFrameLowering *getFrameLowering() const override {
|
2014-07-02 08:10:09 +08:00
|
|
|
return getSubtargetImpl()->getFrameLowering();
|
2011-01-10 20:39:04 +08:00
|
|
|
}
|
2014-04-29 15:57:00 +08:00
|
|
|
const XCoreSubtarget *getSubtargetImpl() const override { return &Subtarget; }
|
|
|
|
const XCoreTargetLowering *getTargetLowering() const override {
|
2014-07-02 08:10:09 +08:00
|
|
|
return getSubtargetImpl()->getTargetLowering();
|
2008-11-07 18:59:00 +08:00
|
|
|
}
|
2014-04-29 15:57:00 +08:00
|
|
|
const XCoreSelectionDAGInfo* getSelectionDAGInfo() const override {
|
2014-07-02 08:10:09 +08:00
|
|
|
return getSubtargetImpl()->getSelectionDAGInfo();
|
2010-05-12 01:31:57 +08:00
|
|
|
}
|
2014-04-29 15:57:00 +08:00
|
|
|
const TargetRegisterInfo *getRegisterInfo() const override {
|
2014-07-02 08:10:09 +08:00
|
|
|
return getSubtargetImpl()->getRegisterInfo();
|
|
|
|
}
|
|
|
|
const DataLayout *getDataLayout() const override {
|
|
|
|
return getSubtargetImpl()->getDataLayout();
|
2008-11-07 18:59:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Pass Pipeline Configuration
|
2014-04-29 15:57:00 +08:00
|
|
|
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
|
2013-09-18 20:43:35 +08:00
|
|
|
|
2014-04-29 15:57:00 +08:00
|
|
|
void addAnalysisPasses(PassManagerBase &PM) override;
|
2008-11-07 18:59:00 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|