• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- 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 Sparc specific subclass of TargetMachine.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_SPARC_SPARCTARGETMACHINE_H
15 #define LLVM_LIB_TARGET_SPARC_SPARCTARGETMACHINE_H
16 
17 #include "SparcInstrInfo.h"
18 #include "SparcSubtarget.h"
19 #include "llvm/Target/TargetMachine.h"
20 
21 namespace llvm {
22 
23 class SparcTargetMachine : public LLVMTargetMachine {
24   std::unique_ptr<TargetLoweringObjectFile> TLOF;
25   SparcSubtarget Subtarget;
26   bool is64Bit;
27   mutable StringMap<std::unique_ptr<SparcSubtarget>> SubtargetMap;
28 public:
29   SparcTargetMachine(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, bool is64bit);
33   ~SparcTargetMachine() override;
34 
getSubtargetImpl()35   const SparcSubtarget *getSubtargetImpl() const { return &Subtarget; }
36   const SparcSubtarget *getSubtargetImpl(const Function &) const override;
37 
38   // Pass Pipeline Configuration
39   TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
getObjFileLowering()40   TargetLoweringObjectFile *getObjFileLowering() const override {
41     return TLOF.get();
42   }
43 
isMachineVerifierClean()44   bool isMachineVerifierClean() const override {
45     return false;
46   }
47 };
48 
49 /// Sparc 32-bit target machine
50 ///
51 class SparcV8TargetMachine : public SparcTargetMachine {
52   virtual void anchor();
53 public:
54   SparcV8TargetMachine(const Target &T, const Triple &TT, StringRef CPU,
55                        StringRef FS, const TargetOptions &Options,
56                        Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
57                        CodeGenOpt::Level OL, bool JIT);
58 };
59 
60 /// Sparc 64-bit target machine
61 ///
62 class SparcV9TargetMachine : public SparcTargetMachine {
63   virtual void anchor();
64 public:
65   SparcV9TargetMachine(const Target &T, const Triple &TT, StringRef CPU,
66                        StringRef FS, const TargetOptions &Options,
67                        Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
68                        CodeGenOpt::Level OL, bool JIT);
69 };
70 
71 class SparcelTargetMachine : public SparcTargetMachine {
72   virtual void anchor();
73 
74 public:
75   SparcelTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
76                        StringRef FS, const TargetOptions &Options,
77                        Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
78                        CodeGenOpt::Level OL, bool JIT);
79 };
80 
81 } // end namespace llvm
82 
83 #endif
84