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 ;
@@ -144,13 +136,9 @@ auto createGenmcHandle(const GenmcParams &config)
144
136
145
137
void MiriGenMCShim::handleExecutionStart ()
146
138
{
147
- // TODO GENMC: reset completely or just set to init event for each thread?
148
139
globalInstructions.clear ();
149
140
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
+
154
142
GenMCDriver::handleExecutionStart ();
155
143
}
156
144
@@ -261,7 +249,7 @@ auto MiriGenMCShim::handleMalloc(ThreadId thread_id, uint64_t size, uint64_t ali
261
249
{
262
250
auto pos = incPos (thread_id);
263
251
264
- auto sd = StorageDuration::SD_Heap; // TODO GENMC: get from Miri
252
+ auto sd = StorageDuration::SD_Heap; // TODO GENMC: get from Miri
265
253
auto stype = StorageType::ST_Durable; // TODO GENMC
266
254
auto spc = AddressSpace::AS_User; // TODO GENMC
267
255
0 commit comments