summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/ELFWriter.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2006-05-03 01:29:57 +0000
committerOwen Anderson <resistor@mac.com>2006-05-03 01:29:57 +0000
commit20a631fde715280ecab9ae997ba7fa79434b4fe2 (patch)
tree0d724c5315fd81f33b7b09830661330efe099f9b /llvm/lib/CodeGen/ELFWriter.cpp
parent37c39b9c62c523ea324d635e1760f91754b0a371 (diff)
downloadbcm5719-llvm-20a631fde715280ecab9ae997ba7fa79434b4fe2.tar.gz
bcm5719-llvm-20a631fde715280ecab9ae997ba7fa79434b4fe2.zip
Refactor TargetMachine, pushing handling of TargetData into the target-specific subclasses. This has one caller-visible change: getTargetData() now returns a pointer instead of a reference.
This fixes PR 759. llvm-svn: 28074
Diffstat (limited to 'llvm/lib/CodeGen/ELFWriter.cpp')
-rw-r--r--llvm/lib/CodeGen/ELFWriter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/ELFWriter.cpp b/llvm/lib/CodeGen/ELFWriter.cpp
index 780ba543cdc..029cfe2b020 100644
--- a/llvm/lib/CodeGen/ELFWriter.cpp
+++ b/llvm/lib/CodeGen/ELFWriter.cpp
@@ -158,8 +158,8 @@ ELFWriter::ELFWriter(std::ostream &o, TargetMachine &tm) : O(o), TM(tm) {
e_machine = 0; // e_machine defaults to 'No Machine'
e_flags = 0; // e_flags defaults to 0, no flags.
- is64Bit = TM.getTargetData().getPointerSizeInBits() == 64;
- isLittleEndian = TM.getTargetData().isLittleEndian();
+ is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
+ isLittleEndian = TM.getTargetData()->isLittleEndian();
// Create the machine code emitter object for this target.
MCE = new ELFCodeEmitter(*this);
@@ -233,8 +233,8 @@ void ELFWriter::EmitGlobal(GlobalVariable *GV) {
}
const Type *GVType = (const Type*)GV->getType();
- unsigned Align = TM.getTargetData().getTypeAlignment(GVType);
- unsigned Size = TM.getTargetData().getTypeSize(GVType);
+ unsigned Align = TM.getTargetData()->getTypeAlignment(GVType);
+ unsigned Size = TM.getTargetData()->getTypeSize(GVType);
// If this global has a zero initializer, it is part of the .bss or common
// section.
OpenPOWER on IntegriCloud