Skip to content

Commit 1cb15b1

Browse files
committed
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
1 parent 70aa319 commit 1cb15b1

File tree

13 files changed

+35
-35
lines changed

13 files changed

+35
-35
lines changed

clang/include/clang/Analysis/AnyCall.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ class AnyCall {
107107

108108
}
109109

110-
/// If {@code E} is a generic call (to ObjC method /function/block/etc),
111-
/// return a constructed {@code AnyCall} object. Return None otherwise.
110+
/// If @c E is a generic call (to ObjC method /function/block/etc),
111+
/// return a constructed @c AnyCall object. Return None otherwise.
112112
static Optional<AnyCall> forExpr(const Expr *E) {
113113
if (const auto *ME = dyn_cast<ObjCMessageExpr>(E)) {
114114
return AnyCall(ME);
@@ -127,8 +127,8 @@ class AnyCall {
127127
}
128128
}
129129

130-
/// If {@code D} is a callable (Objective-C method or a function), return
131-
/// a constructed {@code AnyCall} object. Return None otherwise.
130+
/// If @c D is a callable (Objective-C method or a function), return
131+
/// a constructed @c AnyCall object. Return None otherwise.
132132
// FIXME: block support.
133133
static Optional<AnyCall> forDecl(const Decl *D) {
134134
if (const auto *FD = dyn_cast<FunctionDecl>(D)) {
@@ -186,7 +186,7 @@ class AnyCall {
186186
}
187187

188188
/// \returns Function identifier if it is a named declaration,
189-
/// {@code nullptr} otherwise.
189+
/// @c nullptr otherwise.
190190
const IdentifierInfo *getIdentifier() const {
191191
if (const auto *ND = dyn_cast_or_null<NamedDecl>(D))
192192
return ND->getIdentifier();

clang/include/clang/Analysis/RetainSummaryManager.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -613,8 +613,8 @@ class RetainSummaryManager {
613613
const FunctionType *FT,
614614
bool &AllowAnnotations);
615615

616-
/// Apply the annotation of {@code pd} in function {@code FD}
617-
/// to the resulting summary stored in out-parameter {@code Template}.
616+
/// Apply the annotation of @c pd in function @c FD
617+
/// to the resulting summary stored in out-parameter @c Template.
618618
/// \return whether an annotation was applied.
619619
bool applyParamAnnotationEffect(const ParmVarDecl *pd, unsigned parm_idx,
620620
const NamedDecl *FD,
@@ -715,8 +715,8 @@ class RetainSummaryManager {
715715
/// Set argument types for arguments which are not doing anything.
716716
void updateSummaryForArgumentTypes(const AnyCall &C, const RetainSummary *&RS);
717717

718-
/// Determine whether a declaration {@code D} of correspondent type (return
719-
/// type for functions/methods) {@code QT} has any of the given attributes,
718+
/// Determine whether a declaration @c D of correspondent type (return
719+
/// type for functions/methods) @c QT has any of the given attributes,
720720
/// provided they pass necessary validation checks AND tracking the given
721721
/// attribute is enabled.
722722
/// Returns the object kind corresponding to the present attribute, or None,

clang/lib/Analysis/RetainSummaryManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -881,8 +881,8 @@ RetainSummaryManager::getRetEffectFromAnnotations(QualType RetTy,
881881
return None;
882882
}
883883

884-
/// \return Whether the chain of typedefs starting from {@code QT}
885-
/// has a typedef with a given name {@code Name}.
884+
/// \return Whether the chain of typedefs starting from @c QT
885+
/// has a typedef with a given name @c Name.
886886
static bool hasTypedefNamed(QualType QT,
887887
StringRef Name) {
888888
while (auto *T = dyn_cast<TypedefType>(QT)) {

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,10 @@ appendDiagnostics(const Sema::SemaDiagnosticBuilder &Bldr, T &&ExtraArg,
390390
std::forward<DiagnosticArgs>(ExtraArgs)...);
391391
}
392392

393-
/// Add an attribute {@code AttrType} to declaration {@code D}, provided that
394-
/// {@code PassesCheck} is true.
395-
/// Otherwise, emit diagnostic {@code DiagID}, passing in all parameters
396-
/// specified in {@code ExtraArgs}.
393+
/// Add an attribute @c AttrType to declaration @c D, provided that
394+
/// @c PassesCheck is true.
395+
/// Otherwise, emit diagnostic @c DiagID, passing in all parameters
396+
/// specified in @c ExtraArgs.
397397
template <typename AttrType, typename... DiagnosticArgs>
398398
static void handleSimpleAttributeOrDiagnose(Sema &S, Decl *D,
399399
const AttributeCommonInfo &CI,

clang/lib/StaticAnalyzer/Checkers/NonnullGlobalConstantsChecker.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void NonnullGlobalConstantsChecker::checkLocation(SVal location, bool isLoad,
8989
}
9090

9191
/// \param V loaded lvalue.
92-
/// \return whether {@code val} is a string-like const global.
92+
/// \return whether @c val is a string-like const global.
9393
bool NonnullGlobalConstantsChecker::isGlobalConstString(SVal V) const {
9494
Optional<loc::MemRegionVal> RegionVal = V.getAs<loc::MemRegionVal>();
9595
if (!RegionVal)
@@ -127,7 +127,7 @@ bool NonnullGlobalConstantsChecker::isGlobalConstString(SVal V) const {
127127
return false;
128128
}
129129

130-
/// \return whether {@code type} is extremely unlikely to be null
130+
/// \return whether @c type is extremely unlikely to be null
131131
bool NonnullGlobalConstantsChecker::isNonnullType(QualType Ty) const {
132132

133133
if (Ty->isPointerType() && Ty->getPointeeType()->isCharType())

clang/lib/StaticAnalyzer/Checkers/ObjCAutoreleaseWriteChecker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99
// This file defines ObjCAutoreleaseWriteChecker which warns against writes
1010
// into autoreleased out parameters which cause crashes.
11-
// An example of a problematic write is a write to {@code error} in the example
11+
// An example of a problematic write is a write to @c error in the example
1212
// below:
1313
//
1414
// - (BOOL) mymethod:(NSError *__autoreleasing *)error list:(NSArray*) list {

clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static std::string getPrettyTypeName(QualType QT) {
8989
return QT.getAsString();
9090
}
9191

92-
/// Write information about the type state change to {@code os},
92+
/// Write information about the type state change to @c os,
9393
/// return whether the note should be generated.
9494
static bool shouldGenerateNote(llvm::raw_string_ostream &os,
9595
const RefVal *PrevT,
@@ -164,8 +164,8 @@ static bool shouldGenerateNote(llvm::raw_string_ostream &os,
164164
return true;
165165
}
166166

167-
/// Finds argument index of the out paramter in the call {@code S}
168-
/// corresponding to the symbol {@code Sym}.
167+
/// Finds argument index of the out paramter in the call @c S
168+
/// corresponding to the symbol @c Sym.
169169
/// If none found, returns None.
170170
static Optional<unsigned> findArgIdxOfSymbol(ProgramStateRef CurrSt,
171171
const LocationContext *LCtx,

clang/lib/StaticAnalyzer/Checkers/RunLoopAutoreleaseLeakChecker.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ class RunLoopAutoreleaseLeakChecker : public Checker<check::ASTCodeBody> {
5757

5858
} // end anonymous namespace
5959

60-
/// \return Whether {@code A} occurs before {@code B} in traversal of
61-
/// {@code Parent}.
60+
/// \return Whether @c A occurs before @c B in traversal of
61+
/// @c Parent.
6262
/// Conceptually a very incomplete/unsound approximation of happens-before
6363
/// relationship (A is likely to be evaluated before B),
6464
/// but useful enough in this case.

clang/lib/StaticAnalyzer/Core/BugReporter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2738,8 +2738,8 @@ static void CompactMacroExpandedPieces(PathPieces &path,
27382738
}
27392739

27402740
/// Generate notes from all visitors.
2741-
/// Notes associated with {@code ErrorNode} are generated using
2742-
/// {@code getEndPath}, and the rest are generated with {@code VisitNode}.
2741+
/// Notes associated with @c ErrorNode are generated using
2742+
/// @c getEndPath, and the rest are generated with @c VisitNode.
27432743
static std::unique_ptr<VisitorsDiagnosticsTy>
27442744
generateVisitorsDiagnostics(PathSensitiveBugReport *R,
27452745
const ExplodedNode *ErrorNode,
@@ -2749,7 +2749,7 @@ generateVisitorsDiagnostics(PathSensitiveBugReport *R,
27492749
PathSensitiveBugReport::VisitorList visitors;
27502750

27512751
// Run visitors on all nodes starting from the node *before* the last one.
2752-
// The last node is reserved for notes generated with {@code getEndPath}.
2752+
// The last node is reserved for notes generated with @c getEndPath.
27532753
const ExplodedNode *NextNode = ErrorNode->getFirstPred();
27542754
while (NextNode) {
27552755

clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1846,7 +1846,7 @@ static const MemRegion *getLocationRegionIfReference(const Expr *E,
18461846
return nullptr;
18471847
}
18481848

1849-
/// \return A subexpression of {@code Ex} which represents the
1849+
/// \return A subexpression of @c Ex which represents the
18501850
/// expression-of-interest.
18511851
static const Expr *peelOffOuterExpr(const Expr *Ex,
18521852
const ExplodedNode *N) {

0 commit comments

Comments
 (0)