When you want to comment a large block of code is #if 0 ...#endif, Don’t use /* ... */
Don’t duplicate the function or class name in comment.
install doxygen in linux, then run doxygen -g to produce configure file
Doxyfile. In Doxyfile
GENERATE_LATEX = NO
INPUT = ./src
then run $ doxygen Doxyfile &x#21B2;, A html directory will be built.
Normally, 1) if you have standard tree structure of project, that is to say
every .cpp has .h file. 2) If you want to just expose .h file to client, you
should put comment command in .h file. Because .h file is interface to
customer.
In my llvm project, I just add some function in .cpp file, and I don’t want
add this function definition to .h file. (.h file come from openUH). In order
to make doxygen to parse this .cpp file , you need to put \file in a separate
line in the .cpp file, then doxygen will parse this .cpp file and produce the
html page for this .cpp file.