[PATCH] D78118: [analyzer] StdLibraryFunctionsChecker: Add option to display loaded summaries

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 29 03:43:04 PDT 2020


balazske added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:651
+    // Get the declaration of a function proto as written in the source file.
+    StringRef ToString(const FunctionDecl *FD) {
+      const auto &SM = ACtx.getSourceManager();
----------------
Maybe the `Decl::print` method can be used? I pretty-prints the declaration (hopefully there is an option to print only the prototype), otherwise we can get the code as written in the source-file(?) that makes comparing the output more difficult. 


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:681
+            if (DisplayLoadedSummaries)
+              llvm::errs() << "Loaded summary for " << ToString(FD) << "\n";
             return;
----------------
I would prefer to display the function prototype in a separate line (if not only the name is included in the string). Or at least enclose the prototype with `'` characters. Or the `Loaded summary for: ` form.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78118/new/

https://reviews.llvm.org/D78118





More information about the cfe-commits mailing list