From: Chris Lattner Date: Sun, 8 Mar 2009 06:56:32 +0000 (+0000) Subject: improve comments for MemberExpr. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ddca44e86281bb7dcf5fdcaf1563434c524e3861;p=clang improve comments for MemberExpr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66371 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h index 48c2ad0cef..02a43c2079 100644 --- a/include/clang/AST/Expr.h +++ b/include/clang/AST/Expr.h @@ -910,13 +910,22 @@ public: StmtClass SC); }; -/// MemberExpr - [C99 6.5.2.3] Structure and Union Members. +/// MemberExpr - [C99 6.5.2.3] Structure and Union Members. X->F and X.F. /// class MemberExpr : public Expr { + /// Base - the expression for the base pointer or structure references. In + /// X.F, this is "X". Stmt *Base; + + /// MemberDecl - This is the decl being referenced by the field/member name. + /// In X.F, this is the decl referenced by F. NamedDecl *MemberDecl; + + /// MemberLoc - This is the location of the member name. SourceLocation MemberLoc; - bool IsArrow; // True if this is "X->F", false if this is "X.F". + + /// IsArrow - True if this is "X->F", false if this is "X.F". + bool IsArrow; public: MemberExpr(Expr *base, bool isarrow, NamedDecl *memberdecl, SourceLocation l, QualType ty) @@ -928,6 +937,9 @@ public: NamedDecl *getMemberDecl() const { return MemberDecl; } void setMemberDecl(NamedDecl *D) { MemberDecl = D; } bool isArrow() const { return IsArrow; } + + /// getMemberLoc - Return the location of the "member", in X->F, it is the + /// location of 'F'. SourceLocation getMemberLoc() const { return MemberLoc; } virtual SourceRange getSourceRange() const {