summaryrefslogtreecommitdiffstats
path: root/lib/VMCore/ParameterAttributes.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-01-03 00:29:27 +0000
committerChris Lattner <sabre@nondot.org>2008-01-03 00:29:27 +0000
commit89e94bd00c1a7e24b42e653fc5c0f4b00a3dee61 (patch)
treed09309dd1c4547c4c91998181fc911b3cee8c2cc /lib/VMCore/ParameterAttributes.cpp
parent227ff79ceb2b0b0d1c9705fa6786067f401ae003 (diff)
downloadexternal_llvm-89e94bd00c1a7e24b42e653fc5c0f4b00a3dee61.zip
external_llvm-89e94bd00c1a7e24b42e653fc5c0f4b00a3dee61.tar.gz
external_llvm-89e94bd00c1a7e24b42e653fc5c0f4b00a3dee61.tar.bz2
Don't create a new ParamAttrsList (which copies the vector) just to
get a profile. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45524 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ParameterAttributes.cpp')
-rw-r--r--lib/VMCore/ParameterAttributes.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/VMCore/ParameterAttributes.cpp b/lib/VMCore/ParameterAttributes.cpp
index aaf80cd..b6c2992 100644
--- a/lib/VMCore/ParameterAttributes.cpp
+++ b/lib/VMCore/ParameterAttributes.cpp
@@ -106,9 +106,10 @@ ParamAttrsList::areCompatible(const ParamAttrsList *A, const ParamAttrsList *B){
return true;
}
-void ParamAttrsList::Profile(FoldingSetNodeID &ID) const {
- for (unsigned i = 0; i < attrs.size(); ++i)
- ID.AddInteger(unsigned(attrs[i].attrs) << 16 | unsigned(attrs[i].index));
+void ParamAttrsList::Profile(FoldingSetNodeID &ID,
+ const ParamAttrsVector &Attrs) {
+ for (unsigned i = 0; i < Attrs.size(); ++i)
+ ID.AddInteger(unsigned(Attrs[i].attrs) << 16 | unsigned(Attrs[i].index));
}
const ParamAttrsList *
@@ -127,11 +128,10 @@ ParamAttrsList::get(const ParamAttrsVector &attrVec) {
#endif
// Otherwise, build a key to look up the existing attributes.
- ParamAttrsList key(attrVec);
FoldingSetNodeID ID;
- key.Profile(ID);
+ ParamAttrsList::Profile(ID, attrVec);
void *InsertPos;
- ParamAttrsList* PAL = ParamAttrsLists->FindNodeOrInsertPos(ID, InsertPos);
+ ParamAttrsList *PAL = ParamAttrsLists->FindNodeOrInsertPos(ID, InsertPos);
// If we didn't find any existing attributes of the same shape then
// create a new one and insert it.