@@ -245,15 +245,6 @@ static Symbol parseExtendedSymbol(Parser &p, AsmParserState *asmState,
245245 return nullptr ;
246246 }
247247
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- }
257248 return createSymbol (dialectName, symbolData, loc);
258249}
259250
@@ -346,7 +337,6 @@ Type Parser::parseExtendedType() {
346337template <typename T, typename ParserFn>
347338static T parseSymbol (StringRef inputStr, MLIRContext *context,
348339 size_t *numReadOut, bool isKnownNullTerminated,
349- llvm::StringMap<Attribute> *attributesCache,
350340 ParserFn &&parserFn) {
351341 // Set the buffer name to the string being parsed, so that it appears in error
352342 // diagnostics.
@@ -358,9 +348,6 @@ static T parseSymbol(StringRef inputStr, MLIRContext *context,
358348 SourceMgr sourceMgr;
359349 sourceMgr.AddNewSourceBuffer (std::move (memBuffer), SMLoc ());
360350 SymbolState aliasState;
361- if (attributesCache)
362- aliasState.attributesCache = *attributesCache;
363-
364351 ParserConfig config (context);
365352 ParserState state (sourceMgr, config, aliasState, /* asmState=*/ nullptr ,
366353 /* codeCompleteContext=*/ nullptr );
@@ -371,11 +358,6 @@ static T parseSymbol(StringRef inputStr, MLIRContext *context,
371358 if (!symbol)
372359 return T ();
373360
374- if constexpr (std::is_same_v<T, Attribute>) {
375- if (attributesCache)
376- *attributesCache = state.symbols .attributesCache ;
377- }
378-
379361 // Provide the number of bytes that were read.
380362 Token endTok = parser.getToken ();
381363 size_t numRead =
@@ -392,15 +374,13 @@ static T parseSymbol(StringRef inputStr, MLIRContext *context,
392374
393375Attribute mlir::parseAttribute (StringRef attrStr, MLIRContext *context,
394376 Type type, size_t *numRead,
395- bool isKnownNullTerminated,
396- llvm::StringMap<Attribute> *attributesCache) {
377+ bool isKnownNullTerminated) {
397378 return parseSymbol<Attribute>(
398- attrStr, context, numRead, isKnownNullTerminated, attributesCache,
379+ attrStr, context, numRead, isKnownNullTerminated,
399380 [type](Parser &parser) { return parser.parseAttribute (type); });
400381}
401382Type mlir::parseType (StringRef typeStr, MLIRContext *context, size_t *numRead,
402383 bool isKnownNullTerminated) {
403384 return parseSymbol<Type>(typeStr, context, numRead, isKnownNullTerminated,
404- /* attributesCache=*/ nullptr ,
405385 [](Parser &parser) { return parser.parseType (); });
406386}
0 commit comments