How do i use TraverseXYZ such as TraverseRecordDecl?

Using this as my input file

struct AA {
int a, b, c;
};
void funcAZ() {}
int main(){
struct AA aa;
int a=1;
}

I am able to print out the functions and the int field a, b, c. However i decided to use TraverseFieldDecl and i stepped through it to see what it did. I’m confused by it

How do i use TraverseFieldDecl to call a function which i can run the code marked with /thisline/ ?

class PrintFunctionsConsumer : public ASTConsumer, public RecursiveASTVisitor {
public:
virtual void HandleTopLevelDecl(DeclGroupRef DG) {
for (DeclGroupRef::iterator i = DG.begin(), e = DG.end(); i != e; ++i) {
Decl *D = *i;
if (const NamedDecl ND = dyn_cast(D)){
llvm::errs() << “top-level-decl: "” << ND->getNameAsString() << “"\n”;
}
//this->TraverseFieldDecl(D);
if (auto ND = dyn_cast_or_null(D)){
/
!!!
/ this->TraverseRecordDecl(ND);
for(auto c = ND->decls_begin(); c!=ND->decls_end(); ++c){
auto v = c;
/thisline/ v=v;
if(const FieldDecl
f = dyn_cast(v)){
//v->getName
llvm::errs() << "field: " << f->getName() << “\n”;
}
}
}
}
}
};