[llvm-dev] Subclassing LLVM Type
陳韋任 via llvm-dev
llvm-dev at lists.llvm.org
Fri Jun 9 13:29:26 PDT 2017
This  might worth reading, Malhar.
2017-06-10 4:12 GMT+08:00 Tim Northover via llvm-dev <
llvm-dev at lists.llvm.org>:
> On 9 June 2017 at 12:03, Jajoo, Malhar via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > Is there some way around this ( without suggesting a change to my entire
> AST ) ?
> LLVM has its own lightweight dynamic casting infrastructure which the
> Type hierarchy already makes use of.
> You have to implement a "classof" function in your DummyType
> definition. That means you'll need a new type ID. Appropriating an
> unused one is slightly dodgy, but probably OK in practice if you're
> After that you'd write "dyn_cast" instead of "dynamic_cast", since
> that's what the LLVM version is called.
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
Wei-Ren Chen (陳韋任)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev