Skip to content

Commit 17c9aa7

Browse files
committed
Do not duplicate the names of types and attributes
1 parent d0fb4de commit 17c9aa7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mlir/lib/IR/MLIRContext.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ class MLIRContextImpl {
215215
/// This is a mapping from type name to the abstract type describing it.
216216
/// It is used by `AbstractType::lookup` to get an `AbstractType` from a name.
217217
/// As this map needs to be populated before `StringAttr` is loaded, we
218-
/// cannot use `StringAttr` as the key, which would avoid string duplication.
219-
llvm::StringMap<AbstractType *> nameToType;
218+
/// cannot use `StringAttr` as the key.
219+
llvm::DenseMap<StringRef, AbstractType *> nameToType;
220220

221221
/// Cached Type Instances.
222222
Float8E5M2Type f8E5M2Ty;
@@ -246,8 +246,8 @@ class MLIRContextImpl {
246246
/// it. It is used by `AbstractType::lookup` to get an `AbstractType` from a
247247
/// name.
248248
/// As this map needs to be populated before `StringAttr` is loaded, we
249-
/// cannot use `StringAttr` as the key, which would avoid string duplication.
250-
llvm::StringMap<AbstractAttribute *> nameToAttribute;
249+
/// cannot use `StringAttr` as the key.
250+
llvm::DenseMap<StringRef, AbstractAttribute *> nameToAttribute;
251251

252252
/// Cached Attribute Instances.
253253
BoolAttr falseAttr, trueAttr;

0 commit comments

Comments
 (0)