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.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_XCORE_XCORETARGETMACHINE_H
|
|
|
|
#define LLVM_LIB_TARGET_XCORE_XCORETARGETMACHINE_H
|
2008-11-07 18:59:00 +08:00
|
|
|
|
2012-12-04 15:12:27 +08:00
|
|
|
#include "XCoreSubtarget.h"
|
2017-01-25 07:02:48 +08:00
|
|
|
#include "llvm/ADT/Optional.h"
|
|
|
|
#include "llvm/ADT/StringRef.h"
|
2017-06-06 19:49:48 +08:00
|
|
|
#include "llvm/Analysis/TargetTransformInfo.h"
|
2017-01-25 07:02:48 +08:00
|
|
|
#include "llvm/Support/CodeGen.h"
|
2012-03-18 02:46:09 +08:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2017-01-25 07:02:48 +08:00
|
|
|
#include <memory>
|
2008-11-07 18:59:00 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class XCoreTargetMachine : public LLVMTargetMachine {
|
2014-11-13 17:26:31 +08:00
|
|
|
std::unique_ptr<TargetLoweringObjectFile> TLOF;
|
2008-11-07 18:59:00 +08:00
|
|
|
XCoreSubtarget Subtarget;
|
2017-01-25 07:02:48 +08:00
|
|
|
|
2008-11-07 18:59:00 +08:00
|
|
|
public:
|
2015-06-12 03:41:26 +08:00
|
|
|
XCoreTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
|
|
|
|
StringRef FS, const TargetOptions &Options,
|
2016-05-19 06:04:49 +08:00
|
|
|
Optional<Reloc::Model> RM, CodeModel::Model CM,
|
2011-11-16 16:38:26 +08:00
|
|
|
CodeGenOpt::Level OL);
|
2014-11-21 07:37:18 +08:00
|
|
|
~XCoreTargetMachine() override;
|
2008-11-07 18:59:00 +08:00
|
|
|
|
2015-03-21 12:22:23 +08:00
|
|
|
const XCoreSubtarget *getSubtargetImpl() const { return &Subtarget; }
|
|
|
|
const XCoreSubtarget *getSubtargetImpl(const Function &) const override {
|
|
|
|
return &Subtarget;
|
|
|
|
}
|
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
|
|
|
|
2015-02-01 21:20:00 +08:00
|
|
|
TargetIRAnalysis getTargetIRAnalysis() override;
|
2017-01-25 07:02:48 +08:00
|
|
|
|
2014-11-13 17:26:31 +08:00
|
|
|
TargetLoweringObjectFile *getObjFileLowering() const override {
|
|
|
|
return TLOF.get();
|
|
|
|
}
|
2008-11-07 18:59:00 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
2017-01-25 07:02:48 +08:00
|
|
|
#endif // LLVM_LIB_TARGET_XCORE_XCORETARGETMACHINE_H
|