aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Sema
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema')
-rw-r--r--lib/Sema/SemaExprCXX.cpp8
-rw-r--r--lib/Sema/TreeTransform.h17
2 files changed, 9 insertions, 16 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 3de677e37ba2..3afa95f7d1f2 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -7190,14 +7190,6 @@ public:
ExprResult TransformBlockExpr(BlockExpr *E) { return Owned(E); }
- ExprResult TransformObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
- return Owned(E);
- }
-
- ExprResult TransformObjCIvarRefExpr(ObjCIvarRefExpr *E) {
- return Owned(E);
- }
-
ExprResult Transform(Expr *E) {
ExprResult Res;
while (true) {
diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h
index 4388ad34e21b..f8e65a119c3c 100644
--- a/lib/Sema/TreeTransform.h
+++ b/lib/Sema/TreeTransform.h
@@ -2932,16 +2932,17 @@ public:
ExprResult RebuildObjCIvarRefExpr(Expr *BaseArg, ObjCIvarDecl *Ivar,
SourceLocation IvarLoc,
bool IsArrow, bool IsFreeIvar) {
- // FIXME: We lose track of the IsFreeIvar bit.
CXXScopeSpec SS;
DeclarationNameInfo NameInfo(Ivar->getDeclName(), IvarLoc);
- return getSema().BuildMemberReferenceExpr(BaseArg, BaseArg->getType(),
- /*FIXME:*/IvarLoc, IsArrow,
- SS, SourceLocation(),
- /*FirstQualifierInScope=*/nullptr,
- NameInfo,
- /*TemplateArgs=*/nullptr,
- /*S=*/nullptr);
+ ExprResult Result = getSema().BuildMemberReferenceExpr(
+ BaseArg, BaseArg->getType(),
+ /*FIXME:*/ IvarLoc, IsArrow, SS, SourceLocation(),
+ /*FirstQualifierInScope=*/nullptr, NameInfo,
+ /*TemplateArgs=*/nullptr,
+ /*S=*/nullptr);
+ if (IsFreeIvar && Result.isUsable())
+ cast<ObjCIvarRefExpr>(Result.get())->setIsFreeIvar(IsFreeIvar);
+ return Result;
}
/// \brief Build a new Objective-C property reference expression.