[PATCH] D48027: [analyzer] Improve `CallDescription` to handle c++ method.

Henry Wong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 25 08:59:02 PDT 2018


MTC updated this revision to Diff 152702.
MTC added a comment.

Sorry for the long long delay, I was on the Dragon Boat Festival a few days ago.

This update has two parts:

- Use the `matchesName` to match the AST node with the specified name, `matchesName` use regex to match the specified name.
- Use `std::vector` to record the list of qualified name, user can provide information as much as possible to improve matching accuracy. But can also provide only the function name.

There are two remain issues:

- There is possible match the wrong AST node, e.g. for the NamedDecl `foo()`, if the function body has the `a::b::x`, when we match `a::b::X()`, we will match `foo()` . Because I'm not familiar with ASTMatcher, my bad, I can't think of a perfect way to match only the specified nodes.
- The `std::vector` to record the information provide by the users may be not the best data structure.
- I'm not the regex expert,  the regex used in this patch definitely has the chance to improve.

  And I am not good at English writing, if any comments are not very clear, please correct me. Thanks for the help!




Repository:
  rC Clang

https://reviews.llvm.org/D48027

Files:
  include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
  lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp
  lib/StaticAnalyzer/Checkers/DanglingInternalBufferChecker.cpp
  lib/StaticAnalyzer/Checkers/MmapWriteExecChecker.cpp
  lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp
  lib/StaticAnalyzer/Checkers/ValistChecker.cpp
  lib/StaticAnalyzer/Core/CallEvent.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48027.152702.patch
Type: text/x-patch
Size: 8664 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180625/7d437956/attachment.bin>


More information about the cfe-commits mailing list