#include "source/assembly_grammar.h"
#include <algorithm>
#include <cassert>
#include <cstring>
#include "source/ext_inst.h"
#include "source/opcode.h"
#include "source/operand.h"
#include "source/spirv_target_env.h"
#include "source/table.h"
namespace spvtools {
namespace {
spv_result_t spvTextParseMaskOperand(spv_target_env env,
const spv_operand_table operandTable,
const spv_operand_type_t type,
const char* textValue, uint32_t* pValue) { … }
struct SpecConstantOpcodeEntry { … };
#define CASE …
const SpecConstantOpcodeEntry kOpSpecConstantOpcodes[] = …;
static_assert …;
#undef CASE
const size_t kNumOpSpecConstantOpcodes = …;
}
bool AssemblyGrammar::isValid() const { … }
CapabilitySet AssemblyGrammar::filterCapsAgainstTargetEnv(
const spv::Capability* cap_array, uint32_t count) const { … }
spv_result_t AssemblyGrammar::lookupOpcode(const char* name,
spv_opcode_desc* desc) const { … }
spv_result_t AssemblyGrammar::lookupOpcode(spv::Op opcode,
spv_opcode_desc* desc) const { … }
spv_result_t AssemblyGrammar::lookupOperand(spv_operand_type_t type,
const char* name, size_t name_len,
spv_operand_desc* desc) const { … }
spv_result_t AssemblyGrammar::lookupOperand(spv_operand_type_t type,
uint32_t operand,
spv_operand_desc* desc) const { … }
spv_result_t AssemblyGrammar::lookupSpecConstantOpcode(const char* name,
spv::Op* opcode) const { … }
spv_result_t AssemblyGrammar::lookupSpecConstantOpcode(spv::Op opcode) const { … }
spv_result_t AssemblyGrammar::parseMaskOperand(const spv_operand_type_t type,
const char* textValue,
uint32_t* pValue) const { … }
spv_result_t AssemblyGrammar::lookupExtInst(spv_ext_inst_type_t type,
const char* textValue,
spv_ext_inst_desc* extInst) const { … }
spv_result_t AssemblyGrammar::lookupExtInst(spv_ext_inst_type_t type,
uint32_t firstWord,
spv_ext_inst_desc* extInst) const { … }
void AssemblyGrammar::pushOperandTypesForMask(
const spv_operand_type_t type, const uint32_t mask,
spv_operand_pattern_t* pattern) const { … }
}