1 //===-- XCoreTargetMachine.h - Define TargetMachine for XCore ---*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file declares the XCore specific subclass of TargetMachine.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_XCORE_XCORETARGETMACHINE_H
14 #define LLVM_LIB_TARGET_XCORE_XCORETARGETMACHINE_H
16 #include "XCoreSubtarget.h"
17 #include "llvm/ADT/Optional.h"
18 #include "llvm/ADT/StringRef.h"
19 #include "llvm/Analysis/TargetTransformInfo.h"
20 #include "llvm/Support/CodeGen.h"
21 #include "llvm/Target/TargetMachine.h"
26 class XCoreTargetMachine
: public LLVMTargetMachine
{
27 std::unique_ptr
<TargetLoweringObjectFile
> TLOF
;
28 XCoreSubtarget Subtarget
;
31 XCoreTargetMachine(const Target
&T
, const Triple
&TT
, StringRef CPU
,
32 StringRef FS
, const TargetOptions
&Options
,
33 Optional
<Reloc::Model
> RM
, Optional
<CodeModel::Model
> CM
,
34 CodeGenOpt::Level OL
, bool JIT
);
35 ~XCoreTargetMachine() override
;
37 const XCoreSubtarget
*getSubtargetImpl() const { return &Subtarget
; }
38 const XCoreSubtarget
*getSubtargetImpl(const Function
&) const override
{
42 // Pass Pipeline Configuration
43 TargetPassConfig
*createPassConfig(PassManagerBase
&PM
) override
;
45 TargetTransformInfo
getTargetTransformInfo(const Function
&F
) override
;
47 TargetLoweringObjectFile
*getObjFileLowering() const override
{
52 } // end namespace llvm
54 #endif // LLVM_LIB_TARGET_XCORE_XCORETARGETMACHINE_H