[PATCH] D47304: [analyzer] NFC: Merge the functions for obtaining constructed object location and storing this location for later use.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 23 18:07:03 PDT 2018


NoQ created this revision.
NoQ added reviewers: dcoughlin, xazax.hun, a.sidorin, george.karpenkov, szepet, rnkovacs.
Herald added subscribers: cfe-commits, baloghadamsoftware.

`getLocationForConstructedObject()` looks at the construction context and figures out what region should represent the object.

`markStatementsCorrespondingToConstructedObject()` looks at the construction context and figures out what statements will need to retrieve that region directly later.

These functions are coupled and code is duplicated between them. They should be merged. The resulting function is large, so it'd probably later need to be split in a different manner (i.e. by construction context kinds). It'll also soon become recursive as we add better support for copy elision at return sites. I really hope we don't end up coding any sort of ConstructionContextVisitor.

No functional change intended here; this is a refactoring pass.


Repository:
  rC Clang

https://reviews.llvm.org/D47304

Files:
  include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
  lib/StaticAnalyzer/Core/ExprEngine.cpp
  lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
  lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47304.148325.patch
Type: text/x-patch
Size: 17587 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180524/f0094a2c/attachment-0001.bin>


More information about the cfe-commits mailing list