diff options
author | Owen Anderson <resistor@mac.com> | 2006-05-03 01:29:57 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2006-05-03 01:29:57 +0000 |
commit | a69571c7991813c93cba64e88eced6899ce93d81 (patch) | |
tree | 06bc81338c35527b69a6e8e7434e7c1a824bc4ca /lib/Target/Sparc/SparcAsmPrinter.cpp | |
parent | 0eb4d6b52e1b5db9a4c86e5a954356ae3507a287 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28074 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Sparc/SparcAsmPrinter.cpp')
-rw-r--r-- | lib/Target/Sparc/SparcAsmPrinter.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Target/Sparc/SparcAsmPrinter.cpp b/lib/Target/Sparc/SparcAsmPrinter.cpp index b4c40f1844..7033ab9422 100644 --- a/lib/Target/Sparc/SparcAsmPrinter.cpp +++ b/lib/Target/Sparc/SparcAsmPrinter.cpp @@ -232,7 +232,7 @@ bool SparcAsmPrinter::doInitialization(Module &M) { } bool SparcAsmPrinter::doFinalization(Module &M) { - const TargetData &TD = TM.getTargetData(); + const TargetData *TD = TM.getTargetData(); // Print out module-level global variables here. for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); @@ -245,8 +245,8 @@ bool SparcAsmPrinter::doFinalization(Module &M) { O << "\n\n"; std::string name = Mang->getValueName(I); Constant *C = I->getInitializer(); - unsigned Size = TD.getTypeSize(C->getType()); - unsigned Align = TD.getTypeAlignment(C->getType()); + unsigned Size = TD->getTypeSize(C->getType()); + unsigned Align = TD->getTypeAlignment(C->getType()); if (C->isNullValue() && (I->hasLinkOnceLinkage() || I->hasInternalLinkage() || @@ -255,8 +255,8 @@ bool SparcAsmPrinter::doFinalization(Module &M) { if (I->hasInternalLinkage()) O << "\t.local " << name << "\n"; - O << "\t.comm " << name << "," << TD.getTypeSize(C->getType()) - << "," << (unsigned)TD.getTypeAlignment(C->getType()); + O << "\t.comm " << name << "," << TD->getTypeSize(C->getType()) + << "," << (unsigned)TD->getTypeAlignment(C->getType()); O << "\t\t! "; WriteAsOperand(O, I, true, true, &M); O << "\n"; |