Package de.fraunhofer.aisec.cpg.passes
Class TypeResolver
java.lang.Object
de.fraunhofer.aisec.cpg.passes.Pass
de.fraunhofer.aisec.cpg.passes.TypeResolver
- All Implemented Interfaces:
java.util.function.Consumer<TranslationResult>
public class TypeResolver extends Pass
-
Field Summary
-
Constructor Summary
Constructors Constructor Description TypeResolver() -
Method Summary
Modifier and Type Method Description voidaccept(TranslationResult translationResult)Pass on the TypeSystem: Sets RecordDeclaration Relationship from ObjectType to RecordDeclarationvoidcleanup()voidensureUniqueSecondaryTypeEdge(de.fraunhofer.aisec.cpg.graph.Node node)ensures that the if a nodes contains secondary type edges, those types are also merged and no duplicate is leftjava.util.Set<Type>ensureUniqueSubTypes(java.util.Set<Type> subTypes)voidensureUniqueType(de.fraunhofer.aisec.cpg.graph.Node node)voidhandle(de.fraunhofer.aisec.cpg.graph.Node node)Creates the recordDeclaration relationship between ObjectTypes and RecordDeclaration (from the Type to the Class)TypeobtainType(Type type)Ensures that two different Types that are created at different Points are still the same object in order to only store one node into the databaseMethods inherited from class de.fraunhofer.aisec.cpg.passes.Pass
getLang, setLang, 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
-
TypeResolver
public TypeResolver()
-
-
Method Details
-
obtainType
Ensures that two different Types that are created at different Points are still the same object in order to only store one node into the database- Parameters:
type- newly created Type- Returns:
- If the same type was already stored in the typeState Map the stored one is returned. In the other case the parameter type is stored into the map and the parameter type is returned
-
accept
Pass on the TypeSystem: Sets RecordDeclaration Relationship from ObjectType to RecordDeclaration- Parameters:
translationResult-
-
ensureUniqueSubTypes
-
ensureUniqueType
public void ensureUniqueType(de.fraunhofer.aisec.cpg.graph.Node node) -
ensureUniqueSecondaryTypeEdge
public void ensureUniqueSecondaryTypeEdge(de.fraunhofer.aisec.cpg.graph.Node node)ensures that the if a nodes contains secondary type edges, those types are also merged and no duplicate is left- Parameters:
node- implementingHasType.SecondaryTypeEdge
-
handle
public void handle(de.fraunhofer.aisec.cpg.graph.Node node)Creates the recordDeclaration relationship between ObjectTypes and RecordDeclaration (from the Type to the Class)- Parameters:
node-
-
cleanup
public void cleanup()
-