mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 06:16:07 +00:00
[NFC][LLVMContext] Clean up DenseMapInfo classes used for APInt & APFloat.
DenseMapAPIntKeyInfo looks like a redundant definition because it mirrors the default used by DenseMap when not specified. Replacing DenseMapAPFloatKeyInfo with a specialisation of DenseMapInfo allows DenseMap<T> to be more easily used when T is an aggregate type containing an APFloat.
This commit is contained in:
parent
8727982bdf
commit
a2e8207178
@ -73,9 +73,7 @@ class StringRef;
|
||||
class TypedPointerType;
|
||||
class ValueHandleBase;
|
||||
|
||||
using DenseMapAPIntKeyInfo = DenseMapInfo<APInt>;
|
||||
|
||||
struct DenseMapAPFloatKeyInfo {
|
||||
template <> struct DenseMapInfo<APFloat> {
|
||||
static inline APFloat getEmptyKey() { return APFloat(APFloat::Bogus(), 1); }
|
||||
static inline APFloat getTombstoneKey() {
|
||||
return APFloat(APFloat::Bogus(), 2);
|
||||
@ -1489,11 +1487,9 @@ public:
|
||||
|
||||
DenseMap<unsigned, std::unique_ptr<ConstantInt>> IntZeroConstants;
|
||||
DenseMap<unsigned, std::unique_ptr<ConstantInt>> IntOneConstants;
|
||||
DenseMap<APInt, std::unique_ptr<ConstantInt>, DenseMapAPIntKeyInfo>
|
||||
IntConstants;
|
||||
DenseMap<APInt, std::unique_ptr<ConstantInt>> IntConstants;
|
||||
|
||||
DenseMap<APFloat, std::unique_ptr<ConstantFP>, DenseMapAPFloatKeyInfo>
|
||||
FPConstants;
|
||||
DenseMap<APFloat, std::unique_ptr<ConstantFP>> FPConstants;
|
||||
|
||||
FoldingSet<AttributeImpl> AttrsSet;
|
||||
FoldingSet<AttributeListImpl> AttrsLists;
|
||||
|
Loading…
x
Reference in New Issue
Block a user