diff options
author | Nikolai Bozhenov <nikolai.bozhenov@intel.com> | 2017-12-07 12:35:02 +0000 |
---|---|---|
committer | Nikolai Bozhenov <nikolai.bozhenov@intel.com> | 2017-12-07 12:35:02 +0000 |
commit | 1cf9c54e5c74e6e8a5d4cb152b105ab6c5964739 (patch) | |
tree | 560e4d68271ed7bcccfdf34759374956df39d78b /llvm/lib/Target/Nios2/Nios2Subtarget.h | |
parent | 44cfc51415e6acc6ea53029d7499923864a4cd5d (diff) | |
download | bcm5719-llvm-1cf9c54e5c74e6e8a5d4cb152b105ab6c5964739.tar.gz bcm5719-llvm-1cf9c54e5c74e6e8a5d4cb152b105ab6c5964739.zip |
[Nios2] final infrastructure to provide compilation of a return from a function
This patch includes all missing functionality needed to provide first
compilation of a simple program that just returns from a function.
I've added a test case that checks for "ret" instruction printed in assembly
output.
Patch by Andrei Grischenko (andrei.l.grischenko@intel.com)
Differential revision: https://reviews.llvm.org/D39688
llvm-svn: 320035
Diffstat (limited to 'llvm/lib/Target/Nios2/Nios2Subtarget.h')
-rw-r--r-- | llvm/lib/Target/Nios2/Nios2Subtarget.h | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/llvm/lib/Target/Nios2/Nios2Subtarget.h b/llvm/lib/Target/Nios2/Nios2Subtarget.h index b03a291946d..a822dff33b5 100644 --- a/llvm/lib/Target/Nios2/Nios2Subtarget.h +++ b/llvm/lib/Target/Nios2/Nios2Subtarget.h @@ -15,7 +15,10 @@ #define LLVM_LIB_TARGET_NIOS2_NIOS2SUBTARGET_H #include "Nios2FrameLowering.h" +#include "Nios2ISelLowering.h" #include "Nios2InstrInfo.h" +#include "llvm/CodeGen/SelectionDAGTargetInfo.h" +#include "llvm/CodeGen/TargetFrameLowering.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" #define GET_SUBTARGETINFO_HEADER @@ -51,18 +54,18 @@ protected: // Nios2 architecture version Nios2ArchEnum Nios2ArchVersion; - const Nios2TargetMachine &TM; - Triple TargetTriple; - std::unique_ptr<const Nios2InstrInfo> InstrInfo; - std::unique_ptr<const Nios2FrameLowering> FrameLowering; + Nios2InstrInfo InstrInfo; + Nios2TargetLowering TLInfo; + SelectionDAGTargetInfo TSInfo; + Nios2FrameLowering FrameLowering; public: /// This constructor initializes the data members to match that /// of the specified triple. Nios2Subtarget(const Triple &TT, const std::string &CPU, - const std::string &FS, const Nios2TargetMachine &_TM); + const std::string &FS, const TargetMachine &TM); /// ParseSubtargetFeatures - Parses features string setting specified /// subtarget options. Definition of function is auto generated by tblgen. @@ -73,14 +76,20 @@ public: bool hasNios2r2() const { return Nios2ArchVersion >= Nios2r2; } bool isNios2r2() const { return Nios2ArchVersion == Nios2r2; } - Nios2Subtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS, - const TargetMachine &TM); + Nios2Subtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS); + const Nios2InstrInfo *getInstrInfo() const override { return &InstrInfo; } const TargetFrameLowering *getFrameLowering() const override { - return FrameLowering.get(); + return &FrameLowering; } const Nios2RegisterInfo *getRegisterInfo() const override { - return &InstrInfo->getRegisterInfo(); + return &InstrInfo.getRegisterInfo(); + } + const Nios2TargetLowering *getTargetLowering() const override { + return &TLInfo; + } + const SelectionDAGTargetInfo *getSelectionDAGInfo() const override { + return &TSInfo; } }; } // namespace llvm |