clang-tidy how it process each file

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

clang-tidy how it process each file

Hans Wennborg via cfe-dev

Greetings!

 

I am trying to understand the tidy code flow.

For example A.c file includes various Header files and that Header may be including other heaers…

Can you please elaborate how tidy preprocess each header and source code including nested includes?

Note: I am passing compiler arguments via “$ clang-tidy A.c -- <compiler_args>”.

 

Thanks,

 


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: clang-tidy how it process each file

Hans Wennborg via cfe-dev
[Please reply *only* to the list and do not include my email directly
in the To: or Cc: of your reply; otherwise I will not see your reply.
Thanks.]

In article <[hidden email]>,
    "Oza, Hiral via cfe-dev" <[hidden email]> writes:

> I am trying to understand the tidy code flow.
> For example A.c file includes various Header files and that Header may be
> including other heaers...
> Can you please elaborate how tidy preprocess each header and source code
> including nested includes?
> Note: I am passing compiler arguments via "$ clang-tidy A.c --
> <compiler_args>".

Clang-tidy sees the abstract syntax tree (AST) created by the parser.
The AST is matched by the various checks and then changes are applied
to a list of "fix its".  The "fix its" are then applied to source
files.  By the time the AST is constructed, all header files have been
transitively included by the preprocessing steps.  Everything is
annotated in the AST with it's location in the source files, so the
fixits can be filtered by command-line arguments that say whether or
not a header file (based on a path regex) should be modified by
clang-tidy.
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
            The Terminals Wiki <http://terminals-wiki.org>
     The Computer Graphics Museum <http://ComputerGraphicsMuseum.org>
  Legalize Adulthood! (my blog) <http://LegalizeAdulthood.wordpress.com>
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev