[LLVMdev] Unique shape and types

Chris Lattner sabre at nondot.org
Wed Jun 20 10:09:22 PDT 2007


On Wed, 20 Jun 2007, Nicolas Geoffray wrote:
> In its implementation of types, LLVM only has one instance of a given
> shape, mostly for type equality
> Is this a non-issue for LLVM? Are types just considered as layouts?

LLVM uses a structural type system, which is different than many source 
languages.  This is useful for the optimizer, but is not so useful if you 
want source level names.

> The issue I'm facing is object inheritance and how to find from a LLVM
> type what types it inherits. Currently this can't be implemented in LLVM
> and I need to implement a higher representation for types.

Yep.  Sorry :(.  Depending on your application, you could read debug info, 
which captures all of this.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list