This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] [NFC] A convenient getter for getting a current stack frame
ClosedPublic

Authored by george.karpenkov on Mar 21 2018, 2:44 PM.

Details

Summary

One of my pet peeves is having to insert a newline in the middle of a statement due to having to write Blah->getLocationContext()->getCurrentStackFrame().
Current stack frame is an object which is used very often, perhaps even more often than the location context,
and it thus should have it's own getter.
Also unifies getter name across objects.

Diff Detail

Repository
rC Clang

Event Timeline

NoQ added a comment.Mar 21 2018, 5:23 PM

Fair enough!

Also unifies getter name across objects.

I'd rather omit Current. A docstring might be a better place for stating the obvious :)

@NoQ any further objections?

NoQ accepted this revision.Apr 27 2018, 4:44 PM

Nope^^

This revision is now accepted and ready to land.Apr 27 2018, 4:44 PM
This revision was automatically updated to reflect the committed changes.