diff options
Diffstat (limited to 'src/ir')
-rw-r--r-- | src/ir/type-updating.cpp | 3 | ||||
-rw-r--r-- | src/ir/type-updating.h | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/ir/type-updating.cpp b/src/ir/type-updating.cpp index cca0d2360..59b77cca1 100644 --- a/src/ir/type-updating.cpp +++ b/src/ir/type-updating.cpp @@ -115,6 +115,9 @@ GlobalTypeRewriter::TypeMap GlobalTypeRewriter::rebuildTypes() { typeBuilder[i].subTypeOf(*super); } } + + modifyTypeBuilderEntry(typeBuilder, i, type); + i++; } diff --git a/src/ir/type-updating.h b/src/ir/type-updating.h index 31fd77c69..ddeb74b31 100644 --- a/src/ir/type-updating.h +++ b/src/ir/type-updating.h @@ -373,6 +373,14 @@ public: virtual void modifyArray(HeapType oldType, Array& array) {} virtual void modifySignature(HeapType oldType, Signature& sig) {} + // This additional hook is called after modify* and other operations, and + // allows the caller to do things like typeBuilder[i].setOpen(false); + // + // This is provided the builder, the index we are on, and the old heap type + // for that index. + virtual void + modifyTypeBuilderEntry(TypeBuilder& typeBuilder, Index i, HeapType oldType) {} + // Subclasses can override this method to modify supertypes. The new // supertype, if any, must be a supertype (or the same as) the original // supertype. |