Skip to content

Commit 9a1386e

Browse files
authored
[NFC] Remove method from FoldingSet that already existed in APInt. (#90486)
Noticed that there already was a function in APInt that updated a FoldingSet so there was no need for me to add it in #84617.
1 parent ce3485a commit 9a1386e

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

llvm/include/llvm/ADT/FoldingSet.h

-8
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#ifndef LLVM_ADT_FOLDINGSET_H
1717
#define LLVM_ADT_FOLDINGSET_H
1818

19-
#include "llvm/ADT/APInt.h"
2019
#include "llvm/ADT/Hashing.h"
2120
#include "llvm/ADT/STLForwardCompat.h"
2221
#include "llvm/ADT/SmallVector.h"
@@ -355,13 +354,6 @@ class FoldingSetNodeID {
355354
AddInteger(unsigned(I));
356355
AddInteger(unsigned(I >> 32));
357356
}
358-
void AddInteger(const APInt &Int) {
359-
AddInteger(Int.getBitWidth());
360-
const auto *Parts = Int.getRawData();
361-
for (int i = 0, N = Int.getNumWords(); i < N; ++i) {
362-
AddInteger(Parts[i]);
363-
}
364-
}
365357

366358
void AddBoolean(bool B) { AddInteger(B ? 1U : 0U); }
367359
void AddString(StringRef String);

llvm/lib/IR/AttributeImpl.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ class AttributeImpl : public FoldingSetNode {
121121
static void Profile(FoldingSetNodeID &ID, Attribute::AttrKind Kind,
122122
const ConstantRange &CR) {
123123
ID.AddInteger(Kind);
124-
ID.AddInteger(CR.getLower());
125-
ID.AddInteger(CR.getUpper());
124+
CR.getLower().Profile(ID);
125+
CR.getUpper().Profile(ID);
126126
}
127127
};
128128

llvm/lib/IR/Attributes.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ Attribute Attribute::get(LLVMContext &Context, Attribute::AttrKind Kind,
173173
LLVMContextImpl *pImpl = Context.pImpl;
174174
FoldingSetNodeID ID;
175175
ID.AddInteger(Kind);
176-
ID.AddInteger(CR.getLower());
177-
ID.AddInteger(CR.getUpper());
176+
CR.getLower().Profile(ID);
177+
CR.getUpper().Profile(ID);
178178

179179
void *InsertPoint;
180180
AttributeImpl *PA = pImpl->AttrsSet.FindNodeOrInsertPos(ID, InsertPoint);

0 commit comments

Comments
 (0)