1 //==-- AArch64TargetMachine.h - Define TargetMachine for AArch64 -*- 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 AArch64 specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_AARCH64_AARCH64TARGETMACHINE_H
15 #define LLVM_LIB_TARGET_AARCH64_AARCH64TARGETMACHINE_H
17 #include "AArch64InstrInfo.h"
18 #include "AArch64Subtarget.h"
19 #include "llvm/IR/DataLayout.h"
20 #include "llvm/Target/TargetMachine.h"
24 class AArch64RegisterBankInfo;
26 class AArch64TargetMachine : public LLVMTargetMachine {
28 std::unique_ptr<TargetLoweringObjectFile> TLOF;
29 mutable StringMap<std::unique_ptr<AArch64Subtarget>> SubtargetMap;
32 AArch64TargetMachine(const Target &T, const Triple &TT, StringRef CPU,
33 StringRef FS, const TargetOptions &Options,
34 Optional<Reloc::Model> RM, CodeModel::Model CM,
35 CodeGenOpt::Level OL, bool IsLittleEndian);
37 ~AArch64TargetMachine() override;
38 const AArch64Subtarget *getSubtargetImpl(const Function &F) const override;
39 // The no argument getSubtargetImpl, while it exists on some, targets is
40 // deprecated and should not be used.
41 const AArch64Subtarget *getSubtargetImpl() const = delete;
43 // Pass Pipeline Configuration
44 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
46 /// \brief Get the TargetIRAnalysis for this target.
47 TargetIRAnalysis getTargetIRAnalysis() override;
49 TargetLoweringObjectFile* getObjFileLowering() const override {
57 // AArch64 little endian target machine.
59 class AArch64leTargetMachine : public AArch64TargetMachine {
60 virtual void anchor();
62 AArch64leTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
63 StringRef FS, const TargetOptions &Options,
64 Optional<Reloc::Model> RM, CodeModel::Model CM,
65 CodeGenOpt::Level OL);
68 // AArch64 big endian target machine.
70 class AArch64beTargetMachine : public AArch64TargetMachine {
71 virtual void anchor();
73 AArch64beTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
74 StringRef FS, const TargetOptions &Options,
75 Optional<Reloc::Model> RM, CodeModel::Model CM,
76 CodeGenOpt::Level OL);
79 } // end namespace llvm