aboutsummaryrefslogtreecommitdiff
path: root/lib/Support
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/APInt.cpp2
-rw-r--r--lib/Support/FoldingSet.cpp6
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp
index 277a0b0c11..15de08ed05 100644
--- a/lib/Support/APInt.cpp
+++ b/lib/Support/APInt.cpp
@@ -2009,7 +2009,7 @@ void APInt::dump() const
cerr << pVal[i-1] << " ";
}
cerr << " U(" << this->toStringUnsigned(10) << ") S("
- << this->toStringSigned(10) << ")\n" << std::setbase(10);
+ << this->toStringSigned(10) << ")" << std::setbase(10);
}
#endif
diff --git a/lib/Support/FoldingSet.cpp b/lib/Support/FoldingSet.cpp
index 0ccb3a6cc3..70daad9a61 100644
--- a/lib/Support/FoldingSet.cpp
+++ b/lib/Support/FoldingSet.cpp
@@ -56,6 +56,12 @@ void FoldingSetImpl::NodeID::AddFloat(float F) {
void FoldingSetImpl::NodeID::AddDouble(double D) {
AddInteger(DoubleToBits(D));
}
+void FoldingSetImpl::NodeID::AddAPFloat(const APFloat& apf) {
+ APInt api = apf.convertToAPInt();
+ const uint64_t *p = api.getRawData();
+ for (int i=0; i<api.getNumWords(); i++)
+ AddInteger(*p++);
+}
void FoldingSetImpl::NodeID::AddString(const std::string &String) {
unsigned Size = String.size();
Bits.push_back(Size);