summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/R600/AMDGPUTargetMachine.h
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2015-03-12 00:07:24 +0000
committerMehdi Amini <mehdi.amini@apple.com>2015-03-12 00:07:24 +0000
commit93e1ea167ef5bb703bb02a47c6412057a58af63a (patch)
treeb89fd138fb5fec1c005b68ecf7aa560077934f37 /llvm/lib/Target/R600/AMDGPUTargetMachine.h
parent27173288c296638e7e3c9e6c1653e305e3482a63 (diff)
downloadbcm5719-llvm-93e1ea167ef5bb703bb02a47c6412057a58af63a.tar.gz
bcm5719-llvm-93e1ea167ef5bb703bb02a47c6412057a58af63a.zip
Move the DataLayout to the generic TargetMachine, making it mandatory.
Summary: I don't know why every singled backend had to redeclare its own DataLayout. There was a virtual getDataLayout() on the common base TargetMachine, the default implementation returned nullptr. It was not clear from this that we could assume at call site that a DataLayout will be available with each Target. Now getDataLayout() is no longer virtual and return a pointer to the DataLayout member of the common base TargetMachine. I plan to turn it into a reference in a future patch. The only backend that didn't have a DataLayout previsouly was the CPPBackend. It now initializes the default DataLayout. This commit is NFC for all the other backends. Test Plan: clang+llvm ninja check-all Reviewers: echristo Subscribers: jfb, jholewinski, llvm-commits Differential Revision: http://reviews.llvm.org/D8243 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 231987
Diffstat (limited to 'llvm/lib/Target/R600/AMDGPUTargetMachine.h')
-rw-r--r--llvm/lib/Target/R600/AMDGPUTargetMachine.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/llvm/lib/Target/R600/AMDGPUTargetMachine.h b/llvm/lib/Target/R600/AMDGPUTargetMachine.h
index a6915369315..8fc66b1fcd2 100644
--- a/llvm/lib/Target/R600/AMDGPUTargetMachine.h
+++ b/llvm/lib/Target/R600/AMDGPUTargetMachine.h
@@ -30,7 +30,6 @@ namespace llvm {
class AMDGPUTargetMachine : public LLVMTargetMachine {
private:
- const DataLayout DL;
protected:
TargetLoweringObjectFile *TLOF;
@@ -42,11 +41,7 @@ public:
StringRef CPU, TargetOptions Options, Reloc::Model RM,
CodeModel::Model CM, CodeGenOpt::Level OL);
~AMDGPUTargetMachine();
- // FIXME: This is currently broken, the DataLayout needs to move to
- // the target machine.
- const DataLayout *getDataLayout() const override {
- return &DL;
- }
+
const AMDGPUSubtarget *getSubtargetImpl() const override {
return &Subtarget;
}
OpenPOWER on IntegriCloud