aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Target/SparcV9/SparcV9CodeEmitter.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/Target/SparcV9/SparcV9CodeEmitter.cpp b/lib/Target/SparcV9/SparcV9CodeEmitter.cpp
index 5863fd67b4..d60d9151c1 100644
--- a/lib/Target/SparcV9/SparcV9CodeEmitter.cpp
+++ b/lib/Target/SparcV9/SparcV9CodeEmitter.cpp
@@ -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!