Added "clear" method to FoldingSetNodeID to allow a FoldingSetNodeID object
authorTed Kremenek <kremenek@apple.com>
Mon, 21 Jan 2008 22:49:22 +0000 (22:49 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 21 Jan 2008 22:49:22 +0000 (22:49 +0000)
to be reused to compute multiple object profiles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46226 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/FoldingSet.h

index e626b6e62eedeaf4f947393a6a4b271274b88018..112d86c5f647ce3335eaad2d6f0a7e8844828818 100644 (file)
@@ -208,6 +208,10 @@ public:
   void AddAPFloat(const APFloat& apf);
   void AddString(const std::string &String);
   
+  /// clear - Clear the accumulated profile, allowing this FoldingSetNodeID
+  ///  object to be used to compute a new profile.
+  inline void clear() { Bits.clear(); }
+  
   /// ComputeHash - Compute a strong hash value for this FoldingSetNodeID, used
   ///  to lookup the node in the FoldingSetImpl.
   unsigned ComputeHash() const;