diff --git a/lib/Target/Sparc/SparcV8CodeEmitter.cpp b/lib/Target/Sparc/SparcV8CodeEmitter.cpp index 2e43c43cbbd..76c854bc536 100644 --- a/lib/Target/Sparc/SparcV8CodeEmitter.cpp +++ b/lib/Target/Sparc/SparcV8CodeEmitter.cpp @@ -140,32 +140,8 @@ int64_t SparcV8CodeEmitter::getMachineOpValue(MachineInstr &MI, rv = MO.getImmedValue(); } else if (MO.isGlobalAddress()) { GlobalValue *GV = MO.getGlobal(); - if (MO.isPCRelative()) { // Global variable reference - if (void *Addr = (void*)(intptr_t)MCE.getGlobalValueAddress(GV)) { - intptr_t CurrPC = MCE.getCurrentPCValue(); - return (int64_t) (((long)Addr - (long)CurrPC) >> 2); - } else { - std::cerr << "Unhandled pc-relative global value: " << GV << "\n"; - abort(); - } - } else { // Function reference - if (!(rv = (intptr_t)MCE.getGlobalValueAddress(GV))) { - if (Function *F = dyn_cast(GV)) { - std::cerr << "SparcV8CodeEmitter error: no lazy fn resolution yet!\n"; - abort(); -#if 0 - // Function has not yet been code generated! - TheJITResolver->addFunctionReference(MCE.getCurrentPCValue(), - cast(GV)); - // Delayed resolution... - return (intptr_t)TheJITResolver->getLazyResolver(cast(GV)); -#endif - } else { - std::cerr << "Unhandled global value: " << GV << "\n"; - abort(); - } - } - } + std::cerr << "Unhandled global value: " << GV << "\n"; + abort(); } else if (MO.isMachineBasicBlock()) { const BasicBlock *BB = MO.getMachineBasicBlock()->getBasicBlock(); unsigned* CurrPC = (unsigned*)(intptr_t)MCE.getCurrentPCValue(); diff --git a/lib/Target/SparcV8/SparcV8CodeEmitter.cpp b/lib/Target/SparcV8/SparcV8CodeEmitter.cpp index 2e43c43cbbd..76c854bc536 100644 --- a/lib/Target/SparcV8/SparcV8CodeEmitter.cpp +++ b/lib/Target/SparcV8/SparcV8CodeEmitter.cpp @@ -140,32 +140,8 @@ int64_t SparcV8CodeEmitter::getMachineOpValue(MachineInstr &MI, rv = MO.getImmedValue(); } else if (MO.isGlobalAddress()) { GlobalValue *GV = MO.getGlobal(); - if (MO.isPCRelative()) { // Global variable reference - if (void *Addr = (void*)(intptr_t)MCE.getGlobalValueAddress(GV)) { - intptr_t CurrPC = MCE.getCurrentPCValue(); - return (int64_t) (((long)Addr - (long)CurrPC) >> 2); - } else { - std::cerr << "Unhandled pc-relative global value: " << GV << "\n"; - abort(); - } - } else { // Function reference - if (!(rv = (intptr_t)MCE.getGlobalValueAddress(GV))) { - if (Function *F = dyn_cast(GV)) { - std::cerr << "SparcV8CodeEmitter error: no lazy fn resolution yet!\n"; - abort(); -#if 0 - // Function has not yet been code generated! - TheJITResolver->addFunctionReference(MCE.getCurrentPCValue(), - cast(GV)); - // Delayed resolution... - return (intptr_t)TheJITResolver->getLazyResolver(cast(GV)); -#endif - } else { - std::cerr << "Unhandled global value: " << GV << "\n"; - abort(); - } - } - } + std::cerr << "Unhandled global value: " << GV << "\n"; + abort(); } else if (MO.isMachineBasicBlock()) { const BasicBlock *BB = MO.getMachineBasicBlock()->getBasicBlock(); unsigned* CurrPC = (unsigned*)(intptr_t)MCE.getCurrentPCValue();