r307697 - [OPENMP] Skip BuildMemberExpr() in BuildFieldReferenceExpr(), NFC, by Kai Noda
Alexey Bataev via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 11 12:43:28 PDT 2017
Author: abataev
Date: Tue Jul 11 12:43:28 2017
New Revision: 307697
URL: http://llvm.org/viewvc/llvm-project?rev=307697&view=rev
Log:
[OPENMP] Skip BuildMemberExpr() in BuildFieldReferenceExpr(), NFC, by Kai Noda
In the OpenMP mode, we don't need to call BuildMemberExpr() only to discard its
return value. BuildDeclRefExpr() is called instead.
Differential revision: https://reviews.llvm.org/D35201
Modified:
cfe/trunk/lib/Sema/SemaExprMember.cpp
Modified: cfe/trunk/lib/Sema/SemaExprMember.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprMember.cpp?rev=307697&r1=307696&r2=307697&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprMember.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprMember.cpp Tue Jul 11 12:43:28 2017
@@ -1842,10 +1842,6 @@ Sema::BuildFieldReferenceExpr(Expr *Base
FoundDecl, Field);
if (Base.isInvalid())
return ExprError();
- MemberExpr *ME =
- BuildMemberExpr(*this, Context, Base.get(), IsArrow, OpLoc, SS,
- /*TemplateKWLoc=*/SourceLocation(), Field, FoundDecl,
- MemberNameInfo, MemberType, VK, OK);
// Build a reference to a private copy for non-static data members in
// non-static member functions, privatized by OpenMP constructs.
@@ -1855,7 +1851,10 @@ Sema::BuildFieldReferenceExpr(Expr *Base
if (auto *PrivateCopy = IsOpenMPCapturedDecl(Field))
return getOpenMPCapturedExpr(PrivateCopy, VK, OK, OpLoc);
}
- return ME;
+
+ return BuildMemberExpr(*this, Context, Base.get(), IsArrow, OpLoc, SS,
+ /*TemplateKWLoc=*/SourceLocation(), Field, FoundDecl,
+ MemberNameInfo, MemberType, VK, OK);
}
/// Builds an implicit member access expression. The current context
More information about the cfe-commits
mailing list