aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2004-05-19 21:30:01 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2004-05-19 21:30:01 +0000
commita900452d37ec2b5ae34b0aedfefe23675476a6c4 (patch)
tree44b8958e58a80fa8bfd3986ba5883773b9a8a846 /lib/Target
parente38adf52c8b367b86a547fcf967047d1968ae9f2 (diff)
downloadexternal_llvm-a900452d37ec2b5ae34b0aedfefe23675476a6c4.zip
external_llvm-a900452d37ec2b5ae34b0aedfefe23675476a6c4.tar.gz
external_llvm-a900452d37ec2b5ae34b0aedfefe23675476a6c4.tar.bz2
Minor simplification: eliminate a dyn_cast.
Fix a typo in a debug message. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13607 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/SparcV9/SparcV9CodeEmitter.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/Target/SparcV9/SparcV9CodeEmitter.cpp b/lib/Target/SparcV9/SparcV9CodeEmitter.cpp
index fcdbb7c..6606d8d 100644
--- a/lib/Target/SparcV9/SparcV9CodeEmitter.cpp
+++ b/lib/Target/SparcV9/SparcV9CodeEmitter.cpp
@@ -596,14 +596,9 @@ int64_t SparcV9CodeEmitter::getMachineOpValue(MachineInstr &MI,
DEBUG(std::cerr << "Saving reference to BB (VReg)\n");
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)) {
- 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 (const ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
+ // Make constant PC-relative by subtracting the PC from it.
+ rv = CI->getRawValue() - MCE.getCurrentPCValue();
} else if (GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
// same as MO.isGlobalAddress()
DEBUG(std::cerr << "GlobalValue: ");
@@ -777,7 +772,7 @@ void SparcV9CodeEmitter::emitBasicBlock(MachineBasicBlock &MBB) {
if (binCode == (1 << 30)) {
// this is an invalid call: the addr is out of bounds. that means a code
// sequence has already been emitted, and this is a no-op
- DEBUG(std::cerr << "Call supressed: already emitted far call.\n");
+ DEBUG(std::cerr << "Call suppressed: already emitted far call.\n");
} else {
emitWord(binCode);
}