Class TypeHierarchyResolver
- All Implemented Interfaces:
java.util.function.Consumer<TranslationResult>
public class TypeHierarchyResolver extends Pass
RecordDeclaration nodes with their supertypes' records.
Supertypes are all interfaces a class implements and the superclass it inherits from,
including all of their respective supertypes). The JavaParser provides us with initial info about
direct ancestors' names. This pass then recursively maps those and their own supertypes to the
correct RecordDeclaration (if available).
After determining the ancestors of a class, all inherited methods are scanned to find out
which of them are overridden/implemented in the current class. See FunctionDeclaration.getOverriddenBy()
Attention: Needs to be run before other analysis passes, as it triggers a type refresh.
This is needed e.g. for TypeManager.getCommonType(Collection) to be re-evaluated at places
where it is crucial to have parsed all RecordDeclarations. Otherwise, type information in
the graph might not be fully correct
-
Field Summary
-
Constructor Summary
Constructors Constructor Description TypeHierarchyResolver() -
Method Summary
Modifier and Type Method Description voidaccept(TranslationResult translationResult)voidcleanup()LanguageFrontendgetLang()voidsetLang(LanguageFrontend lang)Passes may need information about what source language they are parsing.Methods inherited from class de.fraunhofer.aisec.cpg.passes.Pass
supportsLanguageFrontendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.Consumer
andThen
-
Constructor Details
-
TypeHierarchyResolver
public TypeHierarchyResolver()
-
-
Method Details
-
getLang
-
setLang
Description copied from class:PassPasses may need information about what source language they are parsing. -
accept
-
cleanup
public void cleanup()
-