Added "Profile" method to APFloat for use with FoldingSet.
[oota-llvm.git] / lib / Support / APFloat.cpp
index 3de709c86ed86ada2a072ff117c92315cfe6f09c..cc86e795e7927e6616b05b0441bd3a66f062a099 100644 (file)
@@ -13,6 +13,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/ADT/APFloat.h"
+#include "llvm/ADT/FoldingSet.h"
 #include <cassert>
 #include <cstring>
 #include "llvm/Support/MathExtras.h"
@@ -691,6 +692,11 @@ APFloat::~APFloat()
   freeSignificand();
 }
 
+// Profile - This method 'profiles' an APFloat for use with FoldingSet.
+void APFloat::Profile(FoldingSetNodeID& ID) const {
+  ID.Add(convertToAPInt());
+}
+
 unsigned int
 APFloat::partCount() const
 {