diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp b/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp index db5070180442a2..49e867a63aa92e 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp @@ -472,7 +472,7 @@ void TraceReplay(Trace *trace, TracePart *last, Event *last_pos, Sid sid, for (Event *evp = &part->events[0]; evp < end; evp++) { Event *evp0 = evp; if (!evp->is_access && !evp->is_func) { - switch (evp->GetType()) { + switch (evp->type) { case EventType::kTime: { auto *ev = reinterpret_cast(evp); ev_sid = static_cast(ev->sid); @@ -573,7 +573,7 @@ bool RestoreStack(Tid tid, EventType type, Sid sid, Epoch epoch, uptr addr, [&](Sid ev_sid, Epoch ev_epoch, Event *evp) { bool match = ev_sid == sid && ev_epoch == epoch; if (evp->is_access) { - if (evp->is_func == 0 && evp->GetType() == EventType::kAccessExt && + if (evp->is_func == 0 && evp->type == EventType::kAccessExt && evp->_ == 0) // NopEvent return; auto *ev = reinterpret_cast(evp); @@ -602,7 +602,7 @@ bool RestoreStack(Tid tid, EventType type, Sid sid, Epoch epoch, uptr addr, } return; } - switch (evp->GetType()) { + switch (evp->type) { case EventType::kAccessExt: { auto *ev = reinterpret_cast(evp); uptr ev_addr = RestoreAddr(ev->addr); diff --git a/compiler-rt/lib/tsan/rtl/tsan_trace.h b/compiler-rt/lib/tsan/rtl/tsan_trace.h index b48810aa82a1cf..a771ad9f52fd3c 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_trace.h +++ b/compiler-rt/lib/tsan/rtl/tsan_trace.h @@ -87,17 +87,13 @@ struct Event { // Otherwise type denotes the type. u64 is_access : 1; u64 is_func : 1; - u64 type : 3; + EventType type : 3; u64 _ : 59; - - EventType GetType() const { - return static_cast(type); - } }; static_assert(sizeof(Event) == 8, "bad Event size"); // Nop event used as padding and does not affect state during replay. -static constexpr Event NopEvent = {1, 0, static_cast(EventType::kAccessExt), 0}; +static constexpr Event NopEvent = {1, 0, EventType::kAccessExt, 0}; // Compressed memory access can represent only some events with PCs // close enough to each other. Otherwise we fall back to EventAccessExt.