#ifndef LIBSPIRV_ASSEMBLY_GRAMMAR_H_
#define LIBSPIRV_ASSEMBLY_GRAMMAR_H_
-#include <libspirv/libspirv.h>
+#include "libspirv/libspirv.h"
#include "operand.h"
#include "table.h"
#include <limits>
#include <unordered_map>
-#include <libspirv/libspirv.h>
#include "assembly_grammar.h"
#include "diagnostic.h"
#include "endian.h"
#include "ext_inst.h"
+#include "libspirv/libspirv.h"
#include "opcode.h"
#include "operand.h"
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-#include <libspirv/libspirv.h>
#include "diagnostic.h"
#include <assert.h>
#include <iostream>
+#include "libspirv/libspirv.h"
+
// Diagnostic API
spv_diagnostic spvDiagnosticCreate(const spv_position position,
#ifndef LIBSPIRV_DIAGNOSTIC_H_
#define LIBSPIRV_DIAGNOSTIC_H_
-#include <libspirv/libspirv.h>
-
#include <iostream>
#include <sstream>
#include <utility>
+#include "libspirv/libspirv.h"
+
class diagnostic_helper {
public:
diagnostic_helper(spv_position_t& position, spv_diagnostic* pDiagnostic)
#ifndef LIBSPIRV_ENDIAN_H_
#define LIBSPIRV_ENDIAN_H_
-#include <libspirv/libspirv.h>
+#include "libspirv/libspirv.h"
/// @brief Fix the endianness of a word
///
#ifndef LIBSPIRV_EXT_INST_H_
#define LIBSPIRV_EXT_INST_H_
-#include <libspirv/libspirv.h>
+#include "libspirv/libspirv.h"
#include "table.h"
/// @brief Get the type from the extended instruction library string
#include <headers/spirv.h>
+#include "table.h"
+
// Describes an instruction.
struct spv_instruction_t {
// Normally, both opcode and extInstType contain valid data.
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-#include <libspirv/libspirv.h>
-#include "endian.h"
-#include "instruction.h"
#include "opcode.h"
#include <assert.h>
#include <string.h>
+#include "endian.h"
+#include "instruction.h"
+#include "libspirv/libspirv.h"
+
namespace {
// Descriptions of each opcode. Each entry describes the format of the
#define LIBSPIRV_OPCODE_H_
#include "instruction.h"
-#include <libspirv/libspirv.h>
+#include "libspirv/libspirv.h"
#include "table.h"
// Functions
#include <deque>
-#include <libspirv/libspirv.h>
+#include "libspirv/libspirv.h"
#include "table.h"
/// @brief A sequence of operand types.
#ifndef LIBSPIRV_TABLE_H_
#define LIBSPIRV_TABLE_H_
-#include <libspirv/libspirv.h>
+#include "libspirv/libspirv.h"
typedef struct spv_opcode_desc_t {
const char* name;
#include <unordered_map>
#include <vector>
-#include <libspirv/libspirv.h>
#include "assembly_grammar.h"
#include "binary.h"
#include "diagnostic.h"
#include "ext_inst.h"
#include "instruction.h"
+#include "libspirv/libspirv.h"
#include "opcode.h"
#include "operand.h"
#include "table.h"
#ifndef LIBSPIRV_TEXT_H_
#define LIBSPIRV_TEXT_H_
-#include <libspirv/libspirv.h>
-#include "operand.h"
-
#include <string>
+#include "libspirv/libspirv.h"
+#include "operand.h"
+
// Structures
typedef enum spv_literal_type_t {
#include <type_traits>
#include <unordered_map>
-#include <libspirv/libspirv.h>
#include "diagnostic.h"
#include "instruction.h"
+#include "libspirv/libspirv.h"
#include "text.h"
namespace libspirv {
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-#include <libspirv/libspirv.h>
-#include "binary.h"
-#include "diagnostic.h"
-#include "endian.h"
-#include "instruction.h"
-#include "opcode.h"
-#include "operand.h"
#include "validate.h"
#include <assert.h>
#include <vector>
+#include "binary.h"
+#include "diagnostic.h"
+#include "endian.h"
+#include "instruction.h"
+#include "libspirv/libspirv.h"
+#include "opcode.h"
+#include "operand.h"
+
#define spvCheckReturn(expression) \
if (spv_result_t error = (expression)) return error;
#define LIBSPIRV_VALIDATE_H_
#include "instruction.h"
-#include <libspirv/libspirv.h>
+#include "libspirv/libspirv.h"
#include "table.h"
// Structures
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-#include <libspirv/libspirv.h>
-#include "diagnostic.h"
-#include "instruction.h"
-#include "opcode.h"
-#include "validate.h"
-
#include <assert.h>
#include <iostream>
#include <unordered_map>
#include <vector>
+#include "diagnostic.h"
+#include "instruction.h"
+#include "libspirv/libspirv.h"
+#include "opcode.h"
+#include "validate.h"
+
#define spvCheck(condition, action) \
if (condition) { \
action; \
#ifndef LIBSPIRV_TEST_UNITSPIRV_H_
#define LIBSPIRV_TEST_UNITSPIRV_H_
-#include <libspirv/libspirv.h>
+#include <stdint.h>
+
+#include <iomanip>
+
+#include "libspirv/libspirv.h"
#include "../source/assembly_grammar.h"
#include "../source/binary.h"
#include "../source/diagnostic.h"
#include "../source/text_handler.h"
#include "../source/validate.h"
-#include <iomanip>
+#include <gtest/gtest.h>
#ifdef __ANDROID__
#include <sstream>
}
#endif
-#include <gtest/gtest.h>
-
-#include <stdint.h>
-
// Determine endianness & predicate tests on it
enum {
I32_ENDIAN_LITTLE = 0x03020100ul,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-#include <libspirv/libspirv.h>
-
#include <stdio.h>
+
#include <vector>
+#include "libspirv/libspirv.h"
+
void print_usage(char* argv0) {
printf(
"Assemble a *.svasm file into a *.sv binary.\n\n"
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-#include <libspirv/libspirv.h>
-
#include <stdio.h>
+
#include <vector>
+#include "libspirv/libspirv.h"
+
void print_usage(char* argv0) {
printf(
"Dissassemble a *.sv file into a *.svasm text file.\n\n"
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-#include <libspirv/libspirv.h>
-
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <vector>
+#include "libspirv/libspirv.h"
+
void print_usage(char* argv0) {
printf(
"Validate a SPIR-V binary file.\n\n"