void HtWalkDesign::walkDecl(HtDecl ** ppHtDecl) { HtDecl * pHtDecl = * ppHtDecl; switch ((*ppHtDecl)->getKind()) { case Decl::CXXMethod: handleCXXMethodDecl(ppHtDecl); if ((*ppHtDecl)->hasBody()) walkStmt((*ppHtDecl)->getPBody()); break; case Decl::Function: handleFunctionDecl(ppHtDecl); if (*ppHtDecl != pHtDecl) break; // check if original node was deleted if ((*ppHtDecl)->hasBody()) walkStmt((*ppHtDecl)->getPBody()); break; case Decl::CXXConstructor: case Decl::CXXDestructor: case Decl::CXXConversion: if ((*ppHtDecl)->hasBody()) walkStmt((*ppHtDecl)->getPBody()); break; case Decl::CXXRecord: { handleCXXRecordDecl(ppHtDecl); // walk members of record HtDecl ** ppHtSubDecl = (*ppHtDecl)->getPFirstSubDecl(); while (*ppHtSubDecl) { HtDecl * pOrigDecl = *ppHtSubDecl; walkDecl(ppHtSubDecl); // stay on current declaration if original was deleted if (*ppHtSubDecl == pOrigDecl) ppHtSubDecl = (*ppHtSubDecl)->getPNextDecl(); } } break; case Decl::Var: case Decl::Typedef: case Decl::Field: case Decl::IndirectField: case Decl::ParmVar: case Decl::ClassTemplate: case Decl::NonTypeTemplateParm: case Decl::TemplateTypeParm: case Decl::AccessSpec: break; default: assert(0); } }
bool WebCLVisitor::VisitFunctionDecl(clang::FunctionDecl *decl) { return handleFunctionDecl(decl); }