summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PIC16
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-05-11 17:31:57 +0000
committerDan Gohman <gohman@apple.com>2010-05-11 17:31:57 +0000
commitbb919dfb6bfe6c3f8b119a2341fb647f6d18a150 (patch)
tree2247003e684bbd62b468104686e4cee76bc7396f /llvm/lib/Target/PIC16
parent3937e28da01728c12f9f4b6e79b66425e6ab082b (diff)
downloadbcm5719-llvm-bb919dfb6bfe6c3f8b119a2341fb647f6d18a150.tar.gz
bcm5719-llvm-bb919dfb6bfe6c3f8b119a2341fb647f6d18a150.zip
Implement a bunch more TargetSelectionDAGInfo infrastructure.
Move EmitTargetCodeForMemcpy, EmitTargetCodeForMemset, and EmitTargetCodeForMemmove out of TargetLowering and into SelectionDAGInfo to exercise this. llvm-svn: 103481
Diffstat (limited to 'llvm/lib/Target/PIC16')
-rw-r--r--llvm/lib/Target/PIC16/PIC16SelectionDAGInfo.cpp5
-rw-r--r--llvm/lib/Target/PIC16/PIC16SelectionDAGInfo.h4
-rw-r--r--llvm/lib/Target/PIC16/PIC16TargetMachine.cpp2
-rw-r--r--llvm/lib/Target/PIC16/PIC16TargetMachine.h6
4 files changed, 13 insertions, 4 deletions
diff --git a/llvm/lib/Target/PIC16/PIC16SelectionDAGInfo.cpp b/llvm/lib/Target/PIC16/PIC16SelectionDAGInfo.cpp
index 76c6c6091e5..995955a0c89 100644
--- a/llvm/lib/Target/PIC16/PIC16SelectionDAGInfo.cpp
+++ b/llvm/lib/Target/PIC16/PIC16SelectionDAGInfo.cpp
@@ -12,10 +12,11 @@
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "pic16-selectiondag-info"
-#include "PIC16SelectionDAGInfo.h"
+#include "PIC16TargetMachine.h"
using namespace llvm;
-PIC16SelectionDAGInfo::PIC16SelectionDAGInfo() {
+PIC16SelectionDAGInfo::PIC16SelectionDAGInfo(const PIC16TargetMachine &TM)
+ : TargetSelectionDAGInfo(TM) {
}
PIC16SelectionDAGInfo::~PIC16SelectionDAGInfo() {
diff --git a/llvm/lib/Target/PIC16/PIC16SelectionDAGInfo.h b/llvm/lib/Target/PIC16/PIC16SelectionDAGInfo.h
index 112480e50cc..c67fd8bfce2 100644
--- a/llvm/lib/Target/PIC16/PIC16SelectionDAGInfo.h
+++ b/llvm/lib/Target/PIC16/PIC16SelectionDAGInfo.h
@@ -18,9 +18,11 @@
namespace llvm {
+class PIC16TargetMachine;
+
class PIC16SelectionDAGInfo : public TargetSelectionDAGInfo {
public:
- PIC16SelectionDAGInfo();
+ explicit PIC16SelectionDAGInfo(const PIC16TargetMachine &TM);
~PIC16SelectionDAGInfo();
};
diff --git a/llvm/lib/Target/PIC16/PIC16TargetMachine.cpp b/llvm/lib/Target/PIC16/PIC16TargetMachine.cpp
index e2acb851ea2..82b69be8d13 100644
--- a/llvm/lib/Target/PIC16/PIC16TargetMachine.cpp
+++ b/llvm/lib/Target/PIC16/PIC16TargetMachine.cpp
@@ -35,7 +35,7 @@ PIC16TargetMachine::PIC16TargetMachine(const Target &T, const std::string &TT,
: LLVMTargetMachine(T, TT),
Subtarget(TT, FS, Trad),
DataLayout("e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-n8"),
- InstrInfo(*this), TLInfo(*this),
+ InstrInfo(*this), TLInfo(*this), TSInfo(*this),
FrameInfo(TargetFrameInfo::StackGrowsUp, 8, 0) { }
diff --git a/llvm/lib/Target/PIC16/PIC16TargetMachine.h b/llvm/lib/Target/PIC16/PIC16TargetMachine.h
index 849845afd43..dae5d3129c6 100644
--- a/llvm/lib/Target/PIC16/PIC16TargetMachine.h
+++ b/llvm/lib/Target/PIC16/PIC16TargetMachine.h
@@ -17,6 +17,7 @@
#include "PIC16InstrInfo.h"
#include "PIC16ISelLowering.h"
+#include "PIC16SelectionDAGInfo.h"
#include "PIC16RegisterInfo.h"
#include "PIC16Subtarget.h"
#include "llvm/Target/TargetData.h"
@@ -32,6 +33,7 @@ class PIC16TargetMachine : public LLVMTargetMachine {
const TargetData DataLayout; // Calculates type size & alignment
PIC16InstrInfo InstrInfo;
PIC16TargetLowering TLInfo;
+ PIC16SelectionDAGInfo TSInfo;
// PIC16 does not have any call stack frame, therefore not having
// any PIC16 specific FrameInfo class.
@@ -54,6 +56,10 @@ public:
return &TLInfo;
}
+ virtual const PIC16SelectionDAGInfo* getSelectionDAGInfo() const {
+ return &TSInfo;
+ }
+
virtual bool addInstSelector(PassManagerBase &PM,
CodeGenOpt::Level OptLevel);
virtual bool addPreEmitPass(PassManagerBase &PM, CodeGenOpt::Level OptLevel);
OpenPOWER on IntegriCloud