summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/ParameterAttributes.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-02-16 20:53:06 +0000
committerDuncan Sands <baldrick@free.fr>2008-02-16 20:53:06 +0000
commit2efbc7f9e8ddd26bae29ff23fa14053c00e3fdfe (patch)
treef9d1b4d3a5f58b66f3bcdb483abbe694f51fe302 /llvm/lib/VMCore/ParameterAttributes.cpp
parentf13b1efa75729531277cb995883e88bcdea2899a (diff)
downloadbcm5719-llvm-2efbc7f9e8ddd26bae29ff23fa14053c00e3fdfe.tar.gz
bcm5719-llvm-2efbc7f9e8ddd26bae29ff23fa14053c00e3fdfe.zip
Some micro-optimizations.
llvm-svn: 47219
Diffstat (limited to 'llvm/lib/VMCore/ParameterAttributes.cpp')
-rw-r--r--llvm/lib/VMCore/ParameterAttributes.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/VMCore/ParameterAttributes.cpp b/llvm/lib/VMCore/ParameterAttributes.cpp
index b099c8fed86..344e52c59a4 100644
--- a/llvm/lib/VMCore/ParameterAttributes.cpp
+++ b/llvm/lib/VMCore/ParameterAttributes.cpp
@@ -124,6 +124,7 @@ ParamAttrsList::getModified(const ParamAttrsList *PAL,
if (!PAL) {
// Strip any instances of ParamAttr::None from modVec before calling 'get'.
ParamAttrsVector newVec;
+ newVec.reserve(modVec.size());
for (unsigned i = 0, e = modVec.size(); i < e; ++i)
if (modVec[i].attrs != ParamAttr::None)
newVec.push_back(modVec[i]);
@@ -175,8 +176,8 @@ ParamAttrsList::includeAttrs(const ParamAttrsList *PAL,
if (NewAttrs == OldAttrs)
return PAL;
- ParamAttrsVector modVec;
- modVec.push_back(ParamAttrsWithIndex::get(idx, NewAttrs));
+ ParamAttrsVector modVec(1);
+ modVec[0] = ParamAttrsWithIndex::get(idx, NewAttrs);
return getModified(PAL, modVec);
}
@@ -188,8 +189,8 @@ ParamAttrsList::excludeAttrs(const ParamAttrsList *PAL,
if (NewAttrs == OldAttrs)
return PAL;
- ParamAttrsVector modVec;
- modVec.push_back(ParamAttrsWithIndex::get(idx, NewAttrs));
+ ParamAttrsVector modVec(1);
+ modVec[0] = ParamAttrsWithIndex::get(idx, NewAttrs);
return getModified(PAL, modVec);
}
OpenPOWER on IntegriCloud