blob: b0d76abeba7d41e8066913837ac1afbe3dabc375 [file] [log] [blame]
Chris Lattner158e1f52006-02-05 05:50:24 +00001//===-- SparcTargetMachine.h - Define TargetMachine for Sparc ---*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattnerf3ebc3f2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Chris Lattner158e1f52006-02-05 05:50:24 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file declares the Sparc specific subclass of TargetMachine.
11//
12//===----------------------------------------------------------------------===//
13
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000014#ifndef LLVM_LIB_TARGET_SPARC_SPARCTARGETMACHINE_H
15#define LLVM_LIB_TARGET_SPARC_SPARCTARGETMACHINE_H
Chris Lattner158e1f52006-02-05 05:50:24 +000016
Chandler Carruth802d7552012-12-04 07:12:27 +000017#include "SparcInstrInfo.h"
Anton Korobeynikovf7183ed2010-11-15 00:06:54 +000018#include "SparcSubtarget.h"
Chandler Carruth802d7552012-12-04 07:12:27 +000019#include "llvm/Target/TargetMachine.h"
Chris Lattner158e1f52006-02-05 05:50:24 +000020
21namespace llvm {
22
Matthias Braunbb8507e2017-10-12 22:57:28 +000023class SparcTargetMachine : public LLVMTargetMachine {
Aditya Nandakumara2719322014-11-13 09:26:31 +000024 std::unique_ptr<TargetLoweringObjectFile> TLOF;
Chris Dewhurst4f7cac32016-05-23 10:56:36 +000025 SparcSubtarget Subtarget;
Chris Dewhurst68388a02016-05-18 09:14:13 +000026 bool is64Bit;
27 mutable StringMap<std::unique_ptr<SparcSubtarget>> SubtargetMap;
Chris Lattner158e1f52006-02-05 05:50:24 +000028public:
Daniel Sanders3e5de882015-06-11 19:41:26 +000029 SparcTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
30 StringRef FS, const TargetOptions &Options,
Rafael Espindola79e238a2017-08-03 02:16:21 +000031 Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
32 CodeGenOpt::Level OL, bool JIT, bool is64bit);
Reid Kleckner357600e2014-11-20 23:37:18 +000033 ~SparcTargetMachine() override;
Chris Lattner158e1f52006-02-05 05:50:24 +000034
Chris Dewhurst4f7cac32016-05-23 10:56:36 +000035 const SparcSubtarget *getSubtargetImpl() const { return &Subtarget; }
Chris Dewhurst68388a02016-05-18 09:14:13 +000036 const SparcSubtarget *getSubtargetImpl(const Function &) const override;
Rafael Espindolab8141d52014-08-05 22:10:21 +000037
Chris Lattner12e97302006-09-04 04:14:57 +000038 // Pass Pipeline Configuration
Craig Topperb0c941b2014-04-29 07:57:13 +000039 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
Aditya Nandakumara2719322014-11-13 09:26:31 +000040 TargetLoweringObjectFile *getObjFileLowering() const override {
41 return TLOF.get();
42 }
Matthias Braund6a36ae2017-05-31 18:41:23 +000043
44 bool isMachineVerifierClean() const override {
45 return false;
46 }
Chris Lattner158e1f52006-02-05 05:50:24 +000047};
48
Rafael Espindola38af4d62016-05-18 16:00:24 +000049/// Sparc 32-bit target machine
Chris Lattner8228b112010-02-04 06:34:01 +000050///
51class SparcV8TargetMachine : public SparcTargetMachine {
David Blaikiea379b1812011-12-20 02:50:00 +000052 virtual void anchor();
Chris Lattner8228b112010-02-04 06:34:01 +000053public:
Daniel Sanders3e5de882015-06-11 19:41:26 +000054 SparcV8TargetMachine(const Target &T, const Triple &TT, StringRef CPU,
55 StringRef FS, const TargetOptions &Options,
Rafael Espindola79e238a2017-08-03 02:16:21 +000056 Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
57 CodeGenOpt::Level OL, bool JIT);
Chris Lattner8228b112010-02-04 06:34:01 +000058};
59
Rafael Espindola38af4d62016-05-18 16:00:24 +000060/// Sparc 64-bit target machine
Chris Lattner8228b112010-02-04 06:34:01 +000061///
62class SparcV9TargetMachine : public SparcTargetMachine {
David Blaikiea379b1812011-12-20 02:50:00 +000063 virtual void anchor();
Chris Lattner8228b112010-02-04 06:34:01 +000064public:
Daniel Sanders3e5de882015-06-11 19:41:26 +000065 SparcV9TargetMachine(const Target &T, const Triple &TT, StringRef CPU,
Douglas Katzman9160e782015-04-29 20:30:57 +000066 StringRef FS, const TargetOptions &Options,
Rafael Espindola79e238a2017-08-03 02:16:21 +000067 Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
68 CodeGenOpt::Level OL, bool JIT);
Douglas Katzman9160e782015-04-29 20:30:57 +000069};
70
71class SparcelTargetMachine : public SparcTargetMachine {
72 virtual void anchor();
73
74public:
Daniel Sanders3e5de882015-06-11 19:41:26 +000075 SparcelTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
Douglas Katzman9160e782015-04-29 20:30:57 +000076 StringRef FS, const TargetOptions &Options,
Rafael Espindola79e238a2017-08-03 02:16:21 +000077 Optional<Reloc::Model> RM, Optional<CodeModel::Model> CM,
78 CodeGenOpt::Level OL, bool JIT);
Chris Lattner8228b112010-02-04 06:34:01 +000079};
80
Chris Lattner158e1f52006-02-05 05:50:24 +000081} // end namespace llvm
82
83#endif