Class ReturnValueAnalysis
Tells on how many of the code paths of a function or a property getter the return value is assigned: the function result variable (MS-VBAL §5.3.1).
public static class ReturnValueAnalysis
- Inheritance
-
ReturnValueAnalysis
- Inherited Members
Remarks
The return value is assigned by a statement that writes to the name of the procedure (AssignmentTarget on an expression that is bound to the procedure itself), which is a fact of the expressions the static pass analyzed: the question is then whether CanReach(int, Func<Instruction, bool>) finds a code path to the end of the activation that does not go through one.
A fact is stated only when it is true, so nothing is stated when it could not be established: when the static pass found something wrong with the procedure or did not analyze every expression of it (an assignment may be in what it did not see), or when the graph approximates a jump (UnresolvedJump, Subroutines). Resumption only takes paths away, and a path that is not in the graph cannot be reported as one that is.
Methods
Of(MemberDeclarationNode, ProcedureSemanticModel, InstructionList)
Tells about the return value of a procedure.
public static ReturnValueFact? Of(MemberDeclarationNode declaration, ProcedureSemanticModel model, InstructionList instructions)
Parameters
declarationMemberDeclarationNodeThe declaration of the procedure.
modelProcedureSemanticModelWhat the static pass found out about its body.
instructionsInstructionListIts lowered body.
Returns
- ReturnValueFact
The fact, or null when the procedure does not return a value (it is not a function or a property getter) or the fact could not be established.