From: Misha Brukman Date: Tue, 20 Jul 2004 15:45:27 +0000 (+0000) Subject: Differentiate between global and weak symbol loads X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e48178e8a652623c5c675f0f9dc495053ca76d2b;p=oota-llvm.git Differentiate between global and weak symbol loads git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15035 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/PowerPC/PPC32AsmPrinter.cpp b/lib/Target/PowerPC/PPC32AsmPrinter.cpp index 4e2b90e4b75..6c6b66afb08 100644 --- a/lib/Target/PowerPC/PPC32AsmPrinter.cpp +++ b/lib/Target/PowerPC/PPC32AsmPrinter.cpp @@ -224,10 +224,7 @@ void Printer::emitConstantValueOnly(const Constant *CV) { void Printer::emitGlobalConstant(const Constant *CV) { const TargetData &TD = TM.getTargetData(); - if (CV->isNullValue()) { - O << "\t.space\t " << TD.getTypeSize(CV->getType()) << "\n"; - return; - } else if (const ConstantArray *CVA = dyn_cast(CV)) { + if (const ConstantArray *CVA = dyn_cast(CV)) { if (isStringCompatible(CVA)) { O << "\t.ascii "; printAsCString(O, CVA); @@ -524,7 +521,7 @@ void Printer::printMachineInstruction(const MachineInstr *MI) { } O << TII.getName(MI->getOpcode()) << " "; - if (Opcode == PPC32::LOADLoAddr) { + if (Opcode == PPC32::LOADLoDirect || Opcode == PPC32::LOADLoIndirect) { printOp(MI->getOperand(0)); O << ", lo16("; printOp(MI->getOperand(2)); @@ -676,7 +673,7 @@ bool Printer::doFinalization(Module &M) { // Output stubs for external global variables if (GVStubs.begin() != GVStubs.end()) - O << "\t.non_lazy_symbol_pointer\n"; + O << ".data\n\t.non_lazy_symbol_pointer\n"; for (std::set::iterator i = GVStubs.begin(), e = GVStubs.end(); i != e; ++i) { O << "L" << *i << "$non_lazy_ptr:\n"; diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp index 4e2b90e4b75..6c6b66afb08 100644 --- a/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -224,10 +224,7 @@ void Printer::emitConstantValueOnly(const Constant *CV) { void Printer::emitGlobalConstant(const Constant *CV) { const TargetData &TD = TM.getTargetData(); - if (CV->isNullValue()) { - O << "\t.space\t " << TD.getTypeSize(CV->getType()) << "\n"; - return; - } else if (const ConstantArray *CVA = dyn_cast(CV)) { + if (const ConstantArray *CVA = dyn_cast(CV)) { if (isStringCompatible(CVA)) { O << "\t.ascii "; printAsCString(O, CVA); @@ -524,7 +521,7 @@ void Printer::printMachineInstruction(const MachineInstr *MI) { } O << TII.getName(MI->getOpcode()) << " "; - if (Opcode == PPC32::LOADLoAddr) { + if (Opcode == PPC32::LOADLoDirect || Opcode == PPC32::LOADLoIndirect) { printOp(MI->getOperand(0)); O << ", lo16("; printOp(MI->getOperand(2)); @@ -676,7 +673,7 @@ bool Printer::doFinalization(Module &M) { // Output stubs for external global variables if (GVStubs.begin() != GVStubs.end()) - O << "\t.non_lazy_symbol_pointer\n"; + O << ".data\n\t.non_lazy_symbol_pointer\n"; for (std::set::iterator i = GVStubs.begin(), e = GVStubs.end(); i != e; ++i) { O << "L" << *i << "$non_lazy_ptr:\n"; diff --git a/lib/Target/PowerPC/PowerPCAsmPrinter.cpp b/lib/Target/PowerPC/PowerPCAsmPrinter.cpp index 4e2b90e4b75..6c6b66afb08 100644 --- a/lib/Target/PowerPC/PowerPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PowerPCAsmPrinter.cpp @@ -224,10 +224,7 @@ void Printer::emitConstantValueOnly(const Constant *CV) { void Printer::emitGlobalConstant(const Constant *CV) { const TargetData &TD = TM.getTargetData(); - if (CV->isNullValue()) { - O << "\t.space\t " << TD.getTypeSize(CV->getType()) << "\n"; - return; - } else if (const ConstantArray *CVA = dyn_cast(CV)) { + if (const ConstantArray *CVA = dyn_cast(CV)) { if (isStringCompatible(CVA)) { O << "\t.ascii "; printAsCString(O, CVA); @@ -524,7 +521,7 @@ void Printer::printMachineInstruction(const MachineInstr *MI) { } O << TII.getName(MI->getOpcode()) << " "; - if (Opcode == PPC32::LOADLoAddr) { + if (Opcode == PPC32::LOADLoDirect || Opcode == PPC32::LOADLoIndirect) { printOp(MI->getOperand(0)); O << ", lo16("; printOp(MI->getOperand(2)); @@ -676,7 +673,7 @@ bool Printer::doFinalization(Module &M) { // Output stubs for external global variables if (GVStubs.begin() != GVStubs.end()) - O << "\t.non_lazy_symbol_pointer\n"; + O << ".data\n\t.non_lazy_symbol_pointer\n"; for (std::set::iterator i = GVStubs.begin(), e = GVStubs.end(); i != e; ++i) { O << "L" << *i << "$non_lazy_ptr:\n";