C++: Handle FunctionAccesses with qualifiers

Also fix the IR generation for these and add more IR tests involving value
categories.
This commit is contained in:
Jeroen Ketema
2023-07-18 16:35:39 +02:00
parent d41d2bc29e
commit aad094bdd0
7 changed files with 380 additions and 3 deletions

View File

@@ -368,6 +368,11 @@ class FunctionAccess extends Access, @routineexpr {
/** Gets the accessed function. */
override Function getTarget() { funbind(underlyingElement(this), unresolveElement(result)) }
/**
* Gets the expression generating the function being accessed.
*/
Expr getQualifier() { this.getChild(-1) = result }
/** Gets a textual representation of this function access. */
override string toString() {
if exists(this.getTarget())