[llvm-dev] Adding new derived types

Russell Wallace via llvm-dev llvm-dev at lists.llvm.org
Tue Oct 20 22:40:50 PDT 2015


I'm working on a program that uses LLVM and also needs to represent types
of terms. It turns out that I'll need to handle all the LLVM types plus
some more e.g. rational numbers and type variables for type inference.

It would be nice if I could use the existing Type class and add a couple of
extra subclasses of it. However, this might be problematic because enum
TypeID is defined within class Type, so there's no way to add new entries
(well, not without going in and editing the LLVM headers, which for obvious
reasons isn't a desirable solution).

What's the recommended solution to this sort of problem? Is there an easy
way around the above that I'm missing?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151021/90908655/attachment.html>


More information about the llvm-dev mailing list