summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Nios2/Nios2InstrInfo.h
diff options
context:
space:
mode:
authorNikolai Bozhenov <nikolai.bozhenov@intel.com>2017-12-07 12:35:02 +0000
committerNikolai Bozhenov <nikolai.bozhenov@intel.com>2017-12-07 12:35:02 +0000
commit1cf9c54e5c74e6e8a5d4cb152b105ab6c5964739 (patch)
tree560e4d68271ed7bcccfdf34759374956df39d78b /llvm/lib/Target/Nios2/Nios2InstrInfo.h
parent44cfc51415e6acc6ea53029d7499923864a4cd5d (diff)
downloadbcm5719-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/Nios2InstrInfo.h')
-rw-r--r--llvm/lib/Target/Nios2/Nios2InstrInfo.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/llvm/lib/Target/Nios2/Nios2InstrInfo.h b/llvm/lib/Target/Nios2/Nios2InstrInfo.h
index 6a0a050c839..a994d3662db 100644
--- a/llvm/lib/Target/Nios2/Nios2InstrInfo.h
+++ b/llvm/lib/Target/Nios2/Nios2InstrInfo.h
@@ -14,10 +14,7 @@
#ifndef LLVM_LIB_TARGET_NIOS2_NIOS2INSTRINFO_H
#define LLVM_LIB_TARGET_NIOS2_NIOS2INSTRINFO_H
-#include "Nios2.h"
#include "Nios2RegisterInfo.h"
-
-#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#define GET_INSTRINFO_HEADER
@@ -25,22 +22,23 @@
namespace llvm {
+class Nios2Subtarget;
+
class Nios2InstrInfo : public Nios2GenInstrInfo {
-protected:
- const Nios2Subtarget &Subtarget;
const Nios2RegisterInfo RI;
+ const Nios2Subtarget &Subtarget;
+ virtual void anchor();
public:
- explicit Nios2InstrInfo(const Nios2Subtarget &STI)
- : Nios2GenInstrInfo(), Subtarget(STI), RI(STI) {}
-
- static const Nios2InstrInfo *create(Nios2Subtarget &STI);
+ explicit Nios2InstrInfo(Nios2Subtarget &ST);
/// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
/// such, whenever a client has an instance of instruction info, it should
/// always be able to get register info as well (through this method).
///
- const Nios2RegisterInfo &getRegisterInfo() const;
+ const Nios2RegisterInfo &getRegisterInfo() const { return RI; };
+
+ bool expandPostRAPseudo(MachineInstr &MI) const override;
};
} // namespace llvm
OpenPOWER on IntegriCloud