From: Misha Brukman Date: Mon, 28 Jun 2004 18:03:37 +0000 (+0000) Subject: No need to generate a lazy-linking stub for internal functions, they can be X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=a6e58b3cfb4b5a9be2512bd4fb936a1cb2010924;p=oota-llvm.git No need to generate a lazy-linking stub for internal functions, they can be resolved by the static linker. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14467 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/PowerPC/PPC32AsmPrinter.cpp b/lib/Target/PowerPC/PPC32AsmPrinter.cpp index 636b1c413db..322122a28b4 100644 --- a/lib/Target/PowerPC/PPC32AsmPrinter.cpp +++ b/lib/Target/PowerPC/PPC32AsmPrinter.cpp @@ -427,7 +427,9 @@ void Printer::printOp(const MachineOperand &MO, return; case MachineOperand::MO_GlobalAddress: if (!elideOffsetKeyword) { - if (isa(MO.getGlobal())) { + // Dynamically-resolved functions need a stub for the function + Function *F = dyn_cast(MO.getGlobal()); + if (F && F->isExternal()) { Stubs.insert(Mang->getValueName(MO.getGlobal())); O << "L" << Mang->getValueName(MO.getGlobal()) << "$stub"; } else { diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp index 636b1c413db..322122a28b4 100644 --- a/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -427,7 +427,9 @@ void Printer::printOp(const MachineOperand &MO, return; case MachineOperand::MO_GlobalAddress: if (!elideOffsetKeyword) { - if (isa(MO.getGlobal())) { + // Dynamically-resolved functions need a stub for the function + Function *F = dyn_cast(MO.getGlobal()); + if (F && F->isExternal()) { Stubs.insert(Mang->getValueName(MO.getGlobal())); O << "L" << Mang->getValueName(MO.getGlobal()) << "$stub"; } else { diff --git a/lib/Target/PowerPC/PowerPCAsmPrinter.cpp b/lib/Target/PowerPC/PowerPCAsmPrinter.cpp index 636b1c413db..322122a28b4 100644 --- a/lib/Target/PowerPC/PowerPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PowerPCAsmPrinter.cpp @@ -427,7 +427,9 @@ void Printer::printOp(const MachineOperand &MO, return; case MachineOperand::MO_GlobalAddress: if (!elideOffsetKeyword) { - if (isa(MO.getGlobal())) { + // Dynamically-resolved functions need a stub for the function + Function *F = dyn_cast(MO.getGlobal()); + if (F && F->isExternal()) { Stubs.insert(Mang->getValueName(MO.getGlobal())); O << "L" << Mang->getValueName(MO.getGlobal()) << "$stub"; } else {