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 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.
Could we be more succinct here?
e.g. \return Best-effort getter for AnalysisDeclContext, returns null on failure.
Same for all the methods below.