[PATCH] D78118: [analyzer] StdLibraryFunctionsChecker: Add option to display loaded summaries
Gabor Marton via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 29 09:06:12 PDT 2020
martong marked 4 inline comments as done.
martong 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();
----------------
balazske wrote:
> 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.
Yeah, thanks! I switched to use that!
================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:681
+ if (DisplayLoadedSummaries)
+ llvm::errs() << "Loaded summary for " << ToString(FD) << "\n";
return;
----------------
balazske wrote:
> 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.
Ok I use the `Loaded summary for: ` form from now on.
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