Class TypeHierarchyResolver
- java.lang.Object
-
- de.fraunhofer.aisec.cpg.passes.Pass
-
- de.fraunhofer.aisec.cpg.passes.TypeHierarchyResolver
-
- All Implemented Interfaces:
java.util.function.Consumer<TranslationResult>
public class TypeHierarchyResolver extends Pass
TransitivelyRecordDeclarationnodes 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 allRecordDeclarations. Otherwise, type information in the graph might not be fully correct
-
-
Constructor Summary
Constructors Constructor Description TypeHierarchyResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods 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
supportsLanguageFrontend
-
-
-
-
Method Detail
-
getLang
public LanguageFrontend getLang()
-
setLang
public void setLang(LanguageFrontend lang)
Description copied from class:PassPasses may need information about what source language they are parsing.
-
accept
public void accept(TranslationResult translationResult)
-
-