summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ELFTargetAsmInfo.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-11-03 18:22:42 +0000
committerDan Gohman <gohman@apple.com>2008-11-03 18:22:42 +0000
commitac41d9f5d81a28d9148411b03f556cc1e99880ca (patch)
tree5e526e0adecb02355eea5051a993f67ad40744e3 /llvm/lib/Target/ELFTargetAsmInfo.cpp
parentd7546abb8a25babb270912e6f1522956ad98b940 (diff)
downloadbcm5719-llvm-ac41d9f5d81a28d9148411b03f556cc1e99880ca.tar.gz
bcm5719-llvm-ac41d9f5d81a28d9148411b03f556cc1e99880ca.zip
Refactor various TargetAsmInfo subclasses' TargetMachine members away
adding a TargetMachine member to the base TargetAsmInfo class instead. llvm-svn: 58624
Diffstat (limited to 'llvm/lib/Target/ELFTargetAsmInfo.cpp')
-rw-r--r--llvm/lib/Target/ELFTargetAsmInfo.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Target/ELFTargetAsmInfo.cpp b/llvm/lib/Target/ELFTargetAsmInfo.cpp
index dcf18309e9c..47727d111f1 100644
--- a/llvm/lib/Target/ELFTargetAsmInfo.cpp
+++ b/llvm/lib/Target/ELFTargetAsmInfo.cpp
@@ -24,8 +24,8 @@
using namespace llvm;
-ELFTargetAsmInfo::ELFTargetAsmInfo(const TargetMachine &TM) {
- ETM = &TM;
+ELFTargetAsmInfo::ELFTargetAsmInfo(const TargetMachine &TM)
+ : TargetAsmInfo(TM) {
BSSSection_ = getUnnamedSection("\t.bss",
SectionFlags::Writeable | SectionFlags::BSS);
@@ -102,7 +102,7 @@ ELFTargetAsmInfo::MergeableConstSection(const GlobalVariable *GV) const {
inline const Section*
ELFTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
- const TargetData *TD = ETM->getTargetData();
+ const TargetData *TD = TM.getTargetData();
// FIXME: string here is temporary, until stuff will fully land in.
// We cannot use {Four,Eight,Sixteen}ByteConstantSection here, since it's
@@ -121,7 +121,7 @@ ELFTargetAsmInfo::MergeableConstSection(const Type *Ty) const {
const Section*
ELFTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const {
- const TargetData *TD = ETM->getTargetData();
+ const TargetData *TD = TM.getTargetData();
Constant *C = cast<GlobalVariable>(GV)->getInitializer();
const ConstantArray *CVA = cast<ConstantArray>(C);
const Type *Ty = CVA->getType()->getElementType();
@@ -131,7 +131,6 @@ ELFTargetAsmInfo::MergeableStringSection(const GlobalVariable *GV) const {
assert(getCStringSection() && "Should have string section prefix");
// We also need alignment here
- const TargetData *TD = ETM->getTargetData();
unsigned Align = TD->getPrefTypeAlignment(Ty);
if (Align < Size)
Align = Size;
OpenPOWER on IntegriCloud