[PATCH] D21978: [analyzer] Add LocationContext to SymbolMetadata

Aleksei Sidorin via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 4 10:22:24 PDT 2016


a.sidorin created this revision.
a.sidorin added reviewers: zaks.anna, dcoughlin.
a.sidorin added a subscriber: cfe-commits.

Currently, SymbolMetadata are distinguished by statement and block count. However, in case of inlining, block counts may be the same every time function is called because the counter restarts from zero (it is related to StackFrameContext which is always different). This leads to unexpected resurrection of SymbolMetadata.

This patch solves this problem by adding a LocationContext to SymbolMetadata. A simple test is provided as well.

http://reviews.llvm.org/D21978

Files:
  include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h
  include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h
  lib/StaticAnalyzer/Checkers/CStringChecker.cpp
  lib/StaticAnalyzer/Core/SValBuilder.cpp
  lib/StaticAnalyzer/Core/SymbolManager.cpp
  test/Analysis/string.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21978.62696.patch
Type: text/x-patch
Size: 6923 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160704/9b343733/attachment-0001.bin>


More information about the cfe-commits mailing list