Run format_all.sh

Disable clang format in C wrapper for now.
Some weird formatting bug with the try/catch macro.
This commit is contained in:
Hans-Kristian Arntzen 2019-03-06 12:20:13 +01:00
parent ef24337849
commit 8bfb04d29d
3 changed files with 21 additions and 24 deletions

View File

@ -1424,19 +1424,17 @@ bool Compiler::block_is_loop_candidate(const SPIRBlock &block, SPIRBlock::Method
const auto *true_block = maybe_get<SPIRBlock>(block.true_block);
const auto *merge_block = maybe_get<SPIRBlock>(block.merge_block);
bool false_block_is_merge =
block.false_block == block.merge_block ||
(false_block && merge_block && execution_is_noop(*false_block, *merge_block));
bool false_block_is_merge = block.false_block == block.merge_block ||
(false_block && merge_block && execution_is_noop(*false_block, *merge_block));
bool true_block_is_merge =
block.true_block == block.merge_block ||
(true_block && merge_block && execution_is_noop(*true_block, *merge_block));
bool true_block_is_merge = block.true_block == block.merge_block ||
(true_block && merge_block && execution_is_noop(*true_block, *merge_block));
bool positive_candidate = block.true_block != block.merge_block && block.true_block != block.self &&
false_block_is_merge;
bool positive_candidate =
block.true_block != block.merge_block && block.true_block != block.self && false_block_is_merge;
bool negative_candidate = block.false_block != block.merge_block && block.false_block != block.self &&
true_block_is_merge;
bool negative_candidate =
block.false_block != block.merge_block && block.false_block != block.self && true_block_is_merge;
bool ret = block.terminator == SPIRBlock::Select && block.merge == SPIRBlock::MergeLoop &&
(positive_candidate || negative_candidate);
@ -1478,19 +1476,17 @@ bool Compiler::block_is_loop_candidate(const SPIRBlock &block, SPIRBlock::Method
const auto *true_block = maybe_get<SPIRBlock>(child.true_block);
const auto *merge_block = maybe_get<SPIRBlock>(block.merge_block);
bool false_block_is_merge =
child.false_block == block.merge_block ||
(false_block && merge_block && execution_is_noop(*false_block, *merge_block));
bool false_block_is_merge = child.false_block == block.merge_block ||
(false_block && merge_block && execution_is_noop(*false_block, *merge_block));
bool true_block_is_merge =
child.true_block == block.merge_block ||
(true_block && merge_block && execution_is_noop(*true_block, *merge_block));
bool true_block_is_merge = child.true_block == block.merge_block ||
(true_block && merge_block && execution_is_noop(*true_block, *merge_block));
bool positive_candidate = child.true_block != block.merge_block && child.true_block != block.self &&
false_block_is_merge;
bool positive_candidate =
child.true_block != block.merge_block && child.true_block != block.self && false_block_is_merge;
bool negative_candidate = child.false_block != block.merge_block && child.false_block != block.self &&
true_block_is_merge;
bool negative_candidate =
child.false_block != block.merge_block && child.false_block != block.self && true_block_is_merge;
ret = child.terminator == SPIRBlock::Select && child.merge == SPIRBlock::MergeNone &&
(positive_candidate || negative_candidate);

View File

@ -24,6 +24,8 @@
#include <memory>
#include <new>
// clang-format off
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
@ -1652,4 +1654,4 @@ void spvc_get_version(unsigned *major, unsigned *minor, unsigned *patch)
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#endif

View File

@ -10919,9 +10919,8 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
// should become an empty string.
// We have no fallbacks if we cannot forward everything to temporaries ...
const auto &continue_block = get<SPIRBlock>(block.continue_block);
bool positive_test =
execution_is_noop(get<SPIRBlock>(continue_block.true_block),
get<SPIRBlock>(continue_block.loop_dominator));
bool positive_test = execution_is_noop(get<SPIRBlock>(continue_block.true_block),
get<SPIRBlock>(continue_block.loop_dominator));
auto statements = emit_continue_block(block.continue_block, positive_test, !positive_test);
if (!statements.empty())