2008-11-07 10:59:00 +00: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 12:39:04 +00:00
|
|
|
#include "XCoreFrameLowering.h"
|
2008-11-07 10:59:00 +00:00
|
|
|
#include "XCoreISelLowering.h"
|
2012-12-04 07:12:27 +00:00
|
|
|
#include "XCoreInstrInfo.h"
|
2010-05-11 17:31:57 +00:00
|
|
|
#include "XCoreSelectionDAGInfo.h"
|
2012-12-04 07:12:27 +00:00
|
|
|
#include "XCoreSubtarget.h"
|
|
|
|
#include "llvm/DataLayout.h"
|
2012-03-17 18:46:09 +00:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2012-10-18 23:22:48 +00:00
|
|
|
#include "llvm/Target/TargetTransformImpl.h"
|
2008-11-07 10:59:00 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class XCoreTargetMachine : public LLVMTargetMachine {
|
|
|
|
XCoreSubtarget Subtarget;
|
2012-10-08 16:38:25 +00:00
|
|
|
const DataLayout DL; // Calculates type size & alignment
|
2008-11-07 10:59:00 +00:00
|
|
|
XCoreInstrInfo InstrInfo;
|
2011-01-10 12:39:04 +00:00
|
|
|
XCoreFrameLowering FrameLowering;
|
2008-11-07 10:59:00 +00:00
|
|
|
XCoreTargetLowering TLInfo;
|
2010-05-11 17:31:57 +00:00
|
|
|
XCoreSelectionDAGInfo TSInfo;
|
2012-10-18 23:22:48 +00:00
|
|
|
ScalarTargetTransformImpl STTI;
|
|
|
|
VectorTargetTransformImpl VTTI;
|
2008-11-07 10:59:00 +00:00
|
|
|
public:
|
2011-07-19 06:37:02 +00:00
|
|
|
XCoreTargetMachine(const Target &T, StringRef TT,
|
2011-12-02 22:16:29 +00:00
|
|
|
StringRef CPU, StringRef FS, const TargetOptions &Options,
|
2011-11-16 08:38:26 +00:00
|
|
|
Reloc::Model RM, CodeModel::Model CM,
|
|
|
|
CodeGenOpt::Level OL);
|
2008-11-07 10:59:00 +00:00
|
|
|
|
|
|
|
virtual const XCoreInstrInfo *getInstrInfo() const { return &InstrInfo; }
|
2011-01-10 12:39:04 +00:00
|
|
|
virtual const XCoreFrameLowering *getFrameLowering() const {
|
|
|
|
return &FrameLowering;
|
|
|
|
}
|
2008-11-07 10:59:00 +00:00
|
|
|
virtual const XCoreSubtarget *getSubtargetImpl() const { return &Subtarget; }
|
2010-04-17 15:26:15 +00:00
|
|
|
virtual const XCoreTargetLowering *getTargetLowering() const {
|
|
|
|
return &TLInfo;
|
2008-11-07 10:59:00 +00:00
|
|
|
}
|
|
|
|
|
2010-05-11 17:31:57 +00:00
|
|
|
virtual const XCoreSelectionDAGInfo* getSelectionDAGInfo() const {
|
|
|
|
return &TSInfo;
|
|
|
|
}
|
|
|
|
|
2008-11-07 10:59:00 +00:00
|
|
|
virtual const TargetRegisterInfo *getRegisterInfo() const {
|
|
|
|
return &InstrInfo.getRegisterInfo();
|
|
|
|
}
|
2012-10-18 23:22:48 +00:00
|
|
|
virtual const ScalarTargetTransformInfo *getScalarTargetTransformInfo()const {
|
|
|
|
return &STTI;
|
|
|
|
}
|
|
|
|
virtual const VectorTargetTransformInfo *getVectorTargetTransformInfo()const {
|
|
|
|
return &VTTI;
|
|
|
|
}
|
2012-10-08 16:38:25 +00:00
|
|
|
virtual const DataLayout *getDataLayout() const { return &DL; }
|
2008-11-07 10:59:00 +00:00
|
|
|
|
|
|
|
// Pass Pipeline Configuration
|
2012-02-04 02:56:59 +00:00
|
|
|
virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
|
2008-11-07 10:59:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|