Skip to content

Commit

Permalink
run clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
dcbaker committed Oct 16, 2024
1 parent abf0a75 commit 46411c0
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 27 deletions.
16 changes: 8 additions & 8 deletions src/frontend/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ using ExpressionList = std::vector<ExpressionV>;
class Location {
public:
Location(const location & l)
: column_start{l.begin.column}, column_end{l.end.column},
line_start{l.begin.line}, line_end{l.end.line}, filename{*l.begin.filename} {};
: column_start{l.begin.column}, column_end{l.end.column}, line_start{l.begin.line},
line_end{l.end.line}, filename{*l.begin.filename} {};
virtual ~Location() = default;
Location(const Location &) = default;

Expand Down Expand Up @@ -89,8 +89,8 @@ class String {
String(std::string str, const bool & t, const bool & f, const location & l)
: value{std::move(str)}, is_triple{t}, is_fstring{f}, loc{l} {};
String(String && s) noexcept
: value{std::move(s.value)}, is_triple{s.is_triple},
is_fstring{s.is_fstring}, loc{s.loc} {};
: value{std::move(s.value)}, is_triple{s.is_triple}, is_fstring{s.is_fstring},
loc{s.loc} {};
String(const String &) = delete;
~String() = default;

Expand Down Expand Up @@ -488,8 +488,8 @@ class IfStatement {
IfStatement(IfBlock && ib, std::vector<ElifBlock> && ef, ElseBlock && eb)
: ifblock{std::move(ib)}, efblock{std::move(ef)}, eblock{std::move(eb)} {};
IfStatement(IfStatement && i) noexcept
: ifblock{std::move(i.ifblock)}, efblock{std::move(i.efblock)}, eblock{
std::move(i.eblock)} {};
: ifblock{std::move(i.ifblock)}, efblock{std::move(i.efblock)},
eblock{std::move(i.eblock)} {};
IfStatement(const IfStatement &) = delete;
~IfStatement() = default;

Expand All @@ -508,8 +508,8 @@ class ForeachStatement {
std::unique_ptr<CodeBlock> && b)
: id{std::move(i)}, id2{std::move(j)}, expr{std::move(e)}, block{std::move(b)} {};
ForeachStatement(ForeachStatement && f) noexcept
: id{std::move(f.id)}, id2{std::move(f.id2)}, expr{std::move(f.expr)}, block{std::move(
f.block)} {};
: id{std::move(f.id)}, id2{std::move(f.id2)}, expr{std::move(f.expr)},
block{std::move(f.block)} {};
ForeachStatement(const ForeachStatement &) = delete;
~ForeachStatement() = default;

Expand Down
4 changes: 2 additions & 2 deletions src/mir/meson/machines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ template <typename T> class PerMachine {
: _build{std::move(_b)}, _host{std::move(_h)}, _target{std::nullopt} {};
PerMachine(T && _b) : _build{std::move(_b)}, _host{std::nullopt}, _target{std::nullopt} {};
PerMachine(PerMachine<T> && t) noexcept
: _build{std::move(t._build)}, _target{std::move(t._target)}, _host{
std::move(t._target)} {};
: _build{std::move(t._build)}, _target{std::move(t._target)},
_host{std::move(t._target)} {};
~PerMachine() = default;

PerMachine<T> & operator=(PerMachine<T> && t) noexcept {
Expand Down
4 changes: 2 additions & 2 deletions src/mir/meson/toolchains/toolchain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class Toolchain {
std::unique_ptr<Archiver::Archiver> && a)
: compiler{std::move(c)}, linker{std::move(l)}, archiver{std::move(a)} {};
Toolchain(Toolchain && t) noexcept
: compiler{std::move(t.compiler)}, linker{std::move(t.linker)}, archiver{std::move(
t.archiver)} {};
: compiler{std::move(t.compiler)}, linker{std::move(t.linker)},
archiver{std::move(t.archiver)} {};
~Toolchain() = default;

Toolchain & operator=(Toolchain &&) = default;
Expand Down
3 changes: 2 additions & 1 deletion src/mir/passes/print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ Printer::Printer(uint32_t p) : pass{p} {

Printer::~Printer() {
if (out.is_open()) {
out << " }\n" << "}" << std::endl;
out << " }\n"
<< "}" << std::endl;
out.close();
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/mir/passes/threaded.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void find_program(const std::vector<std::string> & names, std::mutex & lock,
// Only schedule one finder for this program
{
std::lock_guard l{lock};
const auto & [ it, inserted ] = programs.insert(name);
const auto & [it, inserted] = programs.insert(name);
if (!inserted) {
continue;
}
Expand All @@ -48,7 +48,8 @@ void find_program(const std::vector<std::string> & names, std::mutex & lock,
auto l = p.find(':');
auto dirname = p.substr(0, std::min(p.length(), l));

p.remove_prefix(dirname.length() + (l != p.npos)); // skip dirname and separator (if there is one)
p.remove_prefix(dirname.length() +
(l != p.npos)); // skip dirname and separator (if there is one)

if (dirname.empty())
continue;
Expand Down
4 changes: 1 addition & 3 deletions tests/dsl/03 static library/lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@

#include <string>

std::string func() {
return "A String";
}
std::string func() { return "A String"; }
4 changes: 1 addition & 3 deletions tests/dsl/04 link static and exe/lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@

#include "lib.hpp"

int func() {
return 5;
}
int func() { return 5; }
4 changes: 1 addition & 3 deletions tests/dsl/04 link static and exe/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@

#include "lib.hpp"

int main() {
return func();
}
int main() { return func(); }
4 changes: 1 addition & 3 deletions tests/dsl/05 include_directories/foo.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include "subdir/foo.hpp"

int func() {
return 0;
}
int func() { return 0; }

0 comments on commit 46411c0

Please sign in to comment.