[LLVMdev] isa and friends as an alternative to dynamic cast?

Evan Jones ejones at uwaterloo.ca
Thu Apr 21 18:34:14 PDT 2005


I see a bunch of definitions scattered throughout LLVM, and I could not
find good documentation on them. I don't understand why they exist when
LLVM is being compiled with RTTI enabled. It seems to me that:

isa<T>(x) is a substitute for (dynamic_cast<T>(x) != NULL)

and there are some other similar casting tools defined in Casting.h. Why
should I use these instead of C++'s built-in features?

Evan Jones





More information about the llvm-dev mailing list