mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-26 21:20:37 +00:00
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
This commit is contained in:
parent
2eeda6ed8f
commit
99b394db15
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user