scala-native / scala-native-bindgen

Scala Native Binding Generator

Home Page:https://scala-native.github.io/scala-native-bindgen/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Store types in intermediate representation

kornilova203 opened this issue · comments

typeUsesOtherType function checks if type is used in other type by simply comparing strings.
This approach will fail on more complex types.

It would be better not to convert a type directly to string but to store it in intermediate representations.
There will be a class Type that stores either string (for example native.CInt) or a pointer to other IR instance: Struct, Union or Enum.

Also there will be following subclasses of Type:

  • PointerType
  • ArrayType
  • FunctionPointerType

All above classes will store pointer(s) to other types