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
|
|
|
|
|
2011-01-10 20:39:04 +08:00
|
|
|
#include "XCoreFrameLowering.h"
|
2008-11-07 18:59:00 +08:00
|
|
|
#include "XCoreISelLowering.h"
|
2012-12-04 15:12:27 +08:00
|
|
|
#include "XCoreInstrInfo.h"
|
2010-05-12 01:31:57 +08:00
|
|
|
#include "XCoreSelectionDAGInfo.h"
|
2012-12-04 15:12:27 +08:00
|
|
|
#include "XCoreSubtarget.h"
|
2013-01-02 19:36:10 +08:00
|
|
|
#include "llvm/IR/DataLayout.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;
|
2012-10-09 00:38:25 +08:00
|
|
|
const DataLayout DL; // Calculates type size & alignment
|
2008-11-07 18:59:00 +08:00
|
|
|
XCoreInstrInfo InstrInfo;
|
2011-01-10 20:39:04 +08:00
|
|
|
XCoreFrameLowering FrameLowering;
|
2008-11-07 18:59:00 +08:00
|
|
|
XCoreTargetLowering TLInfo;
|
2010-05-12 01:31:57 +08:00
|
|
|
XCoreSelectionDAGInfo TSInfo;
|
2008-11-07 18:59:00 +08:00
|
|
|
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-04-29 15:57:00 +08:00
|
|
|
const XCoreInstrInfo *getInstrInfo() const override { return &InstrInfo; }
|
|
|
|
const XCoreFrameLowering *getFrameLowering() const override {
|
2011-01-10 20:39:04 +08:00
|
|
|
return &FrameLowering;
|
|
|
|
}
|
2014-04-29 15:57:00 +08:00
|
|
|
const XCoreSubtarget *getSubtargetImpl() const override { return &Subtarget; }
|
|
|
|
const XCoreTargetLowering *getTargetLowering() const override {
|
2010-04-17 23:26:15 +08:00
|
|
|
return &TLInfo;
|
2008-11-07 18:59:00 +08:00
|
|
|
}
|
|
|
|
|
2014-04-29 15:57:00 +08:00
|
|
|
const XCoreSelectionDAGInfo* getSelectionDAGInfo() const override {
|
2010-05-12 01:31:57 +08:00
|
|
|
return &TSInfo;
|
|
|
|
}
|
|
|
|
|
2014-04-29 15:57:00 +08:00
|
|
|
const TargetRegisterInfo *getRegisterInfo() const override {
|
2008-11-07 18:59:00 +08:00
|
|
|
return &InstrInfo.getRegisterInfo();
|
|
|
|
}
|
2014-04-29 15:57:00 +08:00
|
|
|
const DataLayout *getDataLayout() const override { return &DL; }
|
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
|