I want to use the Module's symbol table as a repository for named types.
But, it doesn't have a way to get the type out unless you already know
what it is (i.e. the addTypeName() method). Similarly the SymbolTable
class's lookup() method requires a type as well. The Type class also
didn't have anything obvious.
I want something like:
Type* Module::getNamedType( std::string& name );
which returns the type if found or null if not found.
This is too simple to not be implemented so I figured I'm looking in the
wrong places.
What's the RightWay(tm) to get a named type? I want to use the Module's
symbol table as a repository for named types. But, it doesn't have a way
to get the type out unless you already know what it is (i.e. the
addTypeName() method). Similarly the SymbolTable class's lookup() method
requires a type as well. The Type class also didn't have anything
obvious.
Yup, currently you have to directly access the Module's symbol table.
Types have class 'Type::TypeTy', so you would do something like this: