mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
Prefer SmallVector::append/insert over push_back loops.
Same functionality, but hoists the vector growth out of the loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229500 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -371,10 +371,8 @@ DataFlowSanitizer::DataFlowSanitizer(
|
||||
}
|
||||
|
||||
FunctionType *DataFlowSanitizer::getArgsFunctionType(FunctionType *T) {
|
||||
llvm::SmallVector<Type *, 4> ArgTypes;
|
||||
std::copy(T->param_begin(), T->param_end(), std::back_inserter(ArgTypes));
|
||||
for (unsigned i = 0, e = T->getNumParams(); i != e; ++i)
|
||||
ArgTypes.push_back(ShadowTy);
|
||||
llvm::SmallVector<Type *, 4> ArgTypes(T->param_begin(), T->param_end());
|
||||
ArgTypes.append(T->getNumParams(), ShadowTy);
|
||||
if (T->isVarArg())
|
||||
ArgTypes.push_back(ShadowPtrTy);
|
||||
Type *RetType = T->getReturnType();
|
||||
@@ -387,9 +385,8 @@ FunctionType *DataFlowSanitizer::getTrampolineFunctionType(FunctionType *T) {
|
||||
assert(!T->isVarArg());
|
||||
llvm::SmallVector<Type *, 4> ArgTypes;
|
||||
ArgTypes.push_back(T->getPointerTo());
|
||||
std::copy(T->param_begin(), T->param_end(), std::back_inserter(ArgTypes));
|
||||
for (unsigned i = 0, e = T->getNumParams(); i != e; ++i)
|
||||
ArgTypes.push_back(ShadowTy);
|
||||
ArgTypes.append(T->param_begin(), T->param_end());
|
||||
ArgTypes.append(T->getNumParams(), ShadowTy);
|
||||
Type *RetType = T->getReturnType();
|
||||
if (!RetType->isVoidTy())
|
||||
ArgTypes.push_back(ShadowPtrTy);
|
||||
|
||||
@@ -726,8 +726,7 @@ bool llvm::simplifyLoop(Loop *L, DominatorTree *DT, LoopInfo *LI, Pass *PP,
|
||||
// order. We can use this simple process because loops form a tree.
|
||||
for (unsigned Idx = 0; Idx != Worklist.size(); ++Idx) {
|
||||
Loop *L2 = Worklist[Idx];
|
||||
for (Loop::iterator I = L2->begin(), E = L2->end(); I != E; ++I)
|
||||
Worklist.push_back(*I);
|
||||
Worklist.append(L2->begin(), L2->end());
|
||||
}
|
||||
|
||||
while (!Worklist.empty())
|
||||
|
||||
Reference in New Issue
Block a user