Skip to content

Commit 376b431

Browse files
committed
Some infra + fixes
1 parent f12febb commit 376b431

8 files changed

Lines changed: 45 additions & 7 deletions

File tree

.clang-format

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
BasedOnStyle: LLVM
3+
IndentWidth: 4
4+
---

.clang-tidy

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
Checks: >
3+
*,
4+
clang-diagnostic-*,
5+
clang-analyzer-*,
6+
-llvmlibc-*,
7+
-modernize-use-trailing-return-type,
8+
-fuchsia-default-arguments-calls,
9+
-google-readability-braces-around-statements,
10+
-hicpp-braces-around-statements,
11+
-altera-unroll-loops,
12+
-altera-struct-pack-align,
13+
-altera-id-dependent-backward-branch,
14+
-cppcoreguidelines-pro-type-vararg,
15+
-hicpp-vararg,
16+
-fuchsia-multiple-inheritance,
17+
-readability-identifier-length
18+
19+
20+
CheckOptions:
21+
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
22+
value: true

.clangd

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CompileFlags:
2+
Add: [-xc++, -Wall, -Wextra, -Wpedantic]
3+
Compiler: clang++
4+
5+
6+
Diagnostics:
7+
UnusedIncludes: Strict
8+
Includes:
9+
MissingIncludes: Strict
10+
11+
Hover:
12+
ShowAKA: Yes

asmjit_assembly/sim.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ int main() {
139139
};
140140

141141
sim::JitAssembly model{};
142-
sim::do_sim(&model, program);
142+
sim::do_sim(model, program);
143143

144144
model.dump(std::cout);
145145
}

inline_assembly/sim.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ int main() {
6969
};
7070

7171
sim::InlineAssemly model{};
72-
sim::do_sim(&model, program);
72+
sim::do_sim(model, program);
7373

7474
model.dump(std::cout);
7575
}

jit_translator/sim.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ int main() {
240240
};
241241

242242
sim::JitTranslator model{};
243-
sim::do_sim(&model, program);
243+
sim::do_sim(model, program);
244244

245245
model.dump(std::cout);
246246
}

lib/hart/include/sim/hart.hh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ struct Hart {
116116
}
117117
};
118118

119-
void do_sim(Hart* hart, const std::vector<uint32_t>& program) {
119+
void do_sim(Hart& hart, const std::vector<uint32_t>& program) {
120120
Time::Timer timer{};
121121
//
122-
hart->load(program);
123-
hart->run();
122+
hart.load(program);
123+
hart.run();
124124
std::cout << "Time elapsed in microseconds "
125125
<< timer.elapsed<std::chrono::microseconds>() << std::endl;
126126
}

naive_interpreter/sim.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ int main() {
2121
};
2222

2323
sim::NaiveInertpreter model{};
24-
sim::do_sim(&model, program);
24+
sim::do_sim(model, program);
2525
model.dump(std::cout);
2626
std::cout << "Icount = " << model.icount << std::endl;
2727
}

0 commit comments

Comments
 (0)