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 ;
@@ -145,6 +137,7 @@ void MiriGenMCShim::handleExecutionStart()
145
137
{
146
138
globalInstructions.clear ();
147
139
globalInstructions.push_back (Action (ActionKind::Load, Event::getInit ()));
140
+
148
141
GenMCDriver::handleExecutionStart ();
149
142
}
150
143
0 commit comments