[llvm-dev] While loops not being traversed by the RecursiveASTVisitor

Danie Grobbelaar via llvm-dev llvm-dev at lists.llvm.org
Fri Jul 3 21:51:53 PDT 2020


This is my first time emailing this list so I hope I've sent this to the
correct place.
I'm busy developing a tool which uses the libtooling framework as a basis.
It essentially checks whether a given C source file conforms to a
particular style guide.

I've written a class which extends clang::RecursiveASTVisitor. I've also
written a VisitWhileStmt method for the class. When I provide the tool with
a file containing a while (true) {...} loop, the loop and its child nodes
are not traversed by this function. However when this loop is modified to
while (1) {...} the traversal works as expected. Note that the stdbool.h
header file is included in the file being passed to the program and the
while loop appears in the AST dump of the file.

What would be causing this traversal issue?

Thanks in advance,
Danie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200704/ec57d7ed/attachment.html>


More information about the llvm-dev mailing list