[mips] Simplify and optimize code.

No intended functionality change.

llvm-svn: 192213
This commit is contained in:
Akira Hatanaka 2013-10-08 18:13:24 +00:00
parent a2438bd913
commit ee909cc27f
2 changed files with 7 additions and 11 deletions

View File

@ -241,7 +241,7 @@ void MipsLongBranch::replaceBranch(MachineBasicBlock &MBB, Iter Br,
// and erase the original branch. // and erase the original branch.
assert(Br->isBundledWithSucc()); assert(Br->isBundledWithSucc());
MachineBasicBlock::instr_iterator II(Br); MachineBasicBlock::instr_iterator II(Br);
MIBundleBuilder(&*MIB).append(llvm::next(II)->removeFromBundle()); MIBundleBuilder(&*MIB).append((++II)->removeFromBundle());
Br->eraseFromParent(); Br->eraseFromParent();
} }

View File

@ -121,24 +121,20 @@ bool MipsFunctionInfo::isEhDataRegFI(int FI) const {
} }
MachinePointerInfo MipsFunctionInfo::callPtrInfo(const StringRef &Name) { MachinePointerInfo MipsFunctionInfo::callPtrInfo(const StringRef &Name) {
StringMap<const MipsCallEntry *>::const_iterator I; const MipsCallEntry *&E = ExternalCallEntries[Name];
I = ExternalCallEntries.find(Name);
if (I != ExternalCallEntries.end()) if (!E)
return MachinePointerInfo(I->getValue()); E = new MipsCallEntry(Name);
const MipsCallEntry *E = ExternalCallEntries[Name] = new MipsCallEntry(Name);
return MachinePointerInfo(E); return MachinePointerInfo(E);
} }
MachinePointerInfo MipsFunctionInfo::callPtrInfo(const GlobalValue *Val) { MachinePointerInfo MipsFunctionInfo::callPtrInfo(const GlobalValue *Val) {
ValueMap<const GlobalValue *, const MipsCallEntry *>::const_iterator I; const MipsCallEntry *&E = GlobalCallEntries[Val];
I = GlobalCallEntries.find(Val);
if (I != GlobalCallEntries.end()) if (!E)
return MachinePointerInfo(I->second); E = new MipsCallEntry(Val);
const MipsCallEntry *E = GlobalCallEntries[Val] = new MipsCallEntry(Val);
return MachinePointerInfo(E); return MachinePointerInfo(E);
} }