aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/APFloat.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-02-11 17:24:50 +0000
committerTed Kremenek <kremenek@apple.com>2008-02-11 17:24:50 +0000
commit1f801fa5ada9cb40fb97ae755c282e91af54a1bc (patch)
tree892502fb68fc883c8ed89d9185f8cd586e8ef8a9 /lib/Support/APFloat.cpp
parent04feb51886805046e8b1af10b7d21bc1ef85f457 (diff)
Added "Profile" method to APFloat for use with FoldingSet.
Added member template "Add" to FoldingSetNodeID that allows "adding" arbitrary objects to a profile via dispatch to FoldingSetTrait<T>::Profile(). Removed FoldingSetNodeID::AddAPFloat and FoldingSetNodeID::APInt, as their functionality is now replaced using the above mentioned member template. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46957 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/APFloat.cpp')
-rw-r--r--lib/Support/APFloat.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp
index 3de709c86e..cc86e795e7 100644
--- a/lib/Support/APFloat.cpp
+++ b/lib/Support/APFloat.cpp
@@ -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
{