Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does “\p” in comments means?

Tags:

c++

c

llvm

clang

During reading LLVM source code, I find something different in comments, e.g.

/// If \p DebugLogging is true, we'll log our progress to llvm::dbgs().

What does \p means here?

like image 304
Phantom Avatar asked Jul 02 '26 06:07

Phantom


2 Answers

LLVM uses Doxygen for generating documentation, the /// marker is one of the many ways of creating a special comment block that Doxygen will parse to form documentation.

Within a special comment block, \p is simply one of the mark-up commands, this particular one renders the following word in typewriter font (fixed rather than proportional). The \c option is an alias for the same thing.

like image 89
paxdiablo Avatar answered Jul 04 '26 20:07

paxdiablo


3 slashes is one of the ways that doxygen comments are identified. The \p tag has some meaning, see it's documentation: https://www.doxygen.nl/manual/commands.html#cmdp

Displays the parameter using a typewriter font. You can use this command to refer to member function parameters in the running text.

like image 37
JVApen Avatar answered Jul 04 '26 21:07

JVApen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!