================
@@ -8745,9 +8732,13 @@ bool ASTReader::LoadExternalSpecializationsImpl(
   Deserializing LookupResults(this);
   auto HashValue = StableHashForTemplateArguments(TemplateArgs);
 
-  // Get Decl may violate the iterator from SpecLookups
+  auto It = SpecLookups.find(D);
----------------
mzukovec wrote:

Updating the expected trace by listing every new Load External Specializations 
for event makes these tests much noisier:

```diff
@@ TimeProfilerTest.ClassTemplateInstantiations
 ExecuteCompiler
 | Frontend (test.cc)
 | | ParseClass (S)
 | | CheckConstraintSatisfaction (<test.cc:9:21, col:29>)
+| | Load External Specializations for  (S)
+| | Load External Specializations for  (S)
+| | Load External Specializations for  (S)
+| | Load External Specializations for  (S)
+| | Load External Specializations for  (S)
+| | Load External Specializations for  (S)
 | | InstantiateClass (S<double>, test.cc:9)
 | | InstantiateFunction (S<double>::foo, test.cc:5)
 | | ParseDeclarationOrFunctionDefinition (test.cc:11:5)
 | | | ParseFunctionDefinition (user)
 | | | | CheckConstraintSatisfaction (<test.cc:12:7, col:12>)
+| | | | Load External Specializations for  (S)
+| | | | Load External Specializations for  (S)
+| | | | Load External Specializations for  (S)
+| | | | Load External Specializations for  (S)
+| | | | Load External Specializations for  (S)
+| | | | Load External Specializations for  (S)
 | | | | InstantiateClass (S<int>, test.cc:3)
 | | | | CheckConstraintSatisfaction (<test.cc:13:7, col:14>)
+| | | | Load External Specializations for  (S)
+| | | | Load External Specializations for  (S)
+| | | | Load External Specializations for  (S)
+| | | | Load External Specializations for  (S)
+| | | | Load External Specializations for  (S)
+| | | | | Load External Specializations for  (S)
 | | | | InstantiateClass (S<float>, test.cc:3)
 | | | | DeferInstantiation (S<float>::foo)

@@ TimeProfilerTest.TemplateInstantiations
 | | ParseFunctionDefinition (fooA)
 | | ParseDeclarationOrFunctionDefinition (test.cc:3:5)
 | | | ParseFunctionDefinition (user)
+| | | | Load External Specializations for  (fooA)
+| | | | Load External Specializations for  (fooA)
 | | | | DeferInstantiation (fooA<int>)
 | PerformPendingInstantiations
 | | InstantiateFunction (fooA<int>, a.h:7)
+| | | Load External Specializations for  (fooB)
+| | | Load External Specializations for  (fooB)
 | | | InstantiateFunction (fooB<int>, b.h:8)
+| | | | Load External Specializations for  (fooC)
+| | | | Load External Specializations for  (fooC)
 | | | | DeferInstantiation (fooC<int>)
 | | | | BuildCFG
+| | | Load External Specializations for  (fooMTA)
+| | | Load External Specializations for  (fooMTA)
 | | | DeferInstantiation (fooMTA<int>)

```

I see the following two approaches as viable:

1) Filter that event out in these two tests, ideally with a small helper 
option, e.g. buildTraceGraph(Json, /*IgnoreNames=*/{"Load External 
Specializations for "}).
2) If we do not want test-specific filtering, reconsider the implementation 
shape that avoids emitting these scopes for failed lookups.

https://github.com/llvm/llvm-project/pull/196533
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to