MacroScanner¶
Note
Generated from the C++ headers by apiary --emit-cpp-docs-json.
-
std::vector<BoundMacro> scan_macros(llvm::StringRef source)¶
Scan raw header source text for documented preprocessor macros.
Captures a macro when a doc comment (
/** ... *///*! ... */or a run of///) is immediately followed by a#define NAME(optionally function-likeNAME(args)).Note
Reads raw source text — all preprocessor branches — so a macro documented inside a compiler-specific
#ifbranch is still found regardless of which branch the current build would take. Macros are not AST declarations, so this is the only way to recover their documentation.Warning
Undocumented
#definedirectives are ignored, mirroring the “document only documented entities” rule for the rest of the docs-mode surface.- Parameters:
source – Raw header source text to scan.
- Returns:
The documented macros recovered from
source.