From 159e4085639ae5f58eaa4046189ec2b2a41bd9bb Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Tue, 10 Jun 2014 22:57:25 +0000 Subject: [PATCH] Move AArch64InstrInfo to AArch64Subtarget. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210599 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/AArch64/AArch64Subtarget.cpp | 2 +- lib/Target/AArch64/AArch64Subtarget.h | 3 +++ lib/Target/AArch64/AArch64TargetMachine.cpp | 3 +-- lib/Target/AArch64/AArch64TargetMachine.h | 7 ++++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/Target/AArch64/AArch64Subtarget.cpp b/lib/Target/AArch64/AArch64Subtarget.cpp index 8be1f66d057..f01a70b65c1 100644 --- a/lib/Target/AArch64/AArch64Subtarget.cpp +++ b/lib/Target/AArch64/AArch64Subtarget.cpp @@ -44,7 +44,7 @@ AArch64Subtarget::AArch64Subtarget(const std::string &TT, ? "e-m:o-i64:64-i128:128-n32:64-S128" : (LittleEndian ? "e-m:e-i64:64-i128:128-n32:64-S128" : "E-m:e-i64:64-i128:128-n32:64-S128")), - FrameLowering(), TSInfo(&DL) { + FrameLowering(), InstrInfo(*this), TSInfo(&DL) { // Determine default and user-specified characteristics if (CPUString.empty()) diff --git a/lib/Target/AArch64/AArch64Subtarget.h b/lib/Target/AArch64/AArch64Subtarget.h index cfb126ebf13..d8930706cfe 100644 --- a/lib/Target/AArch64/AArch64Subtarget.h +++ b/lib/Target/AArch64/AArch64Subtarget.h @@ -14,6 +14,7 @@ #ifndef AArch64SUBTARGET_H #define AArch64SUBTARGET_H +#include "AArch64InstrInfo.h" #include "AArch64FrameLowering.h" #include "AArch64RegisterInfo.h" #include "AArch64SelectionDAGInfo.h" @@ -54,6 +55,7 @@ protected: const DataLayout DL; AArch64FrameLowering FrameLowering; + AArch64InstrInfo InstrInfo; AArch64SelectionDAGInfo TSInfo; public: @@ -66,6 +68,7 @@ public: const AArch64FrameLowering *getFrameLowering() const { return &FrameLowering; } + const AArch64InstrInfo *getInstrInfo() const { return &InstrInfo; } const DataLayout *getDataLayout() const { return &DL; } bool enableMachineScheduler() const override { return true; } diff --git a/lib/Target/AArch64/AArch64TargetMachine.cpp b/lib/Target/AArch64/AArch64TargetMachine.cpp index 7f00df49109..7a8d0e79d44 100644 --- a/lib/Target/AArch64/AArch64TargetMachine.cpp +++ b/lib/Target/AArch64/AArch64TargetMachine.cpp @@ -77,8 +77,7 @@ AArch64TargetMachine::AArch64TargetMachine(const Target &T, StringRef TT, CodeGenOpt::Level OL, bool LittleEndian) : LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL), - Subtarget(TT, CPU, FS, LittleEndian), - InstrInfo(Subtarget), TLInfo(*this) { + Subtarget(TT, CPU, FS, LittleEndian), TLInfo(*this) { initAsmInfo(); } diff --git a/lib/Target/AArch64/AArch64TargetMachine.h b/lib/Target/AArch64/AArch64TargetMachine.h index 417354010d3..937c17ffd11 100644 --- a/lib/Target/AArch64/AArch64TargetMachine.h +++ b/lib/Target/AArch64/AArch64TargetMachine.h @@ -30,7 +30,6 @@ protected: AArch64Subtarget Subtarget; private: - AArch64InstrInfo InstrInfo; AArch64TargetLowering TLInfo; public: @@ -51,9 +50,11 @@ public: const AArch64FrameLowering *getFrameLowering() const override { return getSubtargetImpl()->getFrameLowering(); } - const AArch64InstrInfo *getInstrInfo() const override { return &InstrInfo; } + const AArch64InstrInfo *getInstrInfo() const override { + return getSubtargetImpl()->getInstrInfo(); + } const AArch64RegisterInfo *getRegisterInfo() const override { - return &InstrInfo.getRegisterInfo(); + return &getInstrInfo()->getRegisterInfo(); } const AArch64SelectionDAGInfo *getSelectionDAGInfo() const override { return getSubtargetImpl()->getSelectionDAGInfo();