854 {
855 if (!*expr) {
856 return;
857 }
858
859 switch ((*expr)->kind()) {
860 case Expression::Kind::kFieldAccess:
861 case Expression::Kind::kFunctionReference:
863 case Expression::Kind::kMethodReference:
864 case Expression::Kind::kSetting:
865 case Expression::Kind::kTypeReference:
866 case Expression::Kind::kVariableReference:
867
868 break;
869
870 case Expression::Kind::kBinary: {
871 BinaryExpression& binaryExpr = (*expr)->as<BinaryExpression>();
873
874
875
876
877
878
879
880
881
882 Operator op = binaryExpr.getOperator();
883 bool shortCircuitable = (op.kind() == Operator::Kind::LOGICALAND ||
884 op.kind() == Operator::Kind::LOGICALOR);
885 if (!shortCircuitable) {
887 }
888 break;
889 }
890 case Expression::Kind::kChildCall: {
891 ChildCall& childCallExpr = (*expr)->as<ChildCall>();
892 for (std::unique_ptr<Expression>& arg : childCallExpr.arguments()) {
894 }
895 break;
896 }
897 case Expression::Kind::kConstructorArray:
898 case Expression::Kind::kConstructorArrayCast:
899 case Expression::Kind::kConstructorCompound:
900 case Expression::Kind::kConstructorCompoundCast:
901 case Expression::Kind::kConstructorDiagonalMatrix:
902 case Expression::Kind::kConstructorMatrixResize:
903 case Expression::Kind::kConstructorScalarCast:
904 case Expression::Kind::kConstructorSplat:
905 case Expression::Kind::kConstructorStruct: {
906 AnyConstructor& constructorExpr = (*expr)->asAnyConstructor();
907 for (std::unique_ptr<Expression>& arg : constructorExpr.argumentSpan()) {
909 }
910 break;
911 }
912 case Expression::Kind::kFunctionCall: {
913 FunctionCall& funcCallExpr = (*expr)->as<FunctionCall>();
914 for (std::unique_ptr<Expression>& arg : funcCallExpr.arguments()) {
916 }
918 break;
919 }
921 IndexExpression& indexExpr = (*expr)->as<IndexExpression>();
924 break;
925 }
926 case Expression::Kind::kPostfix: {
927 PostfixExpression& postfixExpr = (*expr)->as<PostfixExpression>();
929 break;
930 }
931 case Expression::Kind::kPrefix: {
932 PrefixExpression& prefixExpr = (*expr)->as<PrefixExpression>();
934 break;
935 }
936 case Expression::Kind::kSwizzle: {
937 Swizzle& swizzleExpr = (*expr)->as<Swizzle>();
939 break;
940 }
941 case Expression::Kind::kTernary: {
942 TernaryExpression& ternaryExpr = (*expr)->as<TernaryExpression>();
943
945
946
947 break;
948 }
949 default:
951 }
952 }
void addInlineCandidate(std::unique_ptr< Expression > *candidate)
void visitExpression(std::unique_ptr< Expression > *expr)