Open PathogenDavid opened 3 years ago
A prototype of this was added as Biohazrd.Transformation.__TypeReferenceVisitor
as part of https://github.com/InfectedLibraries/Biohazrd/issues/188
It's not 100% there and is missing extensibility points, but it accomplishes the needs of https://github.com/InfectedLibraries/Biohazrd/issues/188 for now.
Reminder for the future since it's kinda burried above:
The main issue is that TypeReferenceVisitor
can't use the same logic for enumerating type references as DeclarationVisitor
does.
I think the better solution is going to be to add a IEnumerateTypeReferences
interface in Biohazrd
which is a parent of both ICustomTranslatedDeclaration
and ICustomTypeReference
.
Right now there's no good way to visit type references. You can make a type transformation, but that's relatively clunky. There should be a subclass of
DeclarationVisitor
which also visits type references.Part of the reason this doesn't exist yet is there's no generalized way to enumerate type references in the first place. They're special-cased in
RawTypeTransformationBase
and that has to be able to handleICustomTranslatedDeclaration
to function properly.This would greatly help with https://github.com/InfectedLibraries/Biohazrd/issues/188 and https://github.com/InfectedLibraries/Biohazrd/issues/55
This might also be a reasonable time to investigate merging
Biohazrd.Transformation
into the mainBiohazrd
assembly. The division makes stuff like this annoying, and I'm not sure if the separate is really all that valuable. (The intent when I did it originally is that someone could in theory use just the core as a library for doing static analysis of a C++ API, but they could just as easily do that while ignoring everything transformation-related.)Alternatively, we could make this part of
Biohazrd.Transformation
, although that'd be slightly odd.