[ObjCARC] Take BlockColors by const reference. NFC

llvm-svn: 330489
This commit is contained in:
Shoaib Meenai 2018-04-20 22:14:45 +00:00
parent c8f5c05d41
commit 106df7dd20
2 changed files with 8 additions and 9 deletions

View File

@ -75,13 +75,12 @@ namespace {
SmallPtrSet<CallInst *, 8> StoreStrongCalls; SmallPtrSet<CallInst *, 8> StoreStrongCalls;
/// Returns true if we eliminated Inst. /// Returns true if we eliminated Inst.
bool bool tryToPeepholeInstruction(
tryToPeepholeInstruction(Function &F, Instruction *Inst, Function &F, Instruction *Inst, inst_iterator &Iter,
inst_iterator &Iter,
SmallPtrSetImpl<Instruction *> &DepInsts, SmallPtrSetImpl<Instruction *> &DepInsts,
SmallPtrSetImpl<const BasicBlock *> &Visited, SmallPtrSetImpl<const BasicBlock *> &Visited,
bool &TailOkForStoreStrong, bool &TailOkForStoreStrong,
DenseMap<BasicBlock *, ColorVector> &BlockColors); const DenseMap<BasicBlock *, ColorVector> &BlockColors);
bool optimizeRetainCall(Function &F, Instruction *Retain); bool optimizeRetainCall(Function &F, Instruction *Retain);
@ -431,7 +430,7 @@ bool ObjCARCContract::tryToPeepholeInstruction(
SmallPtrSetImpl<Instruction *> &DependingInsts, SmallPtrSetImpl<Instruction *> &DependingInsts,
SmallPtrSetImpl<const BasicBlock *> &Visited, SmallPtrSetImpl<const BasicBlock *> &Visited,
bool &TailOkForStoreStrongs, bool &TailOkForStoreStrongs,
DenseMap<BasicBlock *, ColorVector> &BlockColors) { const DenseMap<BasicBlock *, ColorVector> &BlockColors) {
// Only these library routines return their argument. In particular, // Only these library routines return their argument. In particular,
// objc_retainBlock does not necessarily return its argument. // objc_retainBlock does not necessarily return its argument.
ARCInstKind Class = GetBasicARCInstKind(Inst); ARCInstKind Class = GetBasicARCInstKind(Inst);

View File

@ -688,7 +688,7 @@ void ObjCARCOpt::OptimizeAutoreleaseRVCall(Function &F,
namespace { namespace {
Instruction * Instruction *
CloneCallInstForBB(CallInst &CI, BasicBlock &BB, CloneCallInstForBB(CallInst &CI, BasicBlock &BB,
DenseMap<BasicBlock *, ColorVector> &BlockColors) { const DenseMap<BasicBlock *, ColorVector> &BlockColors) {
SmallVector<OperandBundleDef, 1> OpBundles; SmallVector<OperandBundleDef, 1> OpBundles;
for (unsigned I = 0, E = CI.getNumOperandBundles(); I != E; ++I) { for (unsigned I = 0, E = CI.getNumOperandBundles(); I != E; ++I) {
auto Bundle = CI.getOperandBundleAt(I); auto Bundle = CI.getOperandBundleAt(I);