diff options
author | Akira Hatanaka <ahatanaka@mips.com> | 2013-10-08 18:13:24 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@mips.com> | 2013-10-08 18:13:24 +0000 |
commit | 3e6a3becd5099bc922d166b1147995a03b3aeca8 (patch) | |
tree | 2a7684eef5b474bdf1191c314771c018ad689e0c /lib/Target/Mips | |
parent | 194d437f1181f464fc27900500a8773da4dec8b9 (diff) | |
download | external_llvm-3e6a3becd5099bc922d166b1147995a03b3aeca8.zip external_llvm-3e6a3becd5099bc922d166b1147995a03b3aeca8.tar.gz external_llvm-3e6a3becd5099bc922d166b1147995a03b3aeca8.tar.bz2 |
[mips] Simplify and optimize code.
No intended functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192213 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips')
-rw-r--r-- | lib/Target/Mips/MipsLongBranch.cpp | 2 | ||||
-rw-r--r-- | lib/Target/Mips/MipsMachineFunction.cpp | 16 |
2 files changed, 7 insertions, 11 deletions
diff --git a/lib/Target/Mips/MipsLongBranch.cpp b/lib/Target/Mips/MipsLongBranch.cpp index 06bb14a..ea8cc80 100644 --- a/lib/Target/Mips/MipsLongBranch.cpp +++ b/lib/Target/Mips/MipsLongBranch.cpp @@ -241,7 +241,7 @@ void MipsLongBranch::replaceBranch(MachineBasicBlock &MBB, Iter Br, // and erase the original branch. assert(Br->isBundledWithSucc()); MachineBasicBlock::instr_iterator II(Br); - MIBundleBuilder(&*MIB).append(llvm::next(II)->removeFromBundle()); + MIBundleBuilder(&*MIB).append((++II)->removeFromBundle()); Br->eraseFromParent(); } diff --git a/lib/Target/Mips/MipsMachineFunction.cpp b/lib/Target/Mips/MipsMachineFunction.cpp index f3f6f28..dedf802 100644 --- a/lib/Target/Mips/MipsMachineFunction.cpp +++ b/lib/Target/Mips/MipsMachineFunction.cpp @@ -121,24 +121,20 @@ bool MipsFunctionInfo::isEhDataRegFI(int FI) const { } MachinePointerInfo MipsFunctionInfo::callPtrInfo(const StringRef &Name) { - StringMap<const MipsCallEntry *>::const_iterator I; - I = ExternalCallEntries.find(Name); + const MipsCallEntry *&E = ExternalCallEntries[Name]; - if (I != ExternalCallEntries.end()) - return MachinePointerInfo(I->getValue()); + if (!E) + E = new MipsCallEntry(Name); - const MipsCallEntry *E = ExternalCallEntries[Name] = new MipsCallEntry(Name); return MachinePointerInfo(E); } MachinePointerInfo MipsFunctionInfo::callPtrInfo(const GlobalValue *Val) { - ValueMap<const GlobalValue *, const MipsCallEntry *>::const_iterator I; - I = GlobalCallEntries.find(Val); + const MipsCallEntry *&E = GlobalCallEntries[Val]; - if (I != GlobalCallEntries.end()) - return MachinePointerInfo(I->second); + if (!E) + E = new MipsCallEntry(Val); - const MipsCallEntry *E = GlobalCallEntries[Val] = new MipsCallEntry(Val); return MachinePointerInfo(E); } |