diff options
author | Vlad Serebrennikov <serebrennikov.vladislav@gmail.com> | 2024-07-01 20:53:29 +0300 |
---|---|---|
committer | Vlad Serebrennikov <serebrennikov.vladislav@gmail.com> | 2024-07-01 20:55:57 +0300 |
commit | bae2c54912f8984d4d440f910744caa0b991086c (patch) | |
tree | 292849ef486881cb5539a2429eaae58a01a618c0 /clang/lib/Sema/SemaExprMember.cpp | |
parent | f9efc295089217425d8220af892dcc5ede9eb9f7 (diff) | |
download | llvm-bae2c54912f8984d4d440f910744caa0b991086c.zip llvm-bae2c54912f8984d4d440f910744caa0b991086c.tar.gz llvm-bae2c54912f8984d4d440f910744caa0b991086c.tar.bz2 |
[clang][NFC] Move documentation of `Sema` functions into `Sema.h`
This patch moves documentation of `Sema` functions from `.cpp` files to `Sema.h` when there was no documentation in the latter, or it can be trivially subsumed. More complicated cases when there's less trivial divergence between documentation attached to declaration and the one attached to implementation are left for a later PR that would require review.
It appears that doxygen can find the documentation for a function defined out-of-line even if it's attached to an implementation, and not declaration. But other tools, e.g. clangd, are not as powerful. So this patch significantly improves autocompletion experience for (at least) clangd-based IDEs.
Diffstat (limited to 'clang/lib/Sema/SemaExprMember.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprMember.cpp | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/clang/lib/Sema/SemaExprMember.cpp b/clang/lib/Sema/SemaExprMember.cpp index 3ae1af2..b7ea247 100644 --- a/clang/lib/Sema/SemaExprMember.cpp +++ b/clang/lib/Sema/SemaExprMember.cpp @@ -302,7 +302,6 @@ bool Sema::isPotentialImplicitMemberAccess(const CXXScopeSpec &SS, return isa<FieldDecl, IndirectFieldDecl, MSPropertyDecl>(R.getFoundDecl()); } -/// Builds an expression which might be an implicit member expression. ExprResult Sema::BuildPossibleImplicitMemberExpr( const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, LookupResult &R, const TemplateArgumentListInfo *TemplateArgs, const Scope *S) { @@ -613,18 +612,6 @@ static void DiagnoseQualifiedMemberReference(Sema &SemaRef, << SS.getRange() << rep << BaseType; } -// Check whether the declarations we found through a nested-name -// specifier in a member expression are actually members of the base -// type. The restriction here is: -// -// C++ [expr.ref]p2: -// ... In these cases, the id-expression shall name a -// member of the class or of one of its base classes. -// -// So it's perfectly legitimate for the nested-name specifier to name -// an unrelated class, and for us to find an overload set including -// decls from classes which are not superclasses, as long as the decl -// we actually pick through overload resolution is from a superclass. bool Sema::CheckQualifiedMemberReference(Expr *BaseExpr, QualType BaseType, const CXXScopeSpec &SS, @@ -1276,7 +1263,6 @@ static bool isPointerToRecordType(QualType T) { return false; } -/// Perform conversions on the LHS of a member access expression. ExprResult Sema::PerformMemberExprBaseConversion(Expr *Base, bool IsArrow) { if (IsArrow && !Base->getType()->isFunctionType()) @@ -1757,16 +1743,6 @@ static ExprResult LookupMemberExpr(Sema &S, LookupResult &R, return ExprError(); } -/// The main callback when the parser finds something like -/// expression . [nested-name-specifier] identifier -/// expression -> [nested-name-specifier] identifier -/// where 'identifier' encompasses a fairly broad spectrum of -/// possibilities, including destructor and operator references. -/// -/// \param OpKind either tok::arrow or tok::period -/// \param ObjCImpDecl the current Objective-C \@implementation -/// decl; this is an ugly hack around the fact that Objective-C -/// \@implementations aren't properly put in the context chain ExprResult Sema::ActOnMemberAccessExpr(Scope *S, Expr *Base, SourceLocation OpLoc, tok::TokenKind OpKind, @@ -1928,10 +1904,6 @@ Sema::BuildFieldReferenceExpr(Expr *BaseExpr, bool IsArrow, /*HadMultipleCandidates=*/false, MemberNameInfo, MemberType, VK, OK); } -/// Builds an implicit member access expression. The current context -/// is known to be an instance method, and the given unqualified lookup -/// set is known to contain only instance members, at least one of which -/// is from an appropriate type. ExprResult Sema::BuildImplicitMemberExpr(const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, |