[cfe-dev] Interfering with recursive AST visitation

Kim Gräsman kim.grasman at gmail.com
Wed Nov 13 13:24:23 PST 2013


Hello,

As far as I can tell, the RecursiveASTVisitor does not visit the
details (inputs/outputs) of inline assembly.

Based on my reading of the RAV design, I can coerce it into doing so
with something like:

  bool TraverseAsmStmt(clang::AsmStmt* Stmt) {
    if (!Base::TraverseAsmStmt(Stmt)) return false;

    for (clang::AsmStmt::inputs_iterator I = Stmt->begin_inputs();
         I != Stmt->end_inputs(); ++I) {
      TraverseStmt(*I);
    }

    for (clang::AsmStmt::outputs_iterator I = Stmt->begin_outputs();
         I != Stmt->end_outputs(); ++I) {
      TraverseStmt(*I);
    }

    return true;
  }

It seems to work. Is this the right way to go about it?

Thanks,
- Kim



More information about the cfe-dev mailing list