diff options
author | Chris Lattner <sabre@nondot.org> | 2004-11-22 21:45:54 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-11-22 21:45:54 +0000 |
commit | 99b394db151615414fc3de24e72c199799a05398 (patch) | |
tree | bc3bc7676fa35e7a6ccb5f35dc5ac5db2627184e /lib | |
parent | 2eeda6ed8f46f07f461d3ee13ec2ecc882ebc263 (diff) | |
download | external_llvm-99b394db151615414fc3de24e72c199799a05398.zip external_llvm-99b394db151615414fc3de24e72c199799a05398.tar.gz external_llvm-99b394db151615414fc3de24e72c199799a05398.tar.bz2 |
This chunk of code needs to be rewritten
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18127 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/PowerPC/PPCCodeEmitter.cpp | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/lib/Target/PowerPC/PPCCodeEmitter.cpp b/lib/Target/PowerPC/PPCCodeEmitter.cpp index 5f810cb..a63a7a3 100644 --- a/lib/Target/PowerPC/PPCCodeEmitter.cpp +++ b/lib/Target/PowerPC/PPCCodeEmitter.cpp @@ -274,34 +274,9 @@ int64_t PPC32CodeEmitter::getMachineOpValue(MachineInstr &MI, } else if (MO.isImmediate()) { rv = MO.getImmedValue(); } else if (MO.isGlobalAddress()) { - GlobalValue *GV = MO.getGlobal(); - rv = MCE.getGlobalValueAddress(GV); - if (rv == 0) { - if (Function *F = dyn_cast<Function>(GV)) { - if (F->isExternal()) - rv = getAddressOfExternalFunction(F); - else { - // Function has not yet been code generated! Use lazy resolution. - getResolver(MCE).addFunctionReference(MCE.getCurrentPCValue(), F); - rv = getResolver(MCE).getLazyResolver(F); - } - } else if (GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV)) { - if (GVar->isExternal()) { - rv = MCE.getGlobalValueAddress(MO.getSymbolName()); - if (!rv) { - std::cerr << "PPC32CodeEmitter: External global addr not found: " - << *GVar; - abort(); - } - } else { - std::cerr << "PPC32CodeEmitter: global addr not found: " << *GVar; - abort(); - } - } - } - if (MO.isPCRelative()) { // Global variable reference - rv = (rv - MCE.getCurrentPCValue()) >> 2; - } + //GlobalValue *GV = MO.getGlobal(); + // FIXME: Emit a relocation here. + rv = 0; } else if (MO.isMachineBasicBlock()) { const BasicBlock *BB = MO.getMachineBasicBlock()->getBasicBlock(); unsigned* CurrPC = (unsigned*)(intptr_t)MCE.getCurrentPCValue(); |