diff options
author | Diego Novillo <dnovillo@google.com> | 2017-11-27 10:16:41 -0500 |
---|---|---|
committer | Diego Novillo <dnovillo@google.com> | 2017-11-27 14:31:49 -0500 |
commit | 83228137e16c0d7fe33eaceddf6f67115d45338f (patch) | |
tree | a1e2082ec253fe61242c8eeea91943e00a7270d2 /source/val | |
parent | d8b2013ecfd6603855752452bb3a280a7b515d2c (diff) | |
download | spirv-tools-83228137e16c0d7fe33eaceddf6f67115d45338f.tar.gz |
Re-format source tree - NFC.
Re-formatted the source tree with the command:
$ /usr/bin/clang-format -style=file -i \
$(find include source tools test utils -name '*.cpp' -or -name '*.h')
This required a fix to source/val/decoration.h. It was not including
spirv.h, which broke builds when the #include headers were re-ordered by
clang-format.
Diffstat (limited to 'source/val')
-rw-r--r-- | source/val/basic_block.h | 2 | ||||
-rw-r--r-- | source/val/construct.cpp | 2 | ||||
-rw-r--r-- | source/val/construct.h | 2 | ||||
-rw-r--r-- | source/val/decoration.h | 2 | ||||
-rw-r--r-- | source/val/function.cpp | 5 | ||||
-rw-r--r-- | source/val/function.h | 2 | ||||
-rw-r--r-- | source/val/instruction.h | 2 | ||||
-rw-r--r-- | source/val/validation_state.cpp | 6 | ||||
-rw-r--r-- | source/val/validation_state.h | 2 |
9 files changed, 12 insertions, 13 deletions
diff --git a/source/val/basic_block.h b/source/val/basic_block.h index 70b2eec3..f42d6247 100644 --- a/source/val/basic_block.h +++ b/source/val/basic_block.h @@ -221,6 +221,6 @@ bool operator==(const BasicBlock::DominatorIterator& lhs, bool operator!=(const BasicBlock::DominatorIterator& lhs, const BasicBlock::DominatorIterator& rhs); -} /// namespace libspirv +} // namespace libspirv #endif /// LIBSPIRV_VAL_BASICBLOCK_H_ diff --git a/source/val/construct.cpp b/source/val/construct.cpp index e3ad7f06..c5f01dfb 100644 --- a/source/val/construct.cpp +++ b/source/val/construct.cpp @@ -64,4 +64,4 @@ const BasicBlock* Construct::exit_block() const { return exit_block_; } BasicBlock* Construct::exit_block() { return exit_block_; } void Construct::set_exit(BasicBlock* block) { exit_block_ = block; } -} /// namespace libspirv +} // namespace libspirv diff --git a/source/val/construct.h b/source/val/construct.h index bca87d63..594d8d14 100644 --- a/source/val/construct.h +++ b/source/val/construct.h @@ -127,6 +127,6 @@ class Construct { BasicBlock* exit_block_; }; -} /// namespace libspirv +} // namespace libspirv #endif /// LIBSPIRV_VAL_CONSTRUCT_H_ diff --git a/source/val/decoration.h b/source/val/decoration.h index d77b0684..ce749907 100644 --- a/source/val/decoration.h +++ b/source/val/decoration.h @@ -18,6 +18,8 @@ #include <unordered_map> #include <vector> +#include "spirv/1.2/spirv.h" + namespace libspirv { // An object of this class represents a specific decoration including its diff --git a/source/val/function.cpp b/source/val/function.cpp index d7ac7416..f67acc4b 100644 --- a/source/val/function.cpp +++ b/source/val/function.cpp @@ -356,8 +356,7 @@ bool Function::IsCompatibleWithExecutionModel(SpvExecutionModel model, for (const auto& kv : execution_model_limitations_) { if (kv.first != model) { - if (!reason) - return false; + if (!reason) return false; is_compatible = false; ss_reason << kv.second << "\n"; } @@ -370,4 +369,4 @@ bool Function::IsCompatibleWithExecutionModel(SpvExecutionModel model, return is_compatible; } -} /// namespace libspirv +} // namespace libspirv diff --git a/source/val/function.h b/source/val/function.h index 4d53b04f..eb23201c 100644 --- a/source/val/function.h +++ b/source/val/function.h @@ -346,6 +346,6 @@ class Function { std::set<uint32_t> function_call_targets_; }; -} /// namespace libspirv +} // namespace libspirv #endif /// LIBSPIRV_VAL_FUNCTION_H_ diff --git a/source/val/instruction.h b/source/val/instruction.h index 5ae89e2c..96136320 100644 --- a/source/val/instruction.h +++ b/source/val/instruction.h @@ -121,6 +121,6 @@ struct hash<libspirv::Instruction> { return hash<uint32_t>()(inst.id()); } }; -} /// namespace std +} // namespace std #endif // LIBSPIRV_VAL_INSTRUCTION_H_ diff --git a/source/val/validation_state.cpp b/source/val/validation_state.cpp index 02b36467..4e8db282 100644 --- a/source/val/validation_state.cpp +++ b/source/val/validation_state.cpp @@ -266,8 +266,7 @@ const Function& ValidationState_t::current_function() const { const Function* ValidationState_t::function(uint32_t id) const { const auto it = id_to_function_.find(id); - if (it == id_to_function_.end()) - return nullptr; + if (it == id_to_function_.end()) return nullptr; return it->second; } @@ -740,8 +739,7 @@ bool ValidationState_t::GetConstantValUint64(uint32_t id, uint64_t* val) const { if (inst->opcode() != SpvOpConstant && inst->opcode() != SpvOpSpecConstant) return false; - if (!IsIntScalarType(inst->type_id())) - return false; + if (!IsIntScalarType(inst->type_id())) return false; if (inst->words().size() == 4) { *val = inst->word(3); diff --git a/source/val/validation_state.h b/source/val/validation_state.h index d57eac7b..48bc3be5 100644 --- a/source/val/validation_state.h +++ b/source/val/validation_state.h @@ -505,6 +505,6 @@ class ValidationState_t { std::unordered_map<uint32_t, Function*> id_to_function_; }; -} /// namespace libspirv +} // namespace libspirv #endif /// LIBSPIRV_VAL_VALIDATIONSTATE_H_ |