2

While parsing an ASTVisitor in Clang in sample codes, I see there constructs to verify statements eg.

isa<IfStmt>(statement) 
isa<UnaryOperator>(Expression)

Is there a comprehensive list of such constructs which are used to evaluate a current expression/statement.

Thanks

4

1 回答 1

2

First of all, there's nothing magical about isa, that's just LLVM's way of checking whether an object is a subtype of some class; the expression isa<IfStmt>(statement) is basically equivalent to this RTTI-enabled expression:

dynamic_cast<IfStmt*>(statement) != NULL

So your question really boils down to what the AST hierarchy is; and for that, it's best to check these four pages, with complete hierarchy chart:

于 2013-10-02T17:38:33.660 回答