[LLVMdev] LLVM custom dynamic casting mechanism

Joe Groff arcata at gmail.com
Sat Mar 16 07:29:10 PDT 2013

On Saturday, March 16, 2013, Nicola Gigante wrote:

> Hello.
> I'm new to this list (but I've been already following cfe-dev), so hello
> everybody.
> Is there some piece of documentation on how the custom dyn_cast<> work?
> I'm using LLVM as the backend for an experimental compiler and I want to
> make it
> work for my own classes in the front-end (clang also does this afaik).

You provide dyn_cast support by implementing a static 'classof' method in
every class of your hierarchy. This document describes how to implement
LLVM's casting operators in detail:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130316/eee9cbfa/attachment.html>

More information about the llvm-dev mailing list