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-like NAME(args)).

Note

Reads raw source text — all preprocessor branches — so a macro documented inside a compiler-specific #if branch 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 #define directives 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.