blob: 903c2d15629f2bfc4a890b6a5339ddddaf203520 [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
Chris Lattner12e97302006-09-04 04:14:57 +000023class SparcTargetMachine : public LLVMTargetMachine {
Aditya Nandakumara2719322014-11-13 09:26:31 +000024 std::unique_ptr<TargetLoweringObjectFile> TLOF;
Chris Lattner158e1f52006-02-05 05:50:24 +000025 SparcSubtarget Subtarget;
Chris Lattner158e1f52006-02-05 05:50:24 +000026public:
Daniel Sanders3e5de882015-06-11 19:41:26 +000027 SparcTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
28 StringRef FS, const TargetOptions &Options,
29 Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL,
30 bool is64bit);
Reid Kleckner357600e2014-11-20 23:37:18 +000031 ~SparcTargetMachine() override;
Chris Lattner158e1f52006-02-05 05:50:24 +000032
Eric Christopher4d0f35a2015-03-21 04:22:23 +000033 const SparcSubtarget *getSubtargetImpl(const Function &) const override {
34 return &Subtarget;
35 }
Rafael Espindolab8141d52014-08-05 22:10:21 +000036
Chris Lattner12e97302006-09-04 04:14:57 +000037 // Pass Pipeline Configuration
Craig Topperb0c941b2014-04-29 07:57:13 +000038 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
Aditya Nandakumara2719322014-11-13 09:26:31 +000039 TargetLoweringObjectFile *getObjFileLowering() const override {
40 return TLOF.get();
41 }
Chris Lattner158e1f52006-02-05 05:50:24 +000042};
43
Chris Lattner8228b112010-02-04 06:34:01 +000044/// SparcV8TargetMachine - Sparc 32-bit target machine
45///
46class SparcV8TargetMachine : public SparcTargetMachine {
David Blaikiea379b1812011-12-20 02:50:00 +000047 virtual void anchor();
Chris Lattner8228b112010-02-04 06:34:01 +000048public:
Daniel Sanders3e5de882015-06-11 19:41:26 +000049 SparcV8TargetMachine(const Target &T, const Triple &TT, StringRef CPU,
50 StringRef FS, const TargetOptions &Options,
Evan Chengecb29082011-11-16 08:38:26 +000051 Reloc::Model RM, CodeModel::Model CM,
52 CodeGenOpt::Level OL);
Chris Lattner8228b112010-02-04 06:34:01 +000053};
54
55/// SparcV9TargetMachine - Sparc 64-bit target machine
56///
57class SparcV9TargetMachine : public SparcTargetMachine {
David Blaikiea379b1812011-12-20 02:50:00 +000058 virtual void anchor();
Chris Lattner8228b112010-02-04 06:34:01 +000059public:
Daniel Sanders3e5de882015-06-11 19:41:26 +000060 SparcV9TargetMachine(const Target &T, const Triple &TT, StringRef CPU,
Douglas Katzman9160e782015-04-29 20:30:57 +000061 StringRef FS, const TargetOptions &Options,
62 Reloc::Model RM, CodeModel::Model CM,
63 CodeGenOpt::Level OL);
64};
65
66class SparcelTargetMachine : public SparcTargetMachine {
67 virtual void anchor();
68
69public:
Daniel Sanders3e5de882015-06-11 19:41:26 +000070 SparcelTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
Douglas Katzman9160e782015-04-29 20:30:57 +000071 StringRef FS, const TargetOptions &Options,
Evan Chengecb29082011-11-16 08:38:26 +000072 Reloc::Model RM, CodeModel::Model CM,
73 CodeGenOpt::Level OL);
Chris Lattner8228b112010-02-04 06:34:01 +000074};
75
Chris Lattner158e1f52006-02-05 05:50:24 +000076} // end namespace llvm
77
78#endif