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
|
|
|
|
|
|
|
virtual const XCoreInstrInfo *getInstrInfo() const { return &InstrInfo; }
|
2011-01-10 20:39:04 +08:00
|
|
|
virtual const XCoreFrameLowering *getFrameLowering() const {
|
|
|
|
return &FrameLowering;
|
|
|
|
}
|
2008-11-07 18:59:00 +08:00
|
|
|
virtual const XCoreSubtarget *getSubtargetImpl() const { return &Subtarget; }
|
2010-04-17 23:26:15 +08:00
|
|
|
virtual const XCoreTargetLowering *getTargetLowering() const {
|
|
|
|
return &TLInfo;
|
2008-11-07 18:59:00 +08:00
|
|
|
}
|
|
|
|
|
2010-05-12 01:31:57 +08:00
|
|
|
virtual const XCoreSelectionDAGInfo* getSelectionDAGInfo() const {
|
|
|
|
return &TSInfo;
|
|
|
|
}
|
|
|
|
|
2008-11-07 18:59:00 +08:00
|
|
|
virtual const TargetRegisterInfo *getRegisterInfo() const {
|
|
|
|
return &InstrInfo.getRegisterInfo();
|
|
|
|
}
|
2012-10-09 00:38:25 +08:00
|
|
|
virtual const DataLayout *getDataLayout() const { return &DL; }
|
2008-11-07 18:59:00 +08:00
|
|
|
|
|
|
|
// Pass Pipeline Configuration
|
2012-02-04 10:56:59 +08:00
|
|
|
virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
|
2013-09-18 20:43:35 +08:00
|
|
|
|
|
|
|
virtual void addAnalysisPasses(PassManagerBase &PM);
|
2008-11-07 18:59:00 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|