mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 20:42:01 +01:00
Implement canonicalization of Value and Element (#3024)
See arena.h for discussion of what canonicalization means in this context. This is primarily intended to support implementing a memo table of template instantiations to resolve #2951, but could be useful for other purposes as well. Additional changes: - Pass `VTable` constructor parameters by pointer, to avoid the need to define `operator==` and `hash_value` for it. - Clean up the recurring pattern of allocating identical `NamedElement`s on the stack and heap. Instead we always allocate it on the heap and pass it by pointer. - Add `Print()` and `Dump()` to `Bindings` as a debugging convenience. --------- Co-authored-by: Jon Ross-Perkins <jperkins@google.com> Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
co-authored by
Jon Ross-Perkins
Richard Smith
parent
2c4fff25a8
commit
c93a0e5e42
@@ -97,7 +97,7 @@ struct NestedValueVisitor {
|
||||
// which is not "within" this value, so we shouldn't visit it.
|
||||
return true;
|
||||
}
|
||||
auto Visit(const VTable&) -> bool { return true; }
|
||||
auto Visit(const VTable*) -> bool { return true; }
|
||||
|
||||
llvm::function_ref<bool(const Value*)> callback;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user