#include "source/text.h"
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <memory>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#include "source/assembly_grammar.h"
#include "source/binary.h"
#include "source/diagnostic.h"
#include "source/ext_inst.h"
#include "source/instruction.h"
#include "source/opcode.h"
#include "source/operand.h"
#include "source/spirv_constant.h"
#include "source/spirv_target_env.h"
#include "source/table.h"
#include "source/text_handler.h"
#include "source/util/bitutils.h"
#include "source/util/parse_number.h"
#include "spirv-tools/libspirv.h"
bool spvIsValidIDCharacter(const char value) { … }
bool spvIsValidID(const char* textValue) { … }
spv_result_t spvTextToLiteral(const char* textValue, spv_literal_t* pLiteral) { … }
namespace {
spv_result_t encodeImmediate(spvtools::AssemblyContext* context,
const char* text, spv_instruction_t* pInst) { … }
}
spv_result_t spvTextEncodeOperand(const spvtools::AssemblyGrammar& grammar,
spvtools::AssemblyContext* context,
const spv_operand_type_t type,
const char* textValue,
spv_instruction_t* pInst,
spv_operand_pattern_t* pExpectedOperands) { … }
namespace {
spv_result_t encodeInstructionStartingWithImmediate(
const spvtools::AssemblyGrammar& grammar,
spvtools::AssemblyContext* context, spv_instruction_t* pInst) { … }
spv_result_t spvTextEncodeOpcode(const spvtools::AssemblyGrammar& grammar,
spvtools::AssemblyContext* context,
spv_instruction_t* pInst) { … }
enum { … };
spv_result_t SetHeader(spv_target_env env, const uint32_t bound,
uint32_t* header) { … }
spv_result_t GetNumericIds(const spvtools::AssemblyGrammar& grammar,
const spvtools::MessageConsumer& consumer,
const spv_text text,
std::set<uint32_t>* numeric_ids) { … }
spv_result_t spvTextToBinaryInternal(const spvtools::AssemblyGrammar& grammar,
const spvtools::MessageConsumer& consumer,
const spv_text text,
const uint32_t options,
spv_binary* pBinary) { … }
}
spv_result_t spvTextToBinary(const spv_const_context context,
const char* input_text,
const size_t input_text_size, spv_binary* pBinary,
spv_diagnostic* pDiagnostic) { … }
spv_result_t spvTextToBinaryWithOptions(const spv_const_context context,
const char* input_text,
const size_t input_text_size,
const uint32_t options,
spv_binary* pBinary,
spv_diagnostic* pDiagnostic) { … }
void spvTextDestroy(spv_text text) { … }