1 //===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the Sparc specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_SPARC_SPARCTARGETMACHINE_H
15 #define LLVM_LIB_TARGET_SPARC_SPARCTARGETMACHINE_H
17 #include "SparcInstrInfo.h"
18 #include "SparcSubtarget.h"
19 #include "llvm/Target/TargetMachine.h"
23 class SparcTargetMachine : public LLVMTargetMachine {
24 std::unique_ptr<TargetLoweringObjectFile> TLOF;
25 SparcSubtarget Subtarget;
27 mutable StringMap<std::unique_ptr<SparcSubtarget>> SubtargetMap;
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;
35 const SparcSubtarget *getSubtargetImpl() const { return &Subtarget; }
36 const SparcSubtarget *getSubtargetImpl(const Function &) const override;
38 // Pass Pipeline Configuration
39 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
40 TargetLoweringObjectFile *getObjFileLowering() const override {
45 /// Sparc 32-bit target machine
47 class SparcV8TargetMachine : public SparcTargetMachine {
48 virtual void anchor();
50 SparcV8TargetMachine(const Target &T, const Triple &TT, StringRef CPU,
51 StringRef FS, const TargetOptions &Options,
52 Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
53 CodeGenOpt::Level OL, bool JIT);
56 /// Sparc 64-bit target machine
58 class SparcV9TargetMachine : public SparcTargetMachine {
59 virtual void anchor();
61 SparcV9TargetMachine(const Target &T, const Triple &TT, StringRef CPU,
62 StringRef FS, const TargetOptions &Options,
63 Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
64 CodeGenOpt::Level OL, bool JIT);
67 class SparcelTargetMachine : public SparcTargetMachine {
68 virtual void anchor();
71 SparcelTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
72 StringRef FS, const TargetOptions &Options,
73 Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
74 CodeGenOpt::Level OL, bool JIT);
77 } // end namespace llvm