forked from OSchip/llvm-project
tsan: uninline RacyStacks::operator==
It's only used during race reporting. There is no point in polluting the main header file with it. Reviewed By: xgupta Differential Revision: https://reviews.llvm.org/D110470
This commit is contained in:
parent
993f3c61b3
commit
b02938439d
|
@ -274,13 +274,7 @@ class ThreadContext final : public ThreadContextBase {
|
|||
|
||||
struct RacyStacks {
|
||||
MD5Hash hash[2];
|
||||
bool operator==(const RacyStacks &other) const {
|
||||
if (hash[0] == other.hash[0] && hash[1] == other.hash[1])
|
||||
return true;
|
||||
if (hash[0] == other.hash[1] && hash[1] == other.hash[0])
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
bool operator==(const RacyStacks &other) const;
|
||||
};
|
||||
|
||||
struct RacyAddress {
|
||||
|
|
|
@ -670,6 +670,14 @@ bool RestoreStack(Tid tid, EventType type, Sid sid, Epoch epoch, uptr addr,
|
|||
|
||||
} // namespace v3
|
||||
|
||||
bool RacyStacks::operator==(const RacyStacks &other) const {
|
||||
if (hash[0] == other.hash[0] && hash[1] == other.hash[1])
|
||||
return true;
|
||||
if (hash[0] == other.hash[1] && hash[1] == other.hash[0])
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool FindRacyStacks(const RacyStacks &hash) {
|
||||
for (uptr i = 0; i < ctx->racy_stacks.Size(); i++) {
|
||||
if (hash == ctx->racy_stacks[i]) {
|
||||
|
|
Loading…
Reference in New Issue