Change clang-format settings

This commit is contained in:
ReinUsesLisp
2019-03-11 03:26:21 -03:00
parent 38838c9a9d
commit 73595f4588
27 changed files with 356 additions and 320 deletions

View File

@@ -4,14 +4,13 @@
* Lesser General Public License version 3 or any later version.
*/
#include <cassert>
#include "op.h"
#include "sirit/sirit.h"
#include <cassert>
namespace Sirit {
Id Module::OpVariable(Id result_type, spv::StorageClass storage_class,
Id initializer) {
Id Module::OpVariable(Id result_type, spv::StorageClass storage_class, Id initializer) {
auto op{std::make_unique<Op>(spv::Op::OpVariable, bound++, result_type)};
op->Add(static_cast<u32>(storage_class));
if (initializer) {
@@ -20,8 +19,7 @@ Id Module::OpVariable(Id result_type, spv::StorageClass storage_class,
return AddCode(std::move(op));
}
Id Module::OpLoad(Id result_type, Id pointer,
std::optional<spv::MemoryAccessMask> memory_access) {
Id Module::OpLoad(Id result_type, Id pointer, std::optional<spv::MemoryAccessMask> memory_access) {
auto op{std::make_unique<Op>(spv::Op::OpLoad, bound++, result_type)};
op->Add(pointer);
if (memory_access) {
@@ -30,8 +28,7 @@ Id Module::OpLoad(Id result_type, Id pointer,
return AddCode(std::move(op));
}
Id Module::OpStore(Id pointer, Id object,
std::optional<spv::MemoryAccessMask> memory_access) {
Id Module::OpStore(Id pointer, Id object, std::optional<spv::MemoryAccessMask> memory_access) {
auto op{std::make_unique<Op>(spv::Op::OpStore)};
op->Add(pointer);
op->Add(object);
@@ -41,8 +38,7 @@ Id Module::OpStore(Id pointer, Id object,
return AddCode(std::move(op));
}
Id Module::OpAccessChain(Id result_type, Id base,
const std::vector<Id>& indexes) {
Id Module::OpAccessChain(Id result_type, Id base, const std::vector<Id>& indexes) {
assert(indexes.size() > 0);
auto op{std::make_unique<Op>(spv::Op::OpAccessChain, bound++, result_type)};
op->Add(base);
@@ -52,18 +48,15 @@ Id Module::OpAccessChain(Id result_type, Id base,
Id Module::OpCompositeInsert(Id result_type, Id object, Id composite,
const std::vector<Literal>& indexes) {
auto op{
std::make_unique<Op>(spv::Op::OpCompositeInsert, bound++, result_type)};
auto op{std::make_unique<Op>(spv::Op::OpCompositeInsert, bound++, result_type)};
op->Add(object);
op->Add(composite);
op->Add(indexes);
return AddCode(std::move(op));
}
Id Module::OpCompositeExtract(Id result_type, Id composite,
const std::vector<Literal>& indexes) {
auto op{std::make_unique<Op>(spv::Op::OpCompositeExtract, bound++,
result_type)};
Id Module::OpCompositeExtract(Id result_type, Id composite, const std::vector<Literal>& indexes) {
auto op{std::make_unique<Op>(spv::Op::OpCompositeExtract, bound++, result_type)};
op->Add(composite);
op->Add(indexes);
return AddCode(std::move(op));
@@ -71,8 +64,7 @@ Id Module::OpCompositeExtract(Id result_type, Id composite,
Id Module::OpCompositeConstruct(Id result_type, const std::vector<Id>& ids) {
assert(ids.size() >= 1);
auto op{std::make_unique<Op>(spv::Op::OpCompositeConstruct, bound++,
result_type)};
auto op{std::make_unique<Op>(spv::Op::OpCompositeConstruct, bound++, result_type)};
op->Add(ids);
return AddCode(std::move(op));
}