Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/ir/possible-contents.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ class PossibleContents {
// The contents flowing out will be a Global, but of a non-nullable type,
// unlike the original global.
Type type;
// TODO: Consider adding a depth here, or merging this with ConeType in some
// way. In principle, not having depth info can lead to loss of
// precision.
bool operator==(const GlobalInfo& other) const {
return name == other.name && type == other.type;
}
Expand Down Expand Up @@ -305,8 +308,9 @@ class PossibleContents {
// Nothing to add.
} else if (isLiteral()) {
rehash(ret, getLiteral());
} else if (isGlobal()) {
rehash(ret, getGlobal());
} else if (auto* global = std::get_if<GlobalInfo>(&value)) {
rehash(ret, global->name);
rehash(ret, global->type);
} else if (auto* coneType = std::get_if<ConeType>(&value)) {
rehash(ret, coneType->type);
rehash(ret, coneType->depth);
Expand Down