Correct Doxygen syntax for inline code

There is no syntax like {@code ...} in Doxygen, @code is a block command
that ends with @endcode, and generally these are not enclosed in braces.
The correct syntax for inline code snippets is @c <code>.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D98665
This commit is contained in:
Aaron Puchert 2021-03-16 15:17:43 +01:00
parent 70aa319ee7
commit 1cb15b10ea
13 changed files with 35 additions and 35 deletions

View File

@ -107,8 +107,8 @@ public:
} }
/// If {@code E} is a generic call (to ObjC method /function/block/etc), /// If @c E is a generic call (to ObjC method /function/block/etc),
/// return a constructed {@code AnyCall} object. Return None otherwise. /// return a constructed @c AnyCall object. Return None otherwise.
static Optional<AnyCall> forExpr(const Expr *E) { static Optional<AnyCall> forExpr(const Expr *E) {
if (const auto *ME = dyn_cast<ObjCMessageExpr>(E)) { if (const auto *ME = dyn_cast<ObjCMessageExpr>(E)) {
return AnyCall(ME); return AnyCall(ME);
@ -127,8 +127,8 @@ public:
} }
} }
/// If {@code D} is a callable (Objective-C method or a function), return /// If @c D is a callable (Objective-C method or a function), return
/// a constructed {@code AnyCall} object. Return None otherwise. /// a constructed @c AnyCall object. Return None otherwise.
// FIXME: block support. // FIXME: block support.
static Optional<AnyCall> forDecl(const Decl *D) { static Optional<AnyCall> forDecl(const Decl *D) {
if (const auto *FD = dyn_cast<FunctionDecl>(D)) { if (const auto *FD = dyn_cast<FunctionDecl>(D)) {
@ -186,7 +186,7 @@ public:
} }
/// \returns Function identifier if it is a named declaration, /// \returns Function identifier if it is a named declaration,
/// {@code nullptr} otherwise. /// @c nullptr otherwise.
const IdentifierInfo *getIdentifier() const { const IdentifierInfo *getIdentifier() const {
if (const auto *ND = dyn_cast_or_null<NamedDecl>(D)) if (const auto *ND = dyn_cast_or_null<NamedDecl>(D))
return ND->getIdentifier(); return ND->getIdentifier();

View File

@ -613,8 +613,8 @@ class RetainSummaryManager {
const FunctionType *FT, const FunctionType *FT,
bool &AllowAnnotations); bool &AllowAnnotations);
/// Apply the annotation of {@code pd} in function {@code FD} /// Apply the annotation of @c pd in function @c FD
/// to the resulting summary stored in out-parameter {@code Template}. /// to the resulting summary stored in out-parameter @c Template.
/// \return whether an annotation was applied. /// \return whether an annotation was applied.
bool applyParamAnnotationEffect(const ParmVarDecl *pd, unsigned parm_idx, bool applyParamAnnotationEffect(const ParmVarDecl *pd, unsigned parm_idx,
const NamedDecl *FD, const NamedDecl *FD,
@ -715,8 +715,8 @@ private:
/// Set argument types for arguments which are not doing anything. /// Set argument types for arguments which are not doing anything.
void updateSummaryForArgumentTypes(const AnyCall &C, const RetainSummary *&RS); void updateSummaryForArgumentTypes(const AnyCall &C, const RetainSummary *&RS);
/// Determine whether a declaration {@code D} of correspondent type (return /// Determine whether a declaration @c D of correspondent type (return
/// type for functions/methods) {@code QT} has any of the given attributes, /// type for functions/methods) @c QT has any of the given attributes,
/// provided they pass necessary validation checks AND tracking the given /// provided they pass necessary validation checks AND tracking the given
/// attribute is enabled. /// attribute is enabled.
/// Returns the object kind corresponding to the present attribute, or None, /// Returns the object kind corresponding to the present attribute, or None,

View File

@ -881,8 +881,8 @@ RetainSummaryManager::getRetEffectFromAnnotations(QualType RetTy,
return None; return None;
} }
/// \return Whether the chain of typedefs starting from {@code QT} /// \return Whether the chain of typedefs starting from @c QT
/// has a typedef with a given name {@code Name}. /// has a typedef with a given name @c Name.
static bool hasTypedefNamed(QualType QT, static bool hasTypedefNamed(QualType QT,
StringRef Name) { StringRef Name) {
while (auto *T = dyn_cast<TypedefType>(QT)) { while (auto *T = dyn_cast<TypedefType>(QT)) {

View File

@ -390,10 +390,10 @@ appendDiagnostics(const Sema::SemaDiagnosticBuilder &Bldr, T &&ExtraArg,
std::forward<DiagnosticArgs>(ExtraArgs)...); std::forward<DiagnosticArgs>(ExtraArgs)...);
} }
/// Add an attribute {@code AttrType} to declaration {@code D}, provided that /// Add an attribute @c AttrType to declaration @c D, provided that
/// {@code PassesCheck} is true. /// @c PassesCheck is true.
/// Otherwise, emit diagnostic {@code DiagID}, passing in all parameters /// Otherwise, emit diagnostic @c DiagID, passing in all parameters
/// specified in {@code ExtraArgs}. /// specified in @c ExtraArgs.
template <typename AttrType, typename... DiagnosticArgs> template <typename AttrType, typename... DiagnosticArgs>
static void handleSimpleAttributeOrDiagnose(Sema &S, Decl *D, static void handleSimpleAttributeOrDiagnose(Sema &S, Decl *D,
const AttributeCommonInfo &CI, const AttributeCommonInfo &CI,

View File

@ -89,7 +89,7 @@ void NonnullGlobalConstantsChecker::checkLocation(SVal location, bool isLoad,
} }
/// \param V loaded lvalue. /// \param V loaded lvalue.
/// \return whether {@code val} is a string-like const global. /// \return whether @c val is a string-like const global.
bool NonnullGlobalConstantsChecker::isGlobalConstString(SVal V) const { bool NonnullGlobalConstantsChecker::isGlobalConstString(SVal V) const {
Optional<loc::MemRegionVal> RegionVal = V.getAs<loc::MemRegionVal>(); Optional<loc::MemRegionVal> RegionVal = V.getAs<loc::MemRegionVal>();
if (!RegionVal) if (!RegionVal)
@ -127,7 +127,7 @@ bool NonnullGlobalConstantsChecker::isGlobalConstString(SVal V) const {
return false; return false;
} }
/// \return whether {@code type} is extremely unlikely to be null /// \return whether @c type is extremely unlikely to be null
bool NonnullGlobalConstantsChecker::isNonnullType(QualType Ty) const { bool NonnullGlobalConstantsChecker::isNonnullType(QualType Ty) const {
if (Ty->isPointerType() && Ty->getPointeeType()->isCharType()) if (Ty->isPointerType() && Ty->getPointeeType()->isCharType())

View File

@ -8,7 +8,7 @@
// //
// This file defines ObjCAutoreleaseWriteChecker which warns against writes // This file defines ObjCAutoreleaseWriteChecker which warns against writes
// into autoreleased out parameters which cause crashes. // into autoreleased out parameters which cause crashes.
// An example of a problematic write is a write to {@code error} in the example // An example of a problematic write is a write to @c error in the example
// below: // below:
// //
// - (BOOL) mymethod:(NSError *__autoreleasing *)error list:(NSArray*) list { // - (BOOL) mymethod:(NSError *__autoreleasing *)error list:(NSArray*) list {

View File

@ -89,7 +89,7 @@ static std::string getPrettyTypeName(QualType QT) {
return QT.getAsString(); return QT.getAsString();
} }
/// Write information about the type state change to {@code os}, /// Write information about the type state change to @c os,
/// return whether the note should be generated. /// return whether the note should be generated.
static bool shouldGenerateNote(llvm::raw_string_ostream &os, static bool shouldGenerateNote(llvm::raw_string_ostream &os,
const RefVal *PrevT, const RefVal *PrevT,
@ -164,8 +164,8 @@ static bool shouldGenerateNote(llvm::raw_string_ostream &os,
return true; return true;
} }
/// Finds argument index of the out paramter in the call {@code S} /// Finds argument index of the out paramter in the call @c S
/// corresponding to the symbol {@code Sym}. /// corresponding to the symbol @c Sym.
/// If none found, returns None. /// If none found, returns None.
static Optional<unsigned> findArgIdxOfSymbol(ProgramStateRef CurrSt, static Optional<unsigned> findArgIdxOfSymbol(ProgramStateRef CurrSt,
const LocationContext *LCtx, const LocationContext *LCtx,

View File

@ -57,8 +57,8 @@ public:
} // end anonymous namespace } // end anonymous namespace
/// \return Whether {@code A} occurs before {@code B} in traversal of /// \return Whether @c A occurs before @c B in traversal of
/// {@code Parent}. /// @c Parent.
/// Conceptually a very incomplete/unsound approximation of happens-before /// Conceptually a very incomplete/unsound approximation of happens-before
/// relationship (A is likely to be evaluated before B), /// relationship (A is likely to be evaluated before B),
/// but useful enough in this case. /// but useful enough in this case.

View File

@ -2738,8 +2738,8 @@ static void CompactMacroExpandedPieces(PathPieces &path,
} }
/// Generate notes from all visitors. /// Generate notes from all visitors.
/// Notes associated with {@code ErrorNode} are generated using /// Notes associated with @c ErrorNode are generated using
/// {@code getEndPath}, and the rest are generated with {@code VisitNode}. /// @c getEndPath, and the rest are generated with @c VisitNode.
static std::unique_ptr<VisitorsDiagnosticsTy> static std::unique_ptr<VisitorsDiagnosticsTy>
generateVisitorsDiagnostics(PathSensitiveBugReport *R, generateVisitorsDiagnostics(PathSensitiveBugReport *R,
const ExplodedNode *ErrorNode, const ExplodedNode *ErrorNode,
@ -2749,7 +2749,7 @@ generateVisitorsDiagnostics(PathSensitiveBugReport *R,
PathSensitiveBugReport::VisitorList visitors; PathSensitiveBugReport::VisitorList visitors;
// Run visitors on all nodes starting from the node *before* the last one. // Run visitors on all nodes starting from the node *before* the last one.
// The last node is reserved for notes generated with {@code getEndPath}. // The last node is reserved for notes generated with @c getEndPath.
const ExplodedNode *NextNode = ErrorNode->getFirstPred(); const ExplodedNode *NextNode = ErrorNode->getFirstPred();
while (NextNode) { while (NextNode) {

View File

@ -1846,7 +1846,7 @@ static const MemRegion *getLocationRegionIfReference(const Expr *E,
return nullptr; return nullptr;
} }
/// \return A subexpression of {@code Ex} which represents the /// \return A subexpression of @c Ex which represents the
/// expression-of-interest. /// expression-of-interest.
static const Expr *peelOffOuterExpr(const Expr *Ex, static const Expr *peelOffOuterExpr(const Expr *Ex,
const ExplodedNode *N) { const ExplodedNode *N) {

View File

@ -3139,8 +3139,8 @@ struct DOTGraphTraits<ExplodedGraph*> : public DefaultDOTGraphTraits {
/// \p PreCallback: callback before break. /// \p PreCallback: callback before break.
/// \p PostCallback: callback after break. /// \p PostCallback: callback after break.
/// \p Stop: stop iteration if returns {@code true} /// \p Stop: stop iteration if returns @c true
/// \return Whether {@code Stop} ever returned {@code true}. /// \return Whether @c Stop ever returned @c true.
static bool traverseHiddenNodes( static bool traverseHiddenNodes(
const ExplodedNode *N, const ExplodedNode *N,
llvm::function_ref<void(const ExplodedNode *)> PreCallback, llvm::function_ref<void(const ExplodedNode *)> PreCallback,

View File

@ -157,8 +157,8 @@ private:
} // end of anonymous namespace } // end of anonymous namespace
/// Print coverage information to output stream {@code o}. /// Print coverage information to output stream @c o.
/// May modify the used list of files {@code Fids} by inserting new ones. /// May modify the used list of files @c Fids by inserting new ones.
static void printCoverage(const PathDiagnostic *D, static void printCoverage(const PathDiagnostic *D,
unsigned InputIndentLevel, unsigned InputIndentLevel,
SmallVectorImpl<FileID> &Fids, SmallVectorImpl<FileID> &Fids,
@ -484,8 +484,8 @@ void PlistPrinter::ReportPopUp(raw_ostream &o,
// Static function definitions. // Static function definitions.
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Print coverage information to output stream {@code o}. /// Print coverage information to output stream @c o.
/// May modify the used list of files {@code Fids} by inserting new ones. /// May modify the used list of files @c Fids by inserting new ones.
static void printCoverage(const PathDiagnostic *D, static void printCoverage(const PathDiagnostic *D,
unsigned InputIndentLevel, unsigned InputIndentLevel,
SmallVectorImpl<FileID> &Fids, SmallVectorImpl<FileID> &Fids,

View File

@ -318,8 +318,8 @@ raw_ostream &WriteGraph(raw_ostream &O, const GraphType &G,
std::string createGraphFilename(const Twine &Name, int &FD); std::string createGraphFilename(const Twine &Name, int &FD);
/// Writes graph into a provided {@code Filename}. /// Writes graph into a provided @c Filename.
/// If {@code Filename} is empty, generates a random one. /// If @c Filename is empty, generates a random one.
/// \return The resulting filename, or an empty string if writing /// \return The resulting filename, or an empty string if writing
/// failed. /// failed.
template <typename GraphType> template <typename GraphType>