• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- ARCTargetMachine.h - Define TargetMachine for ARC --------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares the ARC specific subclass of TargetMachine.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_ARC_ARCTARGETMACHINE_H
15 #define LLVM_LIB_TARGET_ARC_ARCTARGETMACHINE_H
16 
17 #include "ARCSubtarget.h"
18 #include "llvm/Target/TargetMachine.h"
19 
20 namespace llvm {
21 
22 class TargetPassConfig;
23 
24 class ARCTargetMachine : public LLVMTargetMachine {
25   std::unique_ptr<TargetLoweringObjectFile> TLOF;
26   ARCSubtarget Subtarget;
27 
28 public:
29   ARCTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
30                    StringRef FS, const TargetOptions &Options,
31                    Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
32                    CodeGenOpt::Level OL, bool JIT);
33   ~ARCTargetMachine() override;
34 
getSubtargetImpl()35   const ARCSubtarget *getSubtargetImpl() const { return &Subtarget; }
getSubtargetImpl(const Function &)36   const ARCSubtarget *getSubtargetImpl(const Function &) const override {
37     return &Subtarget;
38   }
39 
40   // Pass Pipeline Configuration
41   TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
42 
43   TargetTransformInfo getTargetTransformInfo(const Function &F) override;
getObjFileLowering()44   TargetLoweringObjectFile *getObjFileLowering() const override {
45     return TLOF.get();
46   }
47 };
48 
49 } // end namespace llvm
50 
51 #endif // LLVM_LIB_TARGET_ARC_ARCTARGETMACHINE_H
52