OSDN Git Service

No need to generate a lazy-linking stub for internal functions, they can be
authorMisha Brukman <brukman+llvm@gmail.com>
Mon, 28 Jun 2004 18:03:37 +0000 (18:03 +0000)
committerMisha Brukman <brukman+llvm@gmail.com>
Mon, 28 Jun 2004 18:03:37 +0000 (18:03 +0000)
resolved by the static linker.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14467 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPC32AsmPrinter.cpp
lib/Target/PowerPC/PPCAsmPrinter.cpp
lib/Target/PowerPC/PowerPCAsmPrinter.cpp

index 636b1c4..322122a 100644 (file)
@@ -427,7 +427,9 @@ void Printer::printOp(const MachineOperand &MO,
     return;
   case MachineOperand::MO_GlobalAddress:
     if (!elideOffsetKeyword) {
-      if (isa<Function>(MO.getGlobal())) {
+      // Dynamically-resolved functions need a stub for the function
+      Function *F = dyn_cast<Function>(MO.getGlobal());
+      if (F && F->isExternal()) {
         Stubs.insert(Mang->getValueName(MO.getGlobal()));
         O << "L" << Mang->getValueName(MO.getGlobal()) << "$stub";
       } else {
index 636b1c4..322122a 100644 (file)
@@ -427,7 +427,9 @@ void Printer::printOp(const MachineOperand &MO,
     return;
   case MachineOperand::MO_GlobalAddress:
     if (!elideOffsetKeyword) {
-      if (isa<Function>(MO.getGlobal())) {
+      // Dynamically-resolved functions need a stub for the function
+      Function *F = dyn_cast<Function>(MO.getGlobal());
+      if (F && F->isExternal()) {
         Stubs.insert(Mang->getValueName(MO.getGlobal()));
         O << "L" << Mang->getValueName(MO.getGlobal()) << "$stub";
       } else {
index 636b1c4..322122a 100644 (file)
@@ -427,7 +427,9 @@ void Printer::printOp(const MachineOperand &MO,
     return;
   case MachineOperand::MO_GlobalAddress:
     if (!elideOffsetKeyword) {
-      if (isa<Function>(MO.getGlobal())) {
+      // Dynamically-resolved functions need a stub for the function
+      Function *F = dyn_cast<Function>(MO.getGlobal());
+      if (F && F->isExternal()) {
         Stubs.insert(Mang->getValueName(MO.getGlobal()));
         O << "L" << Mang->getValueName(MO.getGlobal()) << "$stub";
       } else {