From 923f6c13fc371b7bfce6153e52163be79e9c3382 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 11 Nov 2015 12:45:23 -0500 Subject: [PATCH] Use quotation for libspirv.h and sort headers. --- source/assembly_grammar.h | 2 +- source/binary.cpp | 2 +- source/diagnostic.cpp | 3 ++- source/diagnostic.h | 4 ++-- source/endian.h | 2 +- source/ext_inst.h | 2 +- source/instruction.h | 2 ++ source/opcode.cpp | 7 ++++--- source/opcode.h | 2 +- source/operand.h | 2 +- source/table.h | 2 +- source/text.cpp | 2 +- source/text.h | 6 +++--- source/text_handler.h | 2 +- source/validate.cpp | 15 ++++++++------- source/validate.h | 2 +- source/validate_id.cpp | 12 ++++++------ test/UnitSPIRV.h | 12 ++++++------ tools/as/as.cpp | 5 +++-- tools/dis/dis.cpp | 5 +++-- tools/val/val.cpp | 4 ++-- 21 files changed, 51 insertions(+), 44 deletions(-) diff --git a/source/assembly_grammar.h b/source/assembly_grammar.h index 739413a..4966ed6 100644 --- a/source/assembly_grammar.h +++ b/source/assembly_grammar.h @@ -27,7 +27,7 @@ #ifndef LIBSPIRV_ASSEMBLY_GRAMMAR_H_ #define LIBSPIRV_ASSEMBLY_GRAMMAR_H_ -#include +#include "libspirv/libspirv.h" #include "operand.h" #include "table.h" diff --git a/source/binary.cpp b/source/binary.cpp index 5e4c732..fb62a85 100644 --- a/source/binary.cpp +++ b/source/binary.cpp @@ -31,11 +31,11 @@ #include #include -#include #include "assembly_grammar.h" #include "diagnostic.h" #include "endian.h" #include "ext_inst.h" +#include "libspirv/libspirv.h" #include "opcode.h" #include "operand.h" diff --git a/source/diagnostic.cpp b/source/diagnostic.cpp index 8d60c67..0886957 100644 --- a/source/diagnostic.cpp +++ b/source/diagnostic.cpp @@ -24,7 +24,6 @@ // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -#include #include "diagnostic.h" #include @@ -32,6 +31,8 @@ #include +#include "libspirv/libspirv.h" + // Diagnostic API spv_diagnostic spvDiagnosticCreate(const spv_position position, diff --git a/source/diagnostic.h b/source/diagnostic.h index 7115416..f8a2fe4 100644 --- a/source/diagnostic.h +++ b/source/diagnostic.h @@ -27,12 +27,12 @@ #ifndef LIBSPIRV_DIAGNOSTIC_H_ #define LIBSPIRV_DIAGNOSTIC_H_ -#include - #include #include #include +#include "libspirv/libspirv.h" + class diagnostic_helper { public: diagnostic_helper(spv_position_t& position, spv_diagnostic* pDiagnostic) diff --git a/source/endian.h b/source/endian.h index c5c097a..4c22e51 100644 --- a/source/endian.h +++ b/source/endian.h @@ -27,7 +27,7 @@ #ifndef LIBSPIRV_ENDIAN_H_ #define LIBSPIRV_ENDIAN_H_ -#include +#include "libspirv/libspirv.h" /// @brief Fix the endianness of a word /// diff --git a/source/ext_inst.h b/source/ext_inst.h index 12eb57d..ee7c800 100644 --- a/source/ext_inst.h +++ b/source/ext_inst.h @@ -27,7 +27,7 @@ #ifndef LIBSPIRV_EXT_INST_H_ #define LIBSPIRV_EXT_INST_H_ -#include +#include "libspirv/libspirv.h" #include "table.h" /// @brief Get the type from the extended instruction library string diff --git a/source/instruction.h b/source/instruction.h index abd2e54..2f58498 100644 --- a/source/instruction.h +++ b/source/instruction.h @@ -32,6 +32,8 @@ #include +#include "table.h" + // Describes an instruction. struct spv_instruction_t { // Normally, both opcode and extInstType contain valid data. diff --git a/source/opcode.cpp b/source/opcode.cpp index c8f6851..f7e3259 100644 --- a/source/opcode.cpp +++ b/source/opcode.cpp @@ -24,14 +24,15 @@ // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -#include -#include "endian.h" -#include "instruction.h" #include "opcode.h" #include #include +#include "endian.h" +#include "instruction.h" +#include "libspirv/libspirv.h" + namespace { // Descriptions of each opcode. Each entry describes the format of the diff --git a/source/opcode.h b/source/opcode.h index 0ad338a..407452f 100644 --- a/source/opcode.h +++ b/source/opcode.h @@ -28,7 +28,7 @@ #define LIBSPIRV_OPCODE_H_ #include "instruction.h" -#include +#include "libspirv/libspirv.h" #include "table.h" // Functions diff --git a/source/operand.h b/source/operand.h index 8dcb585..4d6f38f 100644 --- a/source/operand.h +++ b/source/operand.h @@ -29,7 +29,7 @@ #include -#include +#include "libspirv/libspirv.h" #include "table.h" /// @brief A sequence of operand types. diff --git a/source/table.h b/source/table.h index f29717f..1ec0fa2 100644 --- a/source/table.h +++ b/source/table.h @@ -27,7 +27,7 @@ #ifndef LIBSPIRV_TABLE_H_ #define LIBSPIRV_TABLE_H_ -#include +#include "libspirv/libspirv.h" typedef struct spv_opcode_desc_t { const char* name; diff --git a/source/text.cpp b/source/text.cpp index fa6e6eb..bd74769 100644 --- a/source/text.cpp +++ b/source/text.cpp @@ -38,12 +38,12 @@ #include #include -#include #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" diff --git a/source/text.h b/source/text.h index 9b0c978..f8b9551 100644 --- a/source/text.h +++ b/source/text.h @@ -27,11 +27,11 @@ #ifndef LIBSPIRV_TEXT_H_ #define LIBSPIRV_TEXT_H_ -#include -#include "operand.h" - #include +#include "libspirv/libspirv.h" +#include "operand.h" + // Structures typedef enum spv_literal_type_t { diff --git a/source/text_handler.h b/source/text_handler.h index 56dd5f6..699d550 100644 --- a/source/text_handler.h +++ b/source/text_handler.h @@ -32,9 +32,9 @@ #include #include -#include #include "diagnostic.h" #include "instruction.h" +#include "libspirv/libspirv.h" #include "text.h" namespace libspirv { diff --git a/source/validate.cpp b/source/validate.cpp index d15559f..5959a6e 100644 --- a/source/validate.cpp +++ b/source/validate.cpp @@ -24,13 +24,6 @@ // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -#include -#include "binary.h" -#include "diagnostic.h" -#include "endian.h" -#include "instruction.h" -#include "opcode.h" -#include "operand.h" #include "validate.h" #include @@ -39,6 +32,14 @@ #include +#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; diff --git a/source/validate.h b/source/validate.h index 3ada98c..57a8f30 100644 --- a/source/validate.h +++ b/source/validate.h @@ -28,7 +28,7 @@ #define LIBSPIRV_VALIDATE_H_ #include "instruction.h" -#include +#include "libspirv/libspirv.h" #include "table.h" // Structures diff --git a/source/validate_id.cpp b/source/validate_id.cpp index 600d1b1..4f69ac2 100644 --- a/source/validate_id.cpp +++ b/source/validate_id.cpp @@ -24,18 +24,18 @@ // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -#include -#include "diagnostic.h" -#include "instruction.h" -#include "opcode.h" -#include "validate.h" - #include #include #include #include +#include "diagnostic.h" +#include "instruction.h" +#include "libspirv/libspirv.h" +#include "opcode.h" +#include "validate.h" + #define spvCheck(condition, action) \ if (condition) { \ action; \ diff --git a/test/UnitSPIRV.h b/test/UnitSPIRV.h index b87fa23..7b7fb5b 100644 --- a/test/UnitSPIRV.h +++ b/test/UnitSPIRV.h @@ -27,7 +27,11 @@ #ifndef LIBSPIRV_TEST_UNITSPIRV_H_ #define LIBSPIRV_TEST_UNITSPIRV_H_ -#include +#include + +#include + +#include "libspirv/libspirv.h" #include "../source/assembly_grammar.h" #include "../source/binary.h" #include "../source/diagnostic.h" @@ -37,7 +41,7 @@ #include "../source/text_handler.h" #include "../source/validate.h" -#include +#include #ifdef __ANDROID__ #include @@ -51,10 +55,6 @@ std::string to_string(const T& val) { } #endif -#include - -#include - // Determine endianness & predicate tests on it enum { I32_ENDIAN_LITTLE = 0x03020100ul, diff --git a/tools/as/as.cpp b/tools/as/as.cpp index a09f3d1..f78a008 100644 --- a/tools/as/as.cpp +++ b/tools/as/as.cpp @@ -24,11 +24,12 @@ // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -#include - #include + #include +#include "libspirv/libspirv.h" + void print_usage(char* argv0) { printf( "Assemble a *.svasm file into a *.sv binary.\n\n" diff --git a/tools/dis/dis.cpp b/tools/dis/dis.cpp index 7370566..da653f2 100644 --- a/tools/dis/dis.cpp +++ b/tools/dis/dis.cpp @@ -24,11 +24,12 @@ // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -#include - #include + #include +#include "libspirv/libspirv.h" + void print_usage(char* argv0) { printf( "Dissassemble a *.sv file into a *.svasm text file.\n\n" diff --git a/tools/val/val.cpp b/tools/val/val.cpp index 6baf4d0..35b4432 100644 --- a/tools/val/val.cpp +++ b/tools/val/val.cpp @@ -24,14 +24,14 @@ // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -#include - #include #include #include #include +#include "libspirv/libspirv.h" + void print_usage(char* argv0) { printf( "Validate a SPIR-V binary file.\n\n" -- 2.7.4