Lines Matching refs:vstate
216 spv_diagnostic* pDiagnostic, ValidationState_t* vstate) { in ValidateBinaryUsingContextAndValidationState() argument
245 if (header.bound > vstate->options()->universal_limits_.max_id_bound) { in ValidateBinaryUsingContextAndValidationState()
249 << vstate->options()->universal_limits_.max_id_bound << "."; in ValidateBinaryUsingContextAndValidationState()
259 spvBinaryParse(&hijacked_context, vstate, words, num_words, in ValidateBinaryUsingContextAndValidationState()
265 if (auto error = spvBinaryParse(&context, vstate, words, num_words, setHeader, in ValidateBinaryUsingContextAndValidationState()
270 for (auto& instruction : vstate->ordered_instructions()) { in ValidateBinaryUsingContextAndValidationState()
289 vstate->RegisterEntryPoint(entry_point, execution_model, in ValidateBinaryUsingContextAndValidationState()
293 if (!vstate->in_function_body()) { in ValidateBinaryUsingContextAndValidationState()
294 return vstate->diag(SPV_ERROR_INVALID_LAYOUT, &instruction) in ValidateBinaryUsingContextAndValidationState()
300 !vstate->IsFunctionCallDefined(called_id)) { in ValidateBinaryUsingContextAndValidationState()
301 return vstate->diag(SPV_ERROR_INVALID_LAYOUT, &instruction) in ValidateBinaryUsingContextAndValidationState()
306 vstate->AddFunctionCallTarget(called_id); in ValidateBinaryUsingContextAndValidationState()
309 if (vstate->in_function_body()) { in ValidateBinaryUsingContextAndValidationState()
310 inst->set_function(&(vstate->current_function())); in ValidateBinaryUsingContextAndValidationState()
311 inst->set_block(vstate->current_function().current_block()); in ValidateBinaryUsingContextAndValidationState()
313 if (vstate->in_block() && spvOpcodeIsBlockTerminator(inst->opcode())) { in ValidateBinaryUsingContextAndValidationState()
314 vstate->current_function().current_block()->set_terminator(inst); in ValidateBinaryUsingContextAndValidationState()
318 if (auto error = IdPass(*vstate, inst)) return error; in ValidateBinaryUsingContextAndValidationState()
321 if (auto error = CapabilityPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
322 if (auto error = DataRulesPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
323 if (auto error = ModuleLayoutPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
324 if (auto error = CfgPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
325 if (auto error = InstructionPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
330 vstate->RegisterInstruction(inst); in ValidateBinaryUsingContextAndValidationState()
332 if (auto error = UpdateIdUse(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
335 if (!vstate->has_memory_model_specified()) in ValidateBinaryUsingContextAndValidationState()
336 return vstate->diag(SPV_ERROR_INVALID_LAYOUT, nullptr) in ValidateBinaryUsingContextAndValidationState()
339 if (vstate->in_function_body()) in ValidateBinaryUsingContextAndValidationState()
340 return vstate->diag(SPV_ERROR_INVALID_LAYOUT, nullptr) in ValidateBinaryUsingContextAndValidationState()
344 if (auto error = ValidateForwardDecls(*vstate)) return error; in ValidateBinaryUsingContextAndValidationState()
347 for (size_t i = 0; i < vstate->ordered_instructions().size(); ++i) { in ValidateBinaryUsingContextAndValidationState()
348 auto& instruction = vstate->ordered_instructions()[i]; in ValidateBinaryUsingContextAndValidationState()
353 if (auto error = DebugPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
354 if (auto error = AnnotationPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
355 if (auto error = ExtensionPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
356 if (auto error = ModeSettingPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
357 if (auto error = TypePass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
358 if (auto error = ConstantPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
359 if (auto error = MemoryPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
360 if (auto error = FunctionPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
361 if (auto error = ImagePass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
362 if (auto error = ConversionPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
363 if (auto error = CompositesPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
364 if (auto error = ArithmeticsPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
365 if (auto error = BitwisePass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
366 if (auto error = LogicalsPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
367 if (auto error = ControlFlowPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
368 if (auto error = DerivativesPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
369 if (auto error = AtomicsPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
370 if (auto error = PrimitivesPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
371 if (auto error = BarriersPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
375 if (auto error = NonUniformPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
377 if (auto error = LiteralsPass(*vstate, &instruction)) return error; in ValidateBinaryUsingContextAndValidationState()
382 if (auto error = ValidateAdjacency(*vstate)) return error; in ValidateBinaryUsingContextAndValidationState()
384 if (auto error = ValidateEntryPoints(*vstate)) return error; in ValidateBinaryUsingContextAndValidationState()
387 if (auto error = PerformCfgChecks(*vstate)) return error; in ValidateBinaryUsingContextAndValidationState()
388 if (auto error = CheckIdDefinitionDominateUse(*vstate)) return error; in ValidateBinaryUsingContextAndValidationState()
389 if (auto error = ValidateDecorations(*vstate)) return error; in ValidateBinaryUsingContextAndValidationState()
390 if (auto error = ValidateInterfaces(*vstate)) return error; in ValidateBinaryUsingContextAndValidationState()
393 if (auto error = ValidateBuiltIns(*vstate)) return error; in ValidateBinaryUsingContextAndValidationState()
396 for (const auto inst : vstate->ordered_instructions()) { in ValidateBinaryUsingContextAndValidationState()
397 if (auto error = ValidateExecutionLimitations(*vstate, &inst)) return error; in ValidateBinaryUsingContextAndValidationState()
408 std::unique_ptr<ValidationState_t>* vstate) { in ValidateBinaryAndKeepValidationState() argument
415 vstate->reset(new ValidationState_t(&hijack_context, options, words, in ValidateBinaryAndKeepValidationState()
419 hijack_context, words, num_words, pDiagnostic, vstate->get()); in ValidateBinaryAndKeepValidationState()
445 spvtools::val::ValidationState_t vstate(&hijack_context, default_options, in spvValidateBinary() local
451 hijack_context, words, num_words, pDiagnostic, &vstate); in spvValidateBinary()
468 spvtools::val::ValidationState_t vstate(&hijack_context, options, in spvValidateWithOptions() local
473 hijack_context, binary->code, binary->wordCount, pDiagnostic, &vstate); in spvValidateWithOptions()