[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

llvm-svn: 307697
This commit is contained in:
Alexey Bataev 2017-07-11 19:43:28 +00:00
parent 9fd8a6381c
commit d0c03ca5cc
1 changed files with 4 additions and 5 deletions

View File

@ -1842,10 +1842,6 @@ Sema::BuildFieldReferenceExpr(Expr *BaseExpr, bool IsArrow,
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 *BaseExpr, bool IsArrow,
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