mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Add support to FoldingSet for hashing APInt objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46833 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
#include "llvm/ADT/FoldingSet.h"
|
||||
#include "llvm/ADT/APFloat.h"
|
||||
#include "llvm/ADT/APInt.h"
|
||||
#include "llvm/Support/MathExtras.h"
|
||||
#include <cassert>
|
||||
using namespace llvm;
|
||||
@@ -59,6 +60,9 @@ void FoldingSetNodeID::AddDouble(double D) {
|
||||
}
|
||||
void FoldingSetNodeID::AddAPFloat(const APFloat& apf) {
|
||||
APInt api = apf.convertToAPInt();
|
||||
AddAPInt(api);
|
||||
}
|
||||
void FoldingSetNodeID::AddAPInt(const APInt& api) {
|
||||
const uint64_t *p = api.getRawData();
|
||||
for (unsigned i=0; i<api.getNumWords(); i++)
|
||||
AddInteger(*p++);
|
||||
|
||||
Reference in New Issue
Block a user