PR50294: Fix a performance regression from 2c9dbcd.
authorRichard Smith <richard@metafoo.co.uk>
Thu, 2 Sep 2021 00:57:48 +0000 (17:57 -0700)
committerRichard Smith <richard@metafoo.co.uk>
Thu, 2 Sep 2021 01:00:07 +0000 (18:00 -0700)
Per the contract of ReadLateParsedTemplates, we should not be returning
the same results multiple times. No functionality change intended, other
than to runtime.

Thanks to Luboš Luňák for identifying the cause of the regression!

clang/lib/Serialization/ASTReader.cpp

index 128350c..dfa7d55 100644 (file)
@@ -8412,6 +8412,8 @@ void ASTReader::ReadLateParsedTemplates(
       LPTMap.insert(std::make_pair(FD, std::move(LT)));
     }
   }
+
+  LateParsedTemplates.clear();
 }
 
 void ASTReader::LoadSelector(Selector Sel) {