From: Evan Cheng Date: Thu, 13 Nov 2008 19:22:28 +0000 (+0000) Subject: Don't forget to emit stubs for function GV's emitted in CONSTPOOL_ENTRY's. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=35b0bfd06dd5ce8f679a497b3fbfae43667f8727;p=oota-llvm.git Don't forget to emit stubs for function GV's emitted in CONSTPOOL_ENTRY's. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59258 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/ARM/ARMCodeEmitter.cpp b/lib/Target/ARM/ARMCodeEmitter.cpp index 26b2b8249ac..4bbf3018c20 100644 --- a/lib/Target/ARM/ARMCodeEmitter.cpp +++ b/lib/Target/ARM/ARMCodeEmitter.cpp @@ -388,7 +388,7 @@ void ARMCodeEmitter::emitConstPoolInstruction(const MachineInstr &MI) { (intptr_t)ACPV, false)); else emitGlobalAddress(GV, ARM::reloc_arm_machine_cp_entry, - ACPV->isStub(), (intptr_t)ACPV); + ACPV->isStub() || isa(GV), (intptr_t)ACPV); } else { assert(!ACPV->isNonLazyPointer() && "Don't know how to deal this yet!"); emitExternalSymbolAddress(ACPV->getSymbol(), ARM::reloc_arm_absolute); @@ -397,11 +397,18 @@ void ARMCodeEmitter::emitConstPoolInstruction(const MachineInstr &MI) { } else { Constant *CV = MCPE.Val.ConstVal; +#ifndef NDEBUG DOUT << " ** Constant pool #" << CPI << " @ " - << (void*)MCE.getCurrentPCValue() << " " << *CV << '\n'; + << (void*)MCE.getCurrentPCValue() << " "; + if (const Function *F = dyn_cast(CV)) + DOUT << F->getName(); + else + DOUT << *CV; + DOUT << '\n'; +#endif if (GlobalValue *GV = dyn_cast(CV)) { - emitGlobalAddress(GV, ARM::reloc_arm_absolute, false); + emitGlobalAddress(GV, ARM::reloc_arm_absolute, isa(GV)); emitWordLE(0); } else if (const ConstantInt *CI = dyn_cast(CV)) { uint32_t Val = *(uint32_t*)CI->getValue().getRawData();