Show uses for __call__() and __{get,set}item__()

Authored by flherne on Nov 25 2016, 11:33 PM.

Description

Show uses for call() and {get,set}item()

Uses of getitem() and setitem() weren't shown at all.
Uses of call() were incorrectly shown as uses of init().

This removes ExpressionAst::belongsToCall, because it's always equal to
ExpressionAst::parent or null.

This adds a new parameter isAlias to functionForCalled(), which allows
it to distinguish between calling a class object (constructor init)
and calling an instance of that class with call().

This parameter can (and probably should) be used in other callers to
improve parsing or just simplify code. For now, the default value of
true causes functionForCalled() to behave as before.

The ranges for these uses - as with the existing init() ones - are
not always correct, particularly following subscripts.
TODO: make the ranges of AST nodes more reliable, and then look more
carefully for opening braces.

No test regressions. No new tests, because the test framework doesn't

seem to support use ranges currently.

Tested on some real projects, didn't crash.

Differential Revision: https://phabricator.kde.org/D3512