return;
}
+ // Special case: if `from` is an optional, `to` could be a None. Don't
+ // create a pointer in that case
+ if (from->type()->kind() == TypeKind::OptionalType &&
+ to->type()->kind() == TypeKind::NoneType) {
+ return;
+ }
+
+ // At this point, we should be dealing with two mutable types.
+ AT_ASSERT(shouldAnnotate(from) && shouldAnnotate(to));
+
// If either value is a wildcard, don't insert anything into the graph;
// wildcards are tracked separately since they have different aliasing rules.
if (isWildcard(to) || isWildcard(from)) {
// Register `v` as a wildcard value.
void AliasDb::setWildcard(const Value* v) {
+ if (!shouldAnnotate(v)) {
+ return;
+ }
wildcards_.insert(v);
}