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 "XCoreSubtarget.h"
|
|
|
|
#include "XCoreInstrInfo.h"
|
|
|
|
#include "XCoreISelLowering.h"
|
2010-05-12 01:31:57 +08:00
|
|
|
#include "XCoreSelectionDAGInfo.h"
|
2012-03-18 02:46:09 +08:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
|
|
|
#include "llvm/Target/TargetData.h"
|
2008-11-07 18:59:00 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class XCoreTargetMachine : public LLVMTargetMachine {
|
|
|
|
XCoreSubtarget Subtarget;
|
|
|
|
const TargetData DataLayout; // Calculates type size & alignment
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
virtual const TargetData *getTargetData() const { return &DataLayout; }
|
|
|
|
|
|
|
|
// Pass Pipeline Configuration
|
2012-02-04 10:56:59 +08:00
|
|
|
virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
|
2008-11-07 18:59:00 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|