Fix PR103
authorBrian Gaeke <gaeke@uiuc.edu>
Sun, 9 Nov 2003 07:08:34 +0000 (07:08 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Sun, 9 Nov 2003 07:08:34 +0000 (07:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9830 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SparcV9/SparcV9CodeEmitter.cpp

index 5863fd67b46763c2d165760815616026de068681..d60d9151c1ce86d1a9acc2127725184202819d17 100644 (file)
@@ -606,12 +606,9 @@ int64_t SparcV9CodeEmitter::getMachineOpValue(MachineInstr &MI,
       // external function calls, etc.?
       if (Function *F = dyn_cast<Function>(GV)) {
         DEBUG(std::cerr << "Function: ");
-        if (F->isExternal()) {
-          // Sparc backend broken: this MO should be `ExternalSymbol'
-          rv = (int64_t)MCE.getGlobalValueAddress(F->getName());
-        } else {
-          rv = (int64_t)MCE.getGlobalValueAddress(F);
-        }
+        // NOTE: This results in stubs being generated even for
+        // external, native functions, which is not optimal. See PR103.
+        rv = (int64_t)MCE.getGlobalValueAddress(F);
         if (rv == 0) {
           DEBUG(std::cerr << "not yet generated\n");
           // Function has not yet been code generated!