[llvm] r210990 - Add specialization of FoldingSetTrait for std::pair.
Manuel Klimek
klimek at google.com
Sun Jun 15 07:42:25 PDT 2014
Author: klimek
Date: Sun Jun 15 09:42:25 2014
New Revision: 210990
URL: http://llvm.org/viewvc/llvm-project?rev=210990&view=rev
Log:
Add specialization of FoldingSetTrait for std::pair.
Modified:
llvm/trunk/include/llvm/ADT/FoldingSet.h
Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/FoldingSet.h?rev=210990&r1=210989&r2=210990&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/FoldingSet.h (original)
+++ llvm/trunk/include/llvm/ADT/FoldingSet.h Sun Jun 15 09:42:25 2014
@@ -794,6 +794,14 @@ template<typename T> struct FoldingSetTr
ID.AddPointer(X);
}
};
+template <typename T1, typename T2>
+struct FoldingSetTrait<std::pair<T1, T2>> {
+ static inline void Profile(const std::pair<T1, T2> &P,
+ llvm::FoldingSetNodeID &ID) {
+ ID.Add(P.first);
+ ID.Add(P.second);
+ }
+};
} // End of namespace llvm.
#endif
More information about the llvm-commits
mailing list