Skip to content

Commit fab39e8

Browse files
committed
C++ code cleanup
1 parent 41690eb commit fab39e8

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

genmc-sys/src_cpp/MiriInterface.cpp

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,18 @@
2424
#include <memory>
2525
#include <utility>
2626

27-
using AnnotID = ModuleID::ID;
28-
using AnnotT = SExpr<AnnotID>;
29-
3027
// Return -1 when no thread can/should be scheduled, or the thread id of the next thread
3128
// NOTE: this is safe because ThreadId is 32 bit, and we return a 64 bit integer
32-
// TODO GENMC: could directly return std::optional if CXX ever supports this
29+
// FIXME(genmc,cxx): could directly return std::optional if CXX ever supports this
3330
auto MiriGenMCShim::scheduleNext(const int curr_thread_id,
3431
const ActionKind curr_thread_next_instr_kind) -> int64_t
3532
{
3633
// The current thread is the only one where the `kind` could have changed since we last made
3734
// a scheduling decision.
3835
globalInstructions[curr_thread_id].kind = curr_thread_next_instr_kind;
3936

40-
auto result = GenMCDriver::scheduleNext(globalInstructions);
41-
if (result.has_value())
42-
{
37+
if (const auto result = GenMCDriver::scheduleNext(globalInstructions))
4338
return static_cast<int64_t>(result.value());
44-
}
4539
return -1;
4640
}
4741

@@ -52,8 +46,6 @@ auto MiriGenMCShim::createHandle(const GenmcParams &config)
5246
-> std::unique_ptr<MiriGenMCShim>
5347
{
5448
auto conf = std::make_shared<Config>();
55-
// TODO GENMC: Can we get some default values somehow?
56-
// Config::saveConfigOptions(*conf);
5749

5850
// NOTE: Miri already initialization checks, so we can disable them in GenMC
5951
conf->skipNonAtomicInitializedCheck = true;
@@ -144,13 +136,9 @@ auto createGenmcHandle(const GenmcParams &config)
144136

145137
void MiriGenMCShim::handleExecutionStart()
146138
{
147-
// TODO GENMC: reset completely or just set to init event for each thread?
148139
globalInstructions.clear();
149140
globalInstructions.push_back(Action(ActionKind::Load, Event::getInit()));
150-
// for (auto &action : globalInstructions) {
151-
// action.event.index = 0;
152-
// action.kind = ActionKind::Load;
153-
// }
141+
154142
GenMCDriver::handleExecutionStart();
155143
}
156144

@@ -261,7 +249,7 @@ auto MiriGenMCShim::handleMalloc(ThreadId thread_id, uint64_t size, uint64_t ali
261249
{
262250
auto pos = incPos(thread_id);
263251

264-
auto sd = StorageDuration::SD_Heap; // TODO GENMC: get from Miri
252+
auto sd = StorageDuration::SD_Heap; // TODO GENMC: get from Miri
265253
auto stype = StorageType::ST_Durable; // TODO GENMC
266254
auto spc = AddressSpace::AS_User; // TODO GENMC
267255

0 commit comments

Comments
 (0)