@@ -245,15 +245,6 @@ static Symbol parseExtendedSymbol(Parser &p, AsmParserState *asmState,
245
245
return nullptr ;
246
246
}
247
247
248
- if constexpr (std::is_same_v<Symbol, Attribute>) {
249
- auto &cache = p.getState ().symbols .attributesCache ;
250
- auto cacheIt = cache.find (symbolData);
251
- // Skip cached attribute if it has type.
252
- if (cacheIt != cache.end () && !p.getToken ().is (Token::colon))
253
- return cacheIt->second ;
254
-
255
- return cache[symbolData] = createSymbol (dialectName, symbolData, loc);
256
- }
257
248
return createSymbol (dialectName, symbolData, loc);
258
249
}
259
250
@@ -346,7 +337,6 @@ Type Parser::parseExtendedType() {
346
337
template <typename T, typename ParserFn>
347
338
static T parseSymbol (StringRef inputStr, MLIRContext *context,
348
339
size_t *numReadOut, bool isKnownNullTerminated,
349
- llvm::StringMap<Attribute> *attributesCache,
350
340
ParserFn &&parserFn) {
351
341
// Set the buffer name to the string being parsed, so that it appears in error
352
342
// diagnostics.
@@ -358,9 +348,6 @@ static T parseSymbol(StringRef inputStr, MLIRContext *context,
358
348
SourceMgr sourceMgr;
359
349
sourceMgr.AddNewSourceBuffer (std::move (memBuffer), SMLoc ());
360
350
SymbolState aliasState;
361
- if (attributesCache)
362
- aliasState.attributesCache = *attributesCache;
363
-
364
351
ParserConfig config (context);
365
352
ParserState state (sourceMgr, config, aliasState, /* asmState=*/ nullptr ,
366
353
/* codeCompleteContext=*/ nullptr );
@@ -371,11 +358,6 @@ static T parseSymbol(StringRef inputStr, MLIRContext *context,
371
358
if (!symbol)
372
359
return T ();
373
360
374
- if constexpr (std::is_same_v<T, Attribute>) {
375
- if (attributesCache)
376
- *attributesCache = state.symbols .attributesCache ;
377
- }
378
-
379
361
// Provide the number of bytes that were read.
380
362
Token endTok = parser.getToken ();
381
363
size_t numRead =
@@ -392,15 +374,13 @@ static T parseSymbol(StringRef inputStr, MLIRContext *context,
392
374
393
375
Attribute mlir::parseAttribute (StringRef attrStr, MLIRContext *context,
394
376
Type type, size_t *numRead,
395
- bool isKnownNullTerminated,
396
- llvm::StringMap<Attribute> *attributesCache) {
377
+ bool isKnownNullTerminated) {
397
378
return parseSymbol<Attribute>(
398
- attrStr, context, numRead, isKnownNullTerminated, attributesCache,
379
+ attrStr, context, numRead, isKnownNullTerminated,
399
380
[type](Parser &parser) { return parser.parseAttribute (type); });
400
381
}
401
382
Type mlir::parseType (StringRef typeStr, MLIRContext *context, size_t *numRead,
402
383
bool isKnownNullTerminated) {
403
384
return parseSymbol<Type>(typeStr, context, numRead, isKnownNullTerminated,
404
- /* attributesCache=*/ nullptr ,
405
385
[](Parser &parser) { return parser.parseType (); });
406
386
}
0 commit comments