================
@@ -103,23 +103,19 @@ AnalysisDriver::toposort(llvm::ArrayRef<AnalysisName> 
Roots) {
 llvm::Error AnalysisDriver::executeSummaryAnalysis(SummaryAnalysisBase 
&Summary,
                                                    WPASuite &Suite) const {
   SummaryName SN = Summary.getSummaryName();
-  auto DataIt = LU->Data.find(SN);
-  if (DataIt == LU->Data.end()) {
-    return ErrorBuilder::create(std::errc::invalid_argument,
-                                "no data for analysis '{0}' in LUSummary",
-                                Summary.getAnalysisName())
-        .build();
-  }
 
   if (auto Err = Summary.initialize()) {
     return Err;
   }
 
-  for (auto &[Id, EntitySummary] : DataIt->second) {
-    if (auto Err = Summary.add(Id, *EntitySummary)) {
-      return Err;
+  auto DataIt = LU->Data.find(SN);
+
+  if (DataIt != LU->Data.end())
+    for (auto &[Id, EntitySummary] : DataIt->second) {
+      if (auto Err = Summary.add(Id, *EntitySummary)) {
+        return Err;
+      }
     }
----------------
steakhal wrote:

This part looks unrelated to the goal of the PR title. Which suggests to me 
that this should be done part of a dedicated change.
This is my hunch, and also I'm not sure if this behavior was tested in a 
separated way - not depending on any particular concrete analysis. (This is 
again, circling back to decoupling this behavior from UnsafeBufferAnalysis). I 
wonder what you think about this. @ziqingluo-90 

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

Reply via email to