diff options
author | Misha Brukman <brukman+llvm@gmail.com> | 2003-11-07 21:07:30 +0000 |
---|---|---|
committer | Misha Brukman <brukman+llvm@gmail.com> | 2003-11-07 21:07:30 +0000 |
commit | 52709450c826efea71d6d94661e47d002b770ea1 (patch) | |
tree | c861420c2143fd259354e3605c9a99ffcb35afd6 | |
parent | dbde1ae7a03cfed13b7abd3a37fa74fbdc2c9551 (diff) | |
download | external_llvm-52709450c826efea71d6d94661e47d002b770ea1.zip external_llvm-52709450c826efea71d6d94661e47d002b770ea1.tar.gz external_llvm-52709450c826efea71d6d94661e47d002b770ea1.tar.bz2 |
Implement branching to a PC-relative constant (not a BasicBlock).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9793 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/SparcV9/SparcV9CodeEmitter.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Target/SparcV9/SparcV9CodeEmitter.cpp b/lib/Target/SparcV9/SparcV9CodeEmitter.cpp index a674d8a..5863fd6 100644 --- a/lib/Target/SparcV9/SparcV9CodeEmitter.cpp +++ b/lib/Target/SparcV9/SparcV9CodeEmitter.cpp @@ -593,8 +593,13 @@ int64_t SparcV9CodeEmitter::getMachineOpValue(MachineInstr &MI, unsigned* CurrPC = (unsigned*)(intptr_t)MCE.getCurrentPCValue(); BBRefs.push_back(std::make_pair(BB, std::make_pair(CurrPC, &MI))); } else if (const Constant *C = dyn_cast<Constant>(V)) { - std::cerr << "ERROR: constants should not appear in PcRel:" << MO << "\n"; - abort(); + if (const ConstantInt *CI = dyn_cast<ConstantInt>(C)) { + rv = CI->getRawValue() - MCE.getCurrentPCValue(); + } else { + std::cerr << "Cannot have non-integral const in instruction: " + << *C; + abort(); + } } else if (GlobalValue *GV = dyn_cast<GlobalValue>(V)) { // same as MO.isGlobalAddress() DEBUG(std::cerr << "GlobalValue: "); @@ -797,11 +802,6 @@ void* SparcV9CodeEmitter::getGlobalAddress(GlobalValue *V, MachineInstr &MI, // Delayed resolution... return (void*)(intptr_t)TheJITResolver->getLazyResolver(cast<Function>(V)); - - } else if (Constant *C = ConstantPointerRef::get(V)) { - // no longer applicable - std::cerr << "Unhandled Constant: " << *C << "\n"; - abort(); } else { std::cerr << "Unhandled global: " << *V << "\n"; abort(); |