[llvm] [clang] [clang-tools-extra] [Clang] Fix : More Detailed "No expected directives found" (PR #78338)

Shourya Goel via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 23 00:48:34 PST 2024


================
@@ -1098,7 +1098,16 @@ void VerifyDiagnosticConsumer::CheckDiagnostics() {
     // Produce an error if no expected-* directives could be found in the
     // source file(s) processed.
     if (Status == HasNoDirectives) {
-      Diags.Report(diag::err_verify_no_directives).setForceEmit();
+      std::string directives;
+      for (auto &Prefix : Diags.getDiagnosticOptions().VerifyPrefixes) {
+        directives = directives + Prefix + ",";
+      }
----------------
Sh0g0-1758 wrote:

Yes, I see your point. In that case I will change the code to now emit multiple errors and not batch them into one. so if you pass ```-verify=foo,bar``` and there are no such directives in the code then two errors with ```foo-no-diagnostics``` and ```bar-no-diagnostics``` will be generated. Please give me a confirmation to do so. 

https://github.com/llvm/llvm-project/pull/78338


More information about the cfe-commits mailing list