================
@@ -44,14 +45,25 @@ void 
ClangTidyProfiling::printUserFriendlyTable(llvm::raw_ostream &OS,
 
 void ClangTidyProfiling::printAsJSON(llvm::raw_ostream &OS,
                                      llvm::TimerGroup &TG) {
-  assert(Storage && "We should have a filename.");
-  OS << "{\n";
-  OS << R"("file": ")" << Storage->SourceFilename << "\",\n";
-  OS << R"("timestamp": ")" << Storage->Timestamp << "\",\n";
-  OS << "\"profile\": {\n";
-  TG.printJSONValues(OS, "");
-  OS << "\n}\n";
-  OS << "}\n";
+  if (!Storage)
+    return;
----------------
vbvictor wrote:

IRRC this only happens in release mode, does we get this warning in CI?
I think there are many places which use assert() instead if() and work fine

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

Reply via email to