blob: 48193fe095bedbc5cc4c67891445247bac2b10e5 [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 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 Espindola8c34dd82016-05-18 22:04:49 +000031 Optional<Reloc::Model> RM, CodeModel::Model CM,
32 CodeGenOpt::Level OL, 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 }
Chris Lattner158e1f52006-02-05 05:50:24 +000043};
44
Rafael Espindola38af4d62016-05-18 16:00:24 +000045/// Sparc 32-bit target machine
Chris Lattner8228b112010-02-04 06:34:01 +000046///
47class SparcV8TargetMachine : public SparcTargetMachine {
David Blaikiea379b1812011-12-20 02:50:00 +000048 virtual void anchor();
Chris Lattner8228b112010-02-04 06:34:01 +000049public:
Daniel Sanders3e5de882015-06-11 19:41:26 +000050 SparcV8TargetMachine(const Target &T, const Triple &TT, StringRef CPU,
51 StringRef FS, const TargetOptions &Options,
Rafael Espindola8c34dd82016-05-18 22:04:49 +000052 Optional<Reloc::Model> RM, CodeModel::Model CM,
Evan Chengecb29082011-11-16 08:38:26 +000053 CodeGenOpt::Level OL);
Chris Lattner8228b112010-02-04 06:34:01 +000054};
55
Rafael Espindola38af4d62016-05-18 16:00:24 +000056/// Sparc 64-bit target machine
Chris Lattner8228b112010-02-04 06:34:01 +000057///
58class SparcV9TargetMachine : public SparcTargetMachine {
David Blaikiea379b1812011-12-20 02:50:00 +000059 virtual void anchor();
Chris Lattner8228b112010-02-04 06:34:01 +000060public:
Daniel Sanders3e5de882015-06-11 19:41:26 +000061 SparcV9TargetMachine(const Target &T, const Triple &TT, StringRef CPU,
Douglas Katzman9160e782015-04-29 20:30:57 +000062 StringRef FS, const TargetOptions &Options,
Rafael Espindola8c34dd82016-05-18 22:04:49 +000063 Optional<Reloc::Model> RM, CodeModel::Model CM,
Douglas Katzman9160e782015-04-29 20:30:57 +000064 CodeGenOpt::Level OL);
65};
66
67class SparcelTargetMachine : public SparcTargetMachine {
68 virtual void anchor();
69
70public:
Daniel Sanders3e5de882015-06-11 19:41:26 +000071 SparcelTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
Douglas Katzman9160e782015-04-29 20:30:57 +000072 StringRef FS, const TargetOptions &Options,
Rafael Espindola8c34dd82016-05-18 22:04:49 +000073 Optional<Reloc::Model> RM, CodeModel::Model CM,
Evan Chengecb29082011-11-16 08:38:26 +000074 CodeGenOpt::Level OL);
Chris Lattner8228b112010-02-04 06:34:01 +000075};
76
Chris Lattner158e1f52006-02-05 05:50:24 +000077} // end namespace llvm
78
79#endif