blob: 8d49a29386ac8458811417dd32cb1b5322791950 [file] [log] [blame]
Tim Northover3b0846e2014-05-24 12:50:23 +00001//==-- AArch64TargetMachine.h - Define TargetMachine for AArch64 -*- 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 AArch64 specific subclass of TargetMachine.
11//
12//===----------------------------------------------------------------------===//
13
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000014#ifndef LLVM_LIB_TARGET_AARCH64_AARCH64TARGETMACHINE_H
15#define LLVM_LIB_TARGET_AARCH64_AARCH64TARGETMACHINE_H
Tim Northover3b0846e2014-05-24 12:50:23 +000016
17#include "AArch64InstrInfo.h"
Tim Northover3b0846e2014-05-24 12:50:23 +000018#include "AArch64Subtarget.h"
Tim Northover3b0846e2014-05-24 12:50:23 +000019#include "llvm/IR/DataLayout.h"
20#include "llvm/Target/TargetMachine.h"
Tim Northover3b0846e2014-05-24 12:50:23 +000021
22namespace llvm {
23
24class AArch64TargetMachine : public LLVMTargetMachine {
25protected:
Aditya Nandakumara2719322014-11-13 09:26:31 +000026 std::unique_ptr<TargetLoweringObjectFile> TLOF;
Eric Christopher3faf2f12014-10-06 06:45:36 +000027 mutable StringMap<std::unique_ptr<AArch64Subtarget>> SubtargetMap;
Tim Northover3b0846e2014-05-24 12:50:23 +000028
Tim Northover3b0846e2014-05-24 12:50:23 +000029public:
Daniel Sanders3e5de882015-06-11 19:41:26 +000030 AArch64TargetMachine(const Target &T, const Triple &TT, StringRef CPU,
Tim Northover3b0846e2014-05-24 12:50:23 +000031 StringRef FS, const TargetOptions &Options,
32 Reloc::Model RM, CodeModel::Model CM,
33 CodeGenOpt::Level OL, bool IsLittleEndian);
34
Reid Kleckner357600e2014-11-20 23:37:18 +000035 ~AArch64TargetMachine() override;
Eric Christopher3faf2f12014-10-06 06:45:36 +000036 const AArch64Subtarget *getSubtargetImpl(const Function &F) const override;
Tim Northover3b0846e2014-05-24 12:50:23 +000037
38 // Pass Pipeline Configuration
39 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
40
Chandler Carruth8b04c0d2015-02-01 13:20:00 +000041 /// \brief Get the TargetIRAnalysis for this target.
42 TargetIRAnalysis getTargetIRAnalysis() override;
Arnaud A. de Grandmaisonc75dbbb2014-09-10 14:06:10 +000043
Aditya Nandakumara2719322014-11-13 09:26:31 +000044 TargetLoweringObjectFile* getObjFileLowering() const override {
45 return TLOF.get();
46 }
47
Arnaud A. de Grandmaisonc75dbbb2014-09-10 14:06:10 +000048private:
Eric Christopher3faf2f12014-10-06 06:45:36 +000049 bool isLittle;
Tim Northover3b0846e2014-05-24 12:50:23 +000050};
51
52// AArch64leTargetMachine - AArch64 little endian target machine.
53//
54class AArch64leTargetMachine : public AArch64TargetMachine {
55 virtual void anchor();
56public:
Daniel Sanders3e5de882015-06-11 19:41:26 +000057 AArch64leTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
Tim Northover3b0846e2014-05-24 12:50:23 +000058 StringRef FS, const TargetOptions &Options,
59 Reloc::Model RM, CodeModel::Model CM,
60 CodeGenOpt::Level OL);
61};
62
63// AArch64beTargetMachine - AArch64 big endian target machine.
64//
65class AArch64beTargetMachine : public AArch64TargetMachine {
66 virtual void anchor();
67public:
Daniel Sanders3e5de882015-06-11 19:41:26 +000068 AArch64beTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
Tim Northover3b0846e2014-05-24 12:50:23 +000069 StringRef FS, const TargetOptions &Options,
70 Reloc::Model RM, CodeModel::Model CM,
71 CodeGenOpt::Level OL);
72};
73
74} // end namespace llvm
75
76#endif