Skip to content

Commit 2ad069c

Browse files
committed
C++ code cleanup
1 parent b57e96b commit 2ad069c

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

genmc-sys/src_cpp/MiriInterface.cpp

Lines changed: 4 additions & 11 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;
@@ -146,6 +138,7 @@ void MiriGenMCShim::handleExecutionStart()
146138
{
147139
globalInstructions.clear();
148140
globalInstructions.push_back(Action(ActionKind::Load, Event::getInit()));
141+
149142
GenMCDriver::handleExecutionStart();
150143
}
151144

@@ -253,7 +246,7 @@ auto MiriGenMCShim::handleMalloc(ThreadId thread_id, uint64_t size, uint64_t ali
253246
{
254247
auto pos = incPos(thread_id);
255248

256-
auto sd = StorageDuration::SD_Heap; // TODO GENMC: get from Miri
249+
auto sd = StorageDuration::SD_Heap; // TODO GENMC: get from Miri
257250
auto stype = StorageType::ST_Durable; // TODO GENMC
258251
auto spc = AddressSpace::AS_User; // TODO GENMC
259252

0 commit comments

Comments
 (0)