Lines Matching defs:context
34 static bool check_modifiers(const Context& context,
40 (context.fConfig->fIsBuiltinCode ? Modifiers::kES3_Flag : 0);
41 modifiers.checkPermitted(context, line, permitted, /*permittedLayoutFlags=*/0);
44 context.fErrors->error(line, "functions cannot be both 'inline' and 'noinline'");
50 static bool check_return_type(const Context& context, int line, const Type& returnType) {
51 ErrorReporter& errors = *context.fErrors;
56 if (context.fConfig->strictES2Mode() && returnType.isOrContainsArray()) {
60 if (!context.fConfig->fIsBuiltinCode && !returnType.isVoid() &&
69 static bool check_parameters(const Context& context,
73 return type == *context.fTypes.fHalf4 || type == *context.fTypes.fFloat4;
82 param->modifiers().checkPermitted(context, param->fLine,
89 if (type.isEffectChild() && !context.fConfig->fIsBuiltinCode) {
90 context.fErrors->error(param->fLine, "parameters of type '" + type.displayName() +
106 if (ProgramConfig::IsRuntimeEffect(context.fConfig->fKind)) {
110 if (type == *context.fTypes.fFloat2) {
118 } else if (context.fConfig->fKind == ProgramKind::kFragment) {
122 if (type == *context.fTypes.fFloat2) {
130 param->setModifiers(context.fModifiersPool->add(m));
136 static bool check_main_signature(const Context& context, int line, const Type& returnType,
138 ErrorReporter& errors = *context.fErrors;
139 ProgramKind kind = context.fConfig->fKind;
142 return type == *context.fTypes.fHalf4 || type == *context.fTypes.fFloat4;
147 return p.type() == *context.fTypes.fFloat2 &&
233 static bool find_existing_declaration(const Context& context,
240 ErrorReporter& errors = *context.fErrors;
282 context.fConfig->fIsBuiltinCode);
323 const Context& context,
333 if (!check_modifiers(context, line, *modifiers) ||
334 !check_return_type(context, line, *returnType) ||
335 !check_parameters(context, parameters, isMain) ||
336 (isMain && !check_main_signature(context, line, *returnType, parameters)) ||
337 !find_existing_declaration(context, symbols, line, name, parameters, returnType, &decl)) {
350 context.fConfig->fIsBuiltinCode);