Lines Matching defs:function

118             if (expr.is<FunctionCall>() && expr.as<FunctionCall>().function().matches(*fFuncDecl)) {
126 stmt.as<InlineMarker>().function().matches(*fFuncDecl)) {
267 // The inliner will create inlined function bodies as a Block containing multiple statements,
393 return std::make_unique<ExternalFunctionCall>(line, &externalCall.function(),
407 funcCall.function(),
535 // This function doesn't return a value. We won't inline functions with early
540 // If a function only contains a single return, and it doesn't reference variables from
542 // replace the function-call expression with the function's return expression.
617 // Since we can't insert statements into an expression, we run the inline function as extra
620 // statements), we wrap the whole function in a loop and use break statements to jump to the
624 SkASSERT(this->isSafeToInline(call->function().definition(), usage));
628 const FunctionDefinition& function = *call->function().definition();
629 const Block& body = function.body()->as<Block>();
630 const ReturnComplexity returnComplexity = GetReturnComplexity(function);
639 inlineStatements.push_back(InlineMarker::Make(&call->function()));
643 !function.declaration().returnType().isVoid()) {
646 // the function-call node with the result expression.
648 function.declaration().name(),
649 &function.declaration().returnType(),
661 // If the parameter isn't written to within the inline function ...
663 const Variable* param = function.declaration().parameters()[i];
702 } else if (function.declaration().returnType().isVoid()) {
703 // It's a void function, so it doesn't actually result in anything, but we have to return
707 // It's a non-void function, but it never created a result expression--that is, it never
708 // returned anything on any path! This should have been detected in the function finalizer.
710 SkDEBUGFAIL("inliner found non-void function that fails to return a value on any path");
711 fContext->fErrors->error(function.fLine, "inliner found non-void function '" +
712 function.declaration().name() +
741 // We don't allow inlining a function with out parameters that are written to.
756 // A candidate function for inlining, containing everything that `inlineCall` needs.
781 // The function that we're currently processing (i.e. inlining into).
807 // The inliner can't operate outside of a function's scope.
855 // of a function call. However, loops that don't use `continue` would still be
887 // cost of a function call. However, loops that don't use `continue` would still
1050 return (*candidate.fCandidateExpr)->as<FunctionCall>().function();
1108 // Remove candidates on a per-function basis if the effect of inlining would be to make more
1126 // If a function is only used once, it's cost-free to inline.
1133 // Inlining this function will add too many IRNodes.
1164 // Convert the function call to its inlined equivalent.
1190 // function, then replace the enclosing statement with that Block.
1200 // Replace the candidate function call with our replacement expression.