[cfe-commits] r80642 - in /cfe/trunk: include/clang/AST/Expr.h include/clang/AST/ExprCXX.h include/clang/AST/StmtNodes.def lib/AST/Expr.cpp lib/AST/StmtPrinter.cpp lib/AST/StmtProfile.cpp lib/Analysis/GRExprEngine.cpp lib/CodeGen/CGExpr.cpp lib/Sema/SemaChecking.cpp lib/Sema/SemaExpr.cpp lib/Sema/TreeTransform.h
Douglas Gregor
dgregor at apple.com
Mon Aug 31 16:41:51 PDT 2009
Author: dgregor
Date: Mon Aug 31 18:41:50 2009
New Revision: 80642
URL: http://llvm.org/viewvc/llvm-project?rev=80642&view=rev
Log:
Eliminate CXXAdornedMemberExpr entirely. Instead, optionally allocate
space within the MemberExpr for the nested-name-specifier and its
source range. We'll do the same thing with explicitly-specified
template arguments, assuming I don't flip-flop again.
Modified:
cfe/trunk/include/clang/AST/Expr.h
cfe/trunk/include/clang/AST/ExprCXX.h
cfe/trunk/include/clang/AST/StmtNodes.def
cfe/trunk/lib/AST/Expr.cpp
cfe/trunk/lib/AST/StmtPrinter.cpp
cfe/trunk/lib/AST/StmtProfile.cpp
cfe/trunk/lib/Analysis/GRExprEngine.cpp
cfe/trunk/lib/CodeGen/CGExpr.cpp
cfe/trunk/lib/Sema/SemaChecking.cpp
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/lib/Sema/TreeTransform.h
Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=80642&r1=80641&r2=80642&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Mon Aug 31 18:41:50 2009
@@ -33,7 +33,6 @@
class BlockDecl;
class CXXOperatorCallExpr;
class CXXMemberCallExpr;
- class CXXAdornedMemberExpr;
/// Expr - This represents one expression. Note that Expr's are subclasses of
/// Stmt. This allows an expression to be transparently used any place a Stmt
@@ -1034,6 +1033,16 @@
virtual child_iterator child_end();
};
+/// \brief Represents the qualifier that may precede a C++ name, e.g., the
+/// "std::" in "std::sort".
+struct NameQualifier {
+ /// \brief The nested name specifier.
+ NestedNameSpecifier *NNS;
+
+ /// \brief The source range covered by the nested name specifier.
+ SourceRange Range;
+};
+
/// MemberExpr - [C99 6.5.2.3] Structure and Union Members. X->F and X.F.
///
class MemberExpr : public Expr {
@@ -1049,25 +1058,48 @@
SourceLocation MemberLoc;
/// IsArrow - True if this is "X->F", false if this is "X.F".
- bool IsArrow;
+ bool IsArrow : 1;
-protected:
- MemberExpr(StmtClass SC, Expr *base, bool isarrow, NamedDecl *memberdecl,
- SourceLocation l, QualType ty)
- : Expr(SC, ty,
- base->isTypeDependent(), base->isValueDependent()),
- Base(base), MemberDecl(memberdecl), MemberLoc(l), IsArrow(isarrow) {}
+ /// \brief True if this member expression used a nested-name-specifier to
+ /// refer to the member, e.g., "x->Base::f".
+ bool HasQualifier : 1;
+
+ /// \brief Retrieve the qualifier that preceded the member name, if any.
+ NameQualifier *getMemberQualifier() {
+ if (!HasQualifier)
+ return 0;
+
+ return reinterpret_cast<NameQualifier *> (this + 1);
+ }
+
+ /// \brief Retrieve the qualifier that preceded the member name, if any.
+ const NameQualifier *getMemberQualifier() const {
+ if (!HasQualifier)
+ return 0;
+
+ return reinterpret_cast<const NameQualifier *> (this + 1);
+ }
+ MemberExpr(Expr *base, bool isarrow, NestedNameSpecifier *qual,
+ SourceRange qualrange, NamedDecl *memberdecl, SourceLocation l,
+ QualType ty);
+
public:
MemberExpr(Expr *base, bool isarrow, NamedDecl *memberdecl, SourceLocation l,
QualType ty)
: Expr(MemberExprClass, ty,
base->isTypeDependent(), base->isValueDependent()),
- Base(base), MemberDecl(memberdecl), MemberLoc(l), IsArrow(isarrow) {}
+ Base(base), MemberDecl(memberdecl), MemberLoc(l), IsArrow(isarrow),
+ HasQualifier(false) {}
/// \brief Build an empty member reference expression.
explicit MemberExpr(EmptyShell Empty) : Expr(MemberExprClass, Empty) { }
+ static MemberExpr *Create(ASTContext &C, Expr *base, bool isarrow,
+ NestedNameSpecifier *qual, SourceRange qualrange,
+ NamedDecl *memberdecl,
+ SourceLocation l, QualType ty);
+
void setBase(Expr *E) { Base = E; }
Expr *getBase() const { return cast<Expr>(Base); }
@@ -1081,7 +1113,27 @@
/// \brief Determines whether this adorned member expression actually had
/// a C++ nested-name-specifier prior to the name of the member, e.g.,
/// x->Base::foo.
- bool hasQualifier() const;
+ bool hasQualifier() const { return HasQualifier; }
+
+ /// \brief If the member name was qualified, retrieves the source range of
+ /// the nested-name-specifier that precedes the member name. Otherwise,
+ /// returns an empty source range.
+ SourceRange getQualifierRange() const {
+ if (!HasQualifier)
+ return SourceRange();
+
+ return getMemberQualifier()->Range;
+ }
+
+ /// \brief If the member name was qualified, retrieves the
+ /// nested-name-specifier that precedes the member name. Otherwise, returns
+ /// NULL.
+ NestedNameSpecifier *getQualifier() const {
+ if (!HasQualifier)
+ return 0;
+
+ return getMemberQualifier()->NNS;
+ }
bool isArrow() const { return IsArrow; }
void setArrow(bool A) { IsArrow = A; }
@@ -1103,11 +1155,9 @@
virtual SourceLocation getExprLoc() const { return MemberLoc; }
static bool classof(const Stmt *T) {
- return T->getStmtClass() == MemberExprClass ||
- T->getStmtClass() == CXXAdornedMemberExprClass;
+ return T->getStmtClass() == MemberExprClass;
}
static bool classof(const MemberExpr *) { return true; }
- static bool classof(const CXXAdornedMemberExpr *) { return true; }
// Iterators
virtual child_iterator child_begin();
Modified: cfe/trunk/include/clang/AST/ExprCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprCXX.h?rev=80642&r1=80641&r2=80642&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ExprCXX.h (original)
+++ cfe/trunk/include/clang/AST/ExprCXX.h Mon Aug 31 18:41:50 2009
@@ -1285,43 +1285,6 @@
virtual child_iterator child_end();
};
-/// \brief Represents a C++ member access expression that was written using
-/// either a qualified name, e.g., "x->Base::f()" or originally had
-/// explicitly-specified template arguments (TODO!).
-class CXXAdornedMemberExpr : public MemberExpr {
- /// QualifierRange - The source range that covers the
- /// nested-name-specifier.
- SourceRange QualifierRange;
-
- /// \brief The nested-name-specifier that qualifies this declaration
- /// name.
- NestedNameSpecifier *Qualifier;
-
-public:
- CXXAdornedMemberExpr(Expr *base, bool isarrow, NestedNameSpecifier *Qual,
- SourceRange QualRange, NamedDecl *memberdecl,
- SourceLocation l, QualType ty)
- : MemberExpr(CXXAdornedMemberExprClass, base, isarrow, memberdecl, l, ty),
- QualifierRange(QualRange), Qualifier(Qual) { }
-
- /// \brief Retrieve the source range of the nested-name-specifier that
- /// qualifies the member name.
- SourceRange getQualifierRange() const { return QualifierRange; }
-
- /// \brief Retrieve the nested-name-specifier that qualifies the
- /// member reference expression.
- NestedNameSpecifier *getQualifier() const { return Qualifier; }
-
- /// \brief Determines whether this adorned C++ member expression has a
- /// nested-name-specifier associated with it.
- bool hasQualifier() const { return getQualifier() != 0; }
-
- static bool classof(const Stmt *T) {
- return T->getStmtClass() == CXXAdornedMemberExprClass;
- }
- static bool classof(const CXXAdornedMemberExpr *) { return true; }
-};
-
/// \brief Represents a C++ member access expression where the actual member
/// referenced could not be resolved, e.g., because the base expression or the
/// member name was dependent.
Modified: cfe/trunk/include/clang/AST/StmtNodes.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtNodes.def?rev=80642&r1=80641&r2=80642&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/StmtNodes.def (original)
+++ cfe/trunk/include/clang/AST/StmtNodes.def Mon Aug 31 18:41:50 2009
@@ -134,7 +134,6 @@
EXPR(CXXExprWithTemporaries , Expr)
EXPR(CXXTemporaryObjectExpr , CXXConstructExpr)
EXPR(CXXUnresolvedConstructExpr, Expr)
-EXPR(CXXAdornedMemberExpr, MemberExpr)
EXPR(CXXUnresolvedMemberExpr, Expr)
// Obj-C Expressions.
Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=80642&r1=80641&r2=80642&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Mon Aug 31 18:41:50 2009
@@ -262,6 +262,36 @@
return FnType->getResultType();
}
+MemberExpr::MemberExpr(Expr *base, bool isarrow, NestedNameSpecifier *qual,
+ SourceRange qualrange, NamedDecl *memberdecl,
+ SourceLocation l, QualType ty)
+ : Expr(MemberExprClass, ty,
+ base->isTypeDependent() || (qual && qual->isDependent()),
+ base->isValueDependent() || (qual && qual->isDependent())),
+ Base(base), MemberDecl(memberdecl), MemberLoc(l), IsArrow(isarrow),
+ HasQualifier(qual != 0) {
+ // Initialize the qualifier, if any.
+ if (HasQualifier) {
+ NameQualifier *NQ = getMemberQualifier();
+ NQ->NNS = qual;
+ NQ->Range = qualrange;
+ }
+}
+
+MemberExpr *MemberExpr::Create(ASTContext &C, Expr *base, bool isarrow,
+ NestedNameSpecifier *qual,
+ SourceRange qualrange,
+ NamedDecl *memberdecl,
+ SourceLocation l, QualType ty) {
+ std::size_t Size = sizeof(MemberExpr);
+ if (qual != 0)
+ Size += sizeof(NameQualifier);
+
+ void *Mem = C.Allocate(Size, llvm::alignof<MemberExpr>());
+ return new (Mem) MemberExpr(base, isarrow, qual, qualrange, memberdecl, l,
+ ty);
+}
+
/// getOpcodeStr - Turn an Opcode enum value into the punctuation char it
/// corresponds to, e.g. "<<=".
const char *BinaryOperator::getOpcodeStr(Opcode Op) {
@@ -498,7 +528,6 @@
}
case MemberExprClass:
- case CXXAdornedMemberExprClass:
// If the base pointer or element is to a volatile pointer/field, accessing
// it is a side effect.
if (getType().isVolatileQualified())
@@ -686,8 +715,7 @@
return LV_Valid;
break;
}
- case MemberExprClass:
- case CXXAdornedMemberExprClass: {
+ case MemberExprClass: {
const MemberExpr *m = cast<MemberExpr>(this);
if (Ctx.getLangOptions().CPlusPlus) { // C++ [expr.ref]p4:
NamedDecl *Member = m->getMemberDecl();
@@ -958,8 +986,7 @@
}
return false;
}
- case MemberExprClass:
- case CXXAdornedMemberExprClass: {
+ case MemberExprClass: {
const MemberExpr *M = cast<MemberExpr>(this);
return M->getBase()->isOBJCGCCandidate(Ctx);
}
@@ -1917,13 +1944,6 @@
Stmt::child_iterator MemberExpr::child_begin() { return &Base; }
Stmt::child_iterator MemberExpr::child_end() { return &Base+1; }
-bool MemberExpr::hasQualifier() const {
- if (const CXXAdornedMemberExpr *A = dyn_cast<CXXAdornedMemberExpr>(this))
- return A->hasQualifier();
-
- return false;
-}
-
// ExtVectorElementExpr
Stmt::child_iterator ExtVectorElementExpr::child_begin() { return &Base; }
Stmt::child_iterator ExtVectorElementExpr::child_end() { return &Base+1; }
Modified: cfe/trunk/lib/AST/StmtPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=80642&r1=80641&r2=80642&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtPrinter.cpp (original)
+++ cfe/trunk/lib/AST/StmtPrinter.cpp Mon Aug 31 18:41:50 2009
@@ -739,6 +739,9 @@
OS << (Node->isArrow() ? "->" : ".");
// FIXME: Suppress printing references to unnamed objects
// representing anonymous unions/structs
+ if (NestedNameSpecifier *Qualifier = Node->getQualifier())
+ Qualifier->print(OS, Policy);
+
OS << Node->getMemberDecl()->getNameAsString();
}
void StmtPrinter::VisitObjCIsaExpr(ObjCIsaExpr *Node) {
@@ -1126,16 +1129,6 @@
OS << ")";
}
-void StmtPrinter::VisitCXXAdornedMemberExpr(CXXAdornedMemberExpr *Node) {
- // FIXME: Suppress printing implicit bases (like "this")
- PrintExpr(Node->getBase());
- OS << (Node->isArrow() ? "->" : ".");
- // FIXME: Suppress printing references to unnamed objects
- // representing anonymous unions/structs
- Node->getQualifier()->print(OS, Policy);
- OS << Node->getMemberDecl()->getNameAsString();
-}
-
void StmtPrinter::VisitCXXUnresolvedMemberExpr(CXXUnresolvedMemberExpr *Node) {
PrintExpr(Node->getBase());
OS << (Node->isArrow() ? "->" : ".");
Modified: cfe/trunk/lib/AST/StmtProfile.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtProfile.cpp?rev=80642&r1=80641&r2=80642&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtProfile.cpp (original)
+++ cfe/trunk/lib/AST/StmtProfile.cpp Mon Aug 31 18:41:50 2009
@@ -272,6 +272,7 @@
void StmtProfiler::VisitMemberExpr(MemberExpr *S) {
VisitExpr(S);
VisitDecl(S->getMemberDecl());
+ VisitNestedNameSpecifier(S->getQualifier());
ID.AddBoolean(S->isArrow());
}
@@ -546,11 +547,6 @@
VisitType(S->getTypeAsWritten());
}
-void StmtProfiler::VisitCXXAdornedMemberExpr(CXXAdornedMemberExpr *S) {
- VisitMemberExpr(S);
- VisitNestedNameSpecifier(S->getQualifier());
-}
-
void StmtProfiler::VisitCXXUnresolvedMemberExpr(CXXUnresolvedMemberExpr *S) {
VisitExpr(S);
ID.AddBoolean(S->isArrow());
Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=80642&r1=80641&r2=80642&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Mon Aug 31 18:41:50 2009
@@ -407,7 +407,6 @@
break;
case Stmt::MemberExprClass:
- case Stmt::CXXAdornedMemberExprClass:
VisitMemberExpr(cast<MemberExpr>(S), Pred, Dst, false);
break;
@@ -514,7 +513,6 @@
return;
case Stmt::MemberExprClass:
- case Stmt::CXXAdornedMemberExprClass:
VisitMemberExpr(cast<MemberExpr>(Ex), Pred, Dst, true);
return;
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=80642&r1=80641&r2=80642&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Mon Aug 31 18:41:50 2009
@@ -241,7 +241,6 @@
case Expr::ExtVectorElementExprClass:
return EmitExtVectorElementExpr(cast<ExtVectorElementExpr>(E));
case Expr::MemberExprClass:
- case Stmt::CXXAdornedMemberExprClass:
return EmitMemberExpr(cast<MemberExpr>(E));
case Expr::CompoundLiteralExprClass:
return EmitCompoundLiteralLValue(cast<CompoundLiteralExpr>(E));
Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=80642&r1=80641&r2=80642&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Mon Aug 31 18:41:50 2009
@@ -1456,8 +1456,7 @@
}
// Accesses to members are potential references to data on the stack.
- case Stmt::MemberExprClass:
- case Stmt::CXXAdornedMemberExprClass: {
+ case Stmt::MemberExprClass: {
MemberExpr *M = cast<MemberExpr>(E);
// Check for indirect access. We only want direct field accesses.
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=80642&r1=80641&r2=80642&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Mon Aug 31 18:41:50 2009
@@ -878,15 +878,14 @@
return false;
}
-/// \brief Build a MemberExpr or CXXAdornedMemberExpr, as appropriate.
+/// \brief Build a MemberExpr AST node.
static MemberExpr *BuildMemberExpr(ASTContext &C, Expr *Base, bool isArrow,
const CXXScopeSpec *SS, NamedDecl *Member,
SourceLocation Loc, QualType Ty) {
if (SS && SS->isSet())
- return new (C) CXXAdornedMemberExpr(Base, isArrow,
- (NestedNameSpecifier *)SS->getScopeRep(),
- SS->getRange(),
- Member, Loc, Ty);
+ return MemberExpr::Create(C, Base, isArrow,
+ (NestedNameSpecifier *)SS->getScopeRep(),
+ SS->getRange(), Member, Loc, Ty);
return new (C) MemberExpr(Base, isArrow, Member, Loc, Ty);
}
@@ -4837,7 +4836,6 @@
case Stmt::QualifiedDeclRefExprClass:
return cast<DeclRefExpr>(E)->getDecl();
case Stmt::MemberExprClass:
- case Stmt::CXXAdornedMemberExprClass:
// If this is an arrow operator, the address is an offset from
// the base's value, so the object the base refers to is
// irrelevant.
Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=80642&r1=80641&r2=80642&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Mon Aug 31 18:41:50 2009
@@ -835,13 +835,23 @@
/// By default, performs semantic analysis to build the new expression.
/// Subclasses may override this routine to provide different behavior.
OwningExprResult RebuildMemberExpr(ExprArg Base, SourceLocation OpLoc,
- bool isArrow, SourceLocation MemberLoc,
+ bool isArrow,
+ NestedNameSpecifier *Qualifier,
+ SourceRange QualifierRange,
+ SourceLocation MemberLoc,
NamedDecl *Member) {
+ CXXScopeSpec SS;
+ if (Qualifier) {
+ SS.setRange(QualifierRange);
+ SS.setScopeRep(Qualifier);
+ }
+
return getSema().BuildMemberReferenceExpr(/*Scope=*/0, move(Base), OpLoc,
isArrow? tok::arrow : tok::period,
MemberLoc,
Member->getDeclName(),
- /*FIXME?*/Sema::DeclPtrTy::make((Decl*)0));
+ /*FIXME?*/Sema::DeclPtrTy::make((Decl*)0),
+ &SS);
}
/// \brief Build a new binary operator expression.
@@ -1421,30 +1431,6 @@
RParenLoc);
}
- /// \brief Build a new qualified member access expression.
- ///
- /// By default, performs semantic analysis to build the new expression.
- /// Subclasses may override this routine to provide different behavior.
- OwningExprResult RebuildCXXAdornedMemberExpr(ExprArg Base,
- SourceLocation OpLoc,
- bool isArrow,
- NestedNameSpecifier *Qualifier,
- SourceRange QualifierRange,
- SourceLocation MemberLoc,
- NamedDecl *Member) {
- CXXScopeSpec SS;
- if (Qualifier) {
- SS.setRange(QualifierRange);
- SS.setScopeRep(Qualifier);
- }
- return getSema().BuildMemberReferenceExpr(/*Scope=*/0, move(Base), OpLoc,
- isArrow? tok::arrow : tok::period,
- MemberLoc,
- Member->getDeclName(),
- /*FIXME?*/Sema::DeclPtrTy::make((Decl*)0),
- &SS);
- }
-
/// \brief Build a new member reference expression.
///
/// By default, performs semantic analysis to build the new expression.
@@ -2973,6 +2959,15 @@
if (Base.isInvalid())
return SemaRef.ExprError();
+ NestedNameSpecifier *Qualifier = 0;
+ if (E->hasQualifier()) {
+ Qualifier
+ = getDerived().TransformNestedNameSpecifier(E->getQualifier(),
+ E->getQualifierRange());
+ if (Qualifier == 0);
+ return SemaRef.ExprError();
+ }
+
NamedDecl *Member
= cast_or_null<NamedDecl>(getDerived().TransformDecl(E->getMemberDecl()));
if (!Member)
@@ -2980,6 +2975,7 @@
if (!getDerived().AlwaysRebuild() &&
Base.get() == E->getBase() &&
+ Qualifier == E->getQualifier() &&
Member == E->getMemberDecl())
return SemaRef.Owned(E->Retain());
@@ -2989,6 +2985,8 @@
return getDerived().RebuildMemberExpr(move(Base), FakeOperatorLoc,
E->isArrow(),
+ Qualifier,
+ E->getQualifierRange(),
E->getMemberLoc(),
Member);
}
@@ -4016,45 +4014,7 @@
FakeCommaLocs.data(),
E->getRParenLoc());
}
-
-template<typename Derived>
-Sema::OwningExprResult
-TreeTransform<Derived>::TransformCXXAdornedMemberExpr(
- CXXAdornedMemberExpr *E) {
- OwningExprResult Base = getDerived().TransformExpr(E->getBase());
- if (Base.isInvalid())
- return SemaRef.ExprError();
-
- NamedDecl *Member
- = cast_or_null<NamedDecl>(getDerived().TransformDecl(E->getMemberDecl()));
- if (!Member)
- return SemaRef.ExprError();
- NestedNameSpecifier *Qualifier
- = getDerived().TransformNestedNameSpecifier(E->getQualifier(),
- E->getQualifierRange());
- if (Qualifier == 0 && E->getQualifier() != 0)
- return SemaRef.ExprError();
-
- if (!getDerived().AlwaysRebuild() &&
- Base.get() == E->getBase() &&
- Member == E->getMemberDecl() &&
- Qualifier == E->getQualifier())
- return SemaRef.Owned(E->Retain());
-
- // FIXME: Bogus source location for the operator
- SourceLocation FakeOperatorLoc
- = SemaRef.PP.getLocForEndOfToken(E->getBase()->getSourceRange().getEnd());
-
- return getDerived().RebuildCXXAdornedMemberExpr(move(Base),
- FakeOperatorLoc,
- E->isArrow(),
- Qualifier,
- E->getQualifierRange(),
- E->getMemberLoc(),
- Member);
-}
-
template<typename Derived>
Sema::OwningExprResult
TreeTransform<Derived>::TransformCXXUnresolvedMemberExpr(
More information about the cfe-commits
mailing list