[PATCH] D49715: [analyzer] CallEvent: Add partially working methods for obtaining the callee stack frame.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 23 19:27:37 PDT 2018


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

These methods allow reasoning about the stack frame that will be (or was) used when the function will be (or was) inlined, even if it will not be (or was not) inlined.

They are implemented in a fairly ugly manner, and while i plan to address some of the issues in follow-up patches (at least, do something about virtual calls), i don't think it'll work perfectly soon. A proper implementation would require a large amount of refactoring for `Call::getDecl()` and `Call::getRuntimeDefinition()` and the logic in `ExprEngine`'s call modeling and i didn't accomplish much in a couple days of working on it, so i'm putting a proper implementation on hold for now, safely returning `nullptr` when the proper `Decl` cannot be reliably obtained.

This was ultimately necessary to obtain the parameter regions on the future stack frame for the purposes of https://reviews.llvm.org/D49443. We don't need this function to be perfect because a lot of other things are imperfect and we're fine with falling back to a conservative behavior.


Repository:
  rC Clang

https://reviews.llvm.org/D49715

Files:
  include/clang/Analysis/ConstructionContext.h
  include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
  include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
  lib/StaticAnalyzer/Core/CallEvent.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49715.156957.patch
Type: text/x-patch
Size: 7213 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180724/11db091a/attachment-0001.bin>


More information about the cfe-commits mailing list