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 AArch64TargetMachine : public LLVMTargetMachine {
26 std::unique_ptr<TargetLoweringObjectFile> TLOF;
27 AArch64Subtarget Subtarget;
28 mutable StringMap<std::unique_ptr<AArch64Subtarget>> SubtargetMap;
31 AArch64TargetMachine(const Target &T, StringRef TT, StringRef CPU,
32 StringRef FS, const TargetOptions &Options,
33 Reloc::Model RM, CodeModel::Model CM,
34 CodeGenOpt::Level OL, bool IsLittleEndian);
36 const AArch64Subtarget *getSubtargetImpl() const override {
39 const AArch64Subtarget *getSubtargetImpl(const Function &F) const override;
41 // Pass Pipeline Configuration
42 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
44 /// \brief Register AArch64 analysis passes with a pass manager.
45 void addAnalysisPasses(PassManagerBase &PM) override;
47 TargetLoweringObjectFile* getObjFileLowering() const override {
55 // AArch64leTargetMachine - AArch64 little endian target machine.
57 class AArch64leTargetMachine : public AArch64TargetMachine {
58 virtual void anchor();
60 AArch64leTargetMachine(const Target &T, StringRef TT, StringRef CPU,
61 StringRef FS, const TargetOptions &Options,
62 Reloc::Model RM, CodeModel::Model CM,
63 CodeGenOpt::Level OL);
66 // AArch64beTargetMachine - AArch64 big endian target machine.
68 class AArch64beTargetMachine : public AArch64TargetMachine {
69 virtual void anchor();
71 AArch64beTargetMachine(const Target &T, StringRef TT, StringRef CPU,
72 StringRef FS, const TargetOptions &Options,
73 Reloc::Model RM, CodeModel::Model CM,
74 CodeGenOpt::Level OL);
77 } // end namespace llvm