This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by NoQ on May 23 2018, 6:07 PM.

Details

Summary

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.

Diff Detail

Repository
rC Clang