aboutsummaryrefslogtreecommitdiff
path: root/include/clang/AST/CommentSema.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/AST/CommentSema.h')
-rw-r--r--include/clang/AST/CommentSema.h27
1 files changed, 23 insertions, 4 deletions
diff --git a/include/clang/AST/CommentSema.h b/include/clang/AST/CommentSema.h
index be8179d126..f8b35d0c6f 100644
--- a/include/clang/AST/CommentSema.h
+++ b/include/clang/AST/CommentSema.h
@@ -38,8 +38,22 @@ class Sema {
DiagnosticsEngine &Diags;
+ /// Declaration this comment is attached to.
const Decl *ThisDecl;
+ /// Parameters that can be referenced by \\param if \c ThisDecl is something
+ /// that we consider a "function".
+ /// Contains a valid value if \c IsThisDeclInspected is true.
+ ArrayRef<const ParmVarDecl *> ParamVars;
+
+ /// True if we extracted all important information from \c ThisDecl into
+ /// \c Sema members.
+ unsigned IsThisDeclInspected : 1;
+
+ /// Is \c ThisDecl something that we consider a "function".
+ /// Contains a valid value if \c IsThisDeclInspected is true.
+ unsigned IsFunctionDecl : 1;
+
DiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID) {
return Diags.Report(Loc, DiagID);
}
@@ -140,16 +154,21 @@ public:
void checkBlockCommandEmptyParagraph(BlockCommandComment *Command);
+ bool isFunctionDecl();
+ ArrayRef<const ParmVarDecl *> getParamVars();
+
+ /// Extract all important semantic information from \c ThisDecl into
+ /// \c Sema members.
+ void inspectThisDecl();
+
/// Returns index of a function parameter with a given name.
unsigned resolveParmVarReference(StringRef Name,
- const ParmVarDecl * const *ParamVars,
- unsigned NumParams);
+ ArrayRef<const ParmVarDecl *> ParamVars);
/// Returns index of a function parameter with the name closest to a given
/// typo.
unsigned correctTypoInParmVarReference(StringRef Typo,
- const ParmVarDecl * const *ParamVars,
- unsigned NumParams);
+ ArrayRef<const ParmVarDecl *> ParamVars);
bool isBlockCommand(StringRef Name);
bool isParamCommand(StringRef Name);