24
24
#include < memory>
25
25
#include < utility>
26
26
27
- using AnnotID = ModuleID::ID;
28
- using AnnotT = SExpr<AnnotID>;
29
-
30
27
// Return -1 when no thread can/should be scheduled, or the thread id of the next thread
31
28
// 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
33
30
auto MiriGenMCShim::scheduleNext (const int curr_thread_id,
34
31
const ActionKind curr_thread_next_instr_kind) -> int64_t
35
32
{
36
33
// The current thread is the only one where the `kind` could have changed since we last made
37
34
// a scheduling decision.
38
35
globalInstructions[curr_thread_id].kind = curr_thread_next_instr_kind;
39
36
40
- auto result = GenMCDriver::scheduleNext (globalInstructions);
41
- if (result.has_value ())
42
- {
37
+ if (const auto result = GenMCDriver::scheduleNext (globalInstructions))
43
38
return static_cast <int64_t >(result.value ());
44
- }
45
39
return -1 ;
46
40
}
47
41
@@ -52,8 +46,6 @@ auto MiriGenMCShim::createHandle(const GenmcParams &config)
52
46
-> std::unique_ptr<MiriGenMCShim>
53
47
{
54
48
auto conf = std::make_shared<Config>();
55
- // TODO GENMC: Can we get some default values somehow?
56
- // Config::saveConfigOptions(*conf);
57
49
58
50
// NOTE: Miri already initialization checks, so we can disable them in GenMC
59
51
conf->skipNonAtomicInitializedCheck = true ;
@@ -146,6 +138,7 @@ void MiriGenMCShim::handleExecutionStart()
146
138
{
147
139
globalInstructions.clear ();
148
140
globalInstructions.push_back (Action (ActionKind::Load, Event::getInit ()));
141
+
149
142
GenMCDriver::handleExecutionStart ();
150
143
}
151
144
@@ -253,7 +246,7 @@ auto MiriGenMCShim::handleMalloc(ThreadId thread_id, uint64_t size, uint64_t ali
253
246
{
254
247
auto pos = incPos (thread_id);
255
248
256
- auto sd = StorageDuration::SD_Heap; // TODO GENMC: get from Miri
249
+ auto sd = StorageDuration::SD_Heap; // TODO GENMC: get from Miri
257
250
auto stype = StorageType::ST_Durable; // TODO GENMC
258
251
auto spc = AddressSpace::AS_User; // TODO GENMC
259
252
0 commit comments