[llvm] r227133 - bpf: fix build due to 'Move DataLayout back to the TargetMachine'
Alexei Starovoitov
alexei.starovoitov at gmail.com
Mon Jan 26 12:43:16 PST 2015
Author: ast
Date: Mon Jan 26 14:43:15 2015
New Revision: 227133
URL: http://llvm.org/viewvc/llvm-project?rev=227133&view=rev
Log:
bpf: fix build due to 'Move DataLayout back to the TargetMachine'
commit r227113 moved DataLayout
Modified:
llvm/trunk/lib/Target/BPF/BPFSubtarget.cpp
llvm/trunk/lib/Target/BPF/BPFSubtarget.h
llvm/trunk/lib/Target/BPF/BPFTargetMachine.cpp
llvm/trunk/lib/Target/BPF/BPFTargetMachine.h
Modified: llvm/trunk/lib/Target/BPF/BPFSubtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/BPF/BPFSubtarget.cpp?rev=227133&r1=227132&r2=227133&view=diff
==============================================================================
--- llvm/trunk/lib/Target/BPF/BPFSubtarget.cpp (original)
+++ llvm/trunk/lib/Target/BPF/BPFSubtarget.cpp Mon Jan 26 14:43:15 2015
@@ -27,5 +27,5 @@ void BPFSubtarget::anchor() {}
BPFSubtarget::BPFSubtarget(const std::string &TT, const std::string &CPU,
const std::string &FS, const TargetMachine &TM)
- : BPFGenSubtargetInfo(TT, CPU, FS), DL("e-m:e-p:64:64-i64:64-n32:64-S128"),
- InstrInfo(), FrameLowering(*this), TLInfo(TM), TSInfo(&DL) {}
+ : BPFGenSubtargetInfo(TT, CPU, FS), InstrInfo(), FrameLowering(*this),
+ TLInfo(TM), TSInfo(TM.getDataLayout()) {}
Modified: llvm/trunk/lib/Target/BPF/BPFSubtarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/BPF/BPFSubtarget.h?rev=227133&r1=227132&r2=227133&view=diff
==============================================================================
--- llvm/trunk/lib/Target/BPF/BPFSubtarget.h (original)
+++ llvm/trunk/lib/Target/BPF/BPFSubtarget.h Mon Jan 26 14:43:15 2015
@@ -30,7 +30,6 @@ class StringRef;
class BPFSubtarget : public BPFGenSubtargetInfo {
virtual void anchor();
- const DataLayout DL; // Calculates type size & alignment
BPFInstrInfo InstrInfo;
BPFFrameLowering FrameLowering;
BPFTargetLowering TLInfo;
@@ -59,7 +58,6 @@ public:
const TargetRegisterInfo *getRegisterInfo() const override {
return &InstrInfo.getRegisterInfo();
}
- const DataLayout *getDataLayout() const override { return &DL; }
};
} // End llvm namespace
Modified: llvm/trunk/lib/Target/BPF/BPFTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/BPF/BPFTargetMachine.cpp?rev=227133&r1=227132&r2=227133&view=diff
==============================================================================
--- llvm/trunk/lib/Target/BPF/BPFTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/BPF/BPFTargetMachine.cpp Mon Jan 26 14:43:15 2015
@@ -37,6 +37,7 @@ BPFTargetMachine::BPFTargetMachine(const
CodeGenOpt::Level OL)
: LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL),
TLOF(make_unique<TargetLoweringObjectFileELF>()),
+ DL("e-m:e-p:64:64-i64:64-n32:64-S128"),
Subtarget(TT, CPU, FS, *this) {
initAsmInfo();
}
Modified: llvm/trunk/lib/Target/BPF/BPFTargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/BPF/BPFTargetMachine.h?rev=227133&r1=227132&r2=227133&view=diff
==============================================================================
--- llvm/trunk/lib/Target/BPF/BPFTargetMachine.h (original)
+++ llvm/trunk/lib/Target/BPF/BPFTargetMachine.h Mon Jan 26 14:43:15 2015
@@ -20,6 +20,7 @@
namespace llvm {
class BPFTargetMachine : public LLVMTargetMachine {
std::unique_ptr<TargetLoweringObjectFile> TLOF;
+ const DataLayout DL;
BPFSubtarget Subtarget;
public:
@@ -27,6 +28,7 @@ public:
const TargetOptions &Options, Reloc::Model RM,
CodeModel::Model CM, CodeGenOpt::Level OL);
+ const DataLayout *getDataLayout() const override { return &DL; }
const BPFSubtarget *getSubtargetImpl() const override { return &Subtarget; }
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
More information about the llvm-commits
mailing list