#define STMT(Node, Parent) \
OwningStmtResult Transform##Node(Node *S);
#define EXPR(Node, Parent) \
- OwningExprResult Transform##Node(Node *E);
+ OwningExprResult Transform##Node(Node *E, bool isAddressOfOperand);
#define ABSTRACT_EXPR(Node, Parent)
#include "clang/AST/StmtNodes.def"
/// Subclasses may override this routine to provide different behavior.
OwningExprResult RebuildDeclRefExpr(NestedNameSpecifier *Qualifier,
SourceRange QualifierRange,
- NamedDecl *ND, SourceLocation Loc) {
+ NamedDecl *ND, SourceLocation Loc,
+ bool isAddressOfOperand) {
CXXScopeSpec SS;
SS.setScopeRep(Qualifier);
SS.setRange(QualifierRange);
return getSema().BuildDeclarationNameExpr(Loc, ND,
/*FIXME:*/false,
&SS,
- /*FIXME:*/false);
+ isAddressOfOperand);
}
/// \brief Build a new expression in parentheses.
case Stmt::NoStmtClass: break;
#define STMT(Node, Parent) case Stmt::Node##Class: break;
#define EXPR(Node, Parent) \
- case Stmt::Node##Class: return getDerived().Transform##Node(cast<Node>(E));
+ case Stmt::Node##Class: return getDerived().Transform##Node(cast<Node>(E), \
+ isAddressOfOperand);
#include "clang/AST/StmtNodes.def"
}
//===----------------------------------------------------------------------===//
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformPredefinedExpr(PredefinedExpr *E) {
+TreeTransform<Derived>::TransformPredefinedExpr(PredefinedExpr *E,
+ bool isAddressOfOperand) {
return SemaRef.Owned(E->Retain());
}
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformDeclRefExpr(DeclRefExpr *E) {
+TreeTransform<Derived>::TransformDeclRefExpr(DeclRefExpr *E,
+ bool isAddressOfOperand) {
NestedNameSpecifier *Qualifier = 0;
if (E->getQualifier()) {
Qualifier = getDerived().TransformNestedNameSpecifier(E->getQualifier(),
// FIXME: Pass the qualifier/qualifier range along.
return getDerived().RebuildDeclRefExpr(Qualifier, E->getQualifierRange(),
- ND, E->getLocation());
+ ND, E->getLocation(),
+ isAddressOfOperand);
}
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformIntegerLiteral(IntegerLiteral *E) {
+TreeTransform<Derived>::TransformIntegerLiteral(IntegerLiteral *E,
+ bool isAddressOfOperand) {
return SemaRef.Owned(E->Retain());
}
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformFloatingLiteral(FloatingLiteral *E) {
+TreeTransform<Derived>::TransformFloatingLiteral(FloatingLiteral *E,
+ bool isAddressOfOperand) {
return SemaRef.Owned(E->Retain());
}
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformImaginaryLiteral(ImaginaryLiteral *E) {
+TreeTransform<Derived>::TransformImaginaryLiteral(ImaginaryLiteral *E,
+ bool isAddressOfOperand) {
return SemaRef.Owned(E->Retain());
}
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformStringLiteral(StringLiteral *E) {
+TreeTransform<Derived>::TransformStringLiteral(StringLiteral *E,
+ bool isAddressOfOperand) {
return SemaRef.Owned(E->Retain());
}
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCharacterLiteral(CharacterLiteral *E) {
+TreeTransform<Derived>::TransformCharacterLiteral(CharacterLiteral *E,
+ bool isAddressOfOperand) {
return SemaRef.Owned(E->Retain());
}
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformParenExpr(ParenExpr *E) {
+TreeTransform<Derived>::TransformParenExpr(ParenExpr *E,
+ bool isAddressOfOperand) {
OwningExprResult SubExpr = getDerived().TransformExpr(E->getSubExpr());
if (SubExpr.isInvalid())
return SemaRef.ExprError();
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformUnaryOperator(UnaryOperator *E) {
- OwningExprResult SubExpr = getDerived().TransformExpr(E->getSubExpr());
+TreeTransform<Derived>::TransformUnaryOperator(UnaryOperator *E,
+ bool isAddressOfOperand) {
+ OwningExprResult SubExpr = getDerived().TransformExpr(E->getSubExpr(),
+ E->getOpcode() == UnaryOperator::AddrOf);
if (SubExpr.isInvalid())
return SemaRef.ExprError();
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformSizeOfAlignOfExpr(SizeOfAlignOfExpr *E) {
+TreeTransform<Derived>::TransformSizeOfAlignOfExpr(SizeOfAlignOfExpr *E,
+ bool isAddressOfOperand) {
if (E->isArgumentType()) {
TemporaryBase Rebase(*this, E->getOperatorLoc(), DeclarationName());
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformArraySubscriptExpr(ArraySubscriptExpr *E) {
+TreeTransform<Derived>::TransformArraySubscriptExpr(ArraySubscriptExpr *E,
+ bool isAddressOfOperand) {
OwningExprResult LHS = getDerived().TransformExpr(E->getLHS());
if (LHS.isInvalid())
return SemaRef.ExprError();
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCallExpr(CallExpr *E) {
+TreeTransform<Derived>::TransformCallExpr(CallExpr *E,
+ bool isAddressOfOperand) {
// Transform the callee.
OwningExprResult Callee = getDerived().TransformExpr(E->getCallee());
if (Callee.isInvalid())
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformMemberExpr(MemberExpr *E) {
+TreeTransform<Derived>::TransformMemberExpr(MemberExpr *E,
+ bool isAddressOfOperand) {
OwningExprResult Base = getDerived().TransformExpr(E->getBase());
if (Base.isInvalid())
return SemaRef.ExprError();
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCastExpr(CastExpr *E) {
+TreeTransform<Derived>::TransformCastExpr(CastExpr *E,
+ bool isAddressOfOperand) {
assert(false && "Cannot transform abstract class");
return SemaRef.Owned(E->Retain());
}
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformBinaryOperator(BinaryOperator *E) {
+TreeTransform<Derived>::TransformBinaryOperator(BinaryOperator *E,
+ bool isAddressOfOperand) {
OwningExprResult LHS = getDerived().TransformExpr(E->getLHS());
if (LHS.isInvalid())
return SemaRef.ExprError();
template<typename Derived>
Sema::OwningExprResult
TreeTransform<Derived>::TransformCompoundAssignOperator(
- CompoundAssignOperator *E) {
- return getDerived().TransformBinaryOperator(E);
+ CompoundAssignOperator *E,
+ bool isAddressOfOperand) {
+ return getDerived().TransformBinaryOperator(E, isAddressOfOperand);
}
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformConditionalOperator(ConditionalOperator *E) {
+TreeTransform<Derived>::TransformConditionalOperator(ConditionalOperator *E,
+ bool isAddressOfOperand) {
OwningExprResult Cond = getDerived().TransformExpr(E->getCond());
if (Cond.isInvalid())
return SemaRef.ExprError();
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformImplicitCastExpr(ImplicitCastExpr *E) {
+TreeTransform<Derived>::TransformImplicitCastExpr(ImplicitCastExpr *E,
+ bool isAddressOfOperand) {
TemporaryBase Rebase(*this, E->getLocStart(), DeclarationName());
// FIXME: Will we ever have type information here? It seems like we won't,
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformExplicitCastExpr(ExplicitCastExpr *E) {
+TreeTransform<Derived>::TransformExplicitCastExpr(ExplicitCastExpr *E,
+ bool isAddressOfOperand) {
assert(false && "Cannot transform abstract class");
return SemaRef.Owned(E->Retain());
}
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCStyleCastExpr(CStyleCastExpr *E) {
+TreeTransform<Derived>::TransformCStyleCastExpr(CStyleCastExpr *E,
+ bool isAddressOfOperand) {
QualType T;
{
// FIXME: Source location isn't quite accurate.
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCompoundLiteralExpr(CompoundLiteralExpr *E) {
+TreeTransform<Derived>::TransformCompoundLiteralExpr(CompoundLiteralExpr *E,
+ bool isAddressOfOperand) {
QualType T;
{
// FIXME: Source location isn't quite accurate.
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformExtVectorElementExpr(ExtVectorElementExpr *E) {
+TreeTransform<Derived>::TransformExtVectorElementExpr(ExtVectorElementExpr *E,
+ bool isAddressOfOperand) {
OwningExprResult Base = getDerived().TransformExpr(E->getBase());
if (Base.isInvalid())
return SemaRef.ExprError();
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformInitListExpr(InitListExpr *E) {
+TreeTransform<Derived>::TransformInitListExpr(InitListExpr *E,
+ bool isAddressOfOperand) {
bool InitChanged = false;
ASTOwningVector<&ActionBase::DeleteExpr, 4> Inits(SemaRef);
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformDesignatedInitExpr(DesignatedInitExpr *E) {
+TreeTransform<Derived>::TransformDesignatedInitExpr(DesignatedInitExpr *E,
+ bool isAddressOfOperand) {
Designation Desig;
// transform the initializer value
template<typename Derived>
Sema::OwningExprResult
TreeTransform<Derived>::TransformImplicitValueInitExpr(
- ImplicitValueInitExpr *E) {
+ ImplicitValueInitExpr *E,
+ bool isAddressOfOperand) {
TemporaryBase Rebase(*this, E->getLocStart(), DeclarationName());
// FIXME: Will we ever have proper type location here? Will we actually
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformVAArgExpr(VAArgExpr *E) {
+TreeTransform<Derived>::TransformVAArgExpr(VAArgExpr *E,
+ bool isAddressOfOperand) {
// FIXME: Do we want the type as written?
QualType T;
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformParenListExpr(ParenListExpr *E) {
+TreeTransform<Derived>::TransformParenListExpr(ParenListExpr *E,
+ bool isAddressOfOperand) {
bool ArgumentChanged = false;
ASTOwningVector<&ActionBase::DeleteExpr, 4> Inits(SemaRef);
for (unsigned I = 0, N = E->getNumExprs(); I != N; ++I) {
/// the corresponding label statement by semantic analysis.
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformAddrLabelExpr(AddrLabelExpr *E) {
+TreeTransform<Derived>::TransformAddrLabelExpr(AddrLabelExpr *E,
+ bool isAddressOfOperand) {
return getDerived().RebuildAddrLabelExpr(E->getAmpAmpLoc(), E->getLabelLoc(),
E->getLabel());
}
template<typename Derived>
-Sema::OwningExprResult TreeTransform<Derived>::TransformStmtExpr(StmtExpr *E) {
+Sema::OwningExprResult
+TreeTransform<Derived>::TransformStmtExpr(StmtExpr *E,
+ bool isAddressOfOperand) {
OwningStmtResult SubStmt
= getDerived().TransformCompoundStmt(E->getSubStmt(), true);
if (SubStmt.isInvalid())
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformTypesCompatibleExpr(TypesCompatibleExpr *E) {
+TreeTransform<Derived>::TransformTypesCompatibleExpr(TypesCompatibleExpr *E,
+ bool isAddressOfOperand) {
QualType T1, T2;
{
// FIXME: Source location isn't quite accurate.
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformChooseExpr(ChooseExpr *E) {
+TreeTransform<Derived>::TransformChooseExpr(ChooseExpr *E,
+ bool isAddressOfOperand) {
OwningExprResult Cond = getDerived().TransformExpr(E->getCond());
if (Cond.isInvalid())
return SemaRef.ExprError();
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformGNUNullExpr(GNUNullExpr *E) {
+TreeTransform<Derived>::TransformGNUNullExpr(GNUNullExpr *E,
+ bool isAddressOfOperand) {
return SemaRef.Owned(E->Retain());
}
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
+TreeTransform<Derived>::TransformCXXOperatorCallExpr(CXXOperatorCallExpr *E,
+ bool isAddressOfOperand) {
OwningExprResult Callee = getDerived().TransformExpr(E->getCallee());
if (Callee.isInvalid())
return SemaRef.ExprError();
- OwningExprResult First = getDerived().TransformExpr(E->getArg(0));
+ OwningExprResult First
+ = getDerived().TransformExpr(E->getArg(0),
+ E->getNumArgs() == 1 && E->getOperator() == OO_Amp);
if (First.isInvalid())
return SemaRef.ExprError();
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCXXMemberCallExpr(CXXMemberCallExpr *E) {
- return getDerived().TransformCallExpr(E);
+TreeTransform<Derived>::TransformCXXMemberCallExpr(CXXMemberCallExpr *E,
+ bool isAddressOfOperand) {
+ return getDerived().TransformCallExpr(E, isAddressOfOperand);
}
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCXXNamedCastExpr(CXXNamedCastExpr *E) {
+TreeTransform<Derived>::TransformCXXNamedCastExpr(CXXNamedCastExpr *E,
+ bool isAddressOfOperand) {
QualType ExplicitTy;
{
// FIXME: Source location isn't quite accurate.
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCXXStaticCastExpr(CXXStaticCastExpr *E) {
- return getDerived().TransformCXXNamedCastExpr(E);
+TreeTransform<Derived>::TransformCXXStaticCastExpr(CXXStaticCastExpr *E,
+ bool isAddressOfOperand) {
+ return getDerived().TransformCXXNamedCastExpr(E, isAddressOfOperand);
}
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCXXDynamicCastExpr(CXXDynamicCastExpr *E) {
- return getDerived().TransformCXXNamedCastExpr(E);
+TreeTransform<Derived>::TransformCXXDynamicCastExpr(CXXDynamicCastExpr *E,
+ bool isAddressOfOperand) {
+ return getDerived().TransformCXXNamedCastExpr(E, isAddressOfOperand);
}
template<typename Derived>
Sema::OwningExprResult
TreeTransform<Derived>::TransformCXXReinterpretCastExpr(
- CXXReinterpretCastExpr *E) {
- return getDerived().TransformCXXNamedCastExpr(E);
+ CXXReinterpretCastExpr *E,
+ bool isAddressOfOperand) {
+ return getDerived().TransformCXXNamedCastExpr(E, isAddressOfOperand);
}
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCXXConstCastExpr(CXXConstCastExpr *E) {
- return getDerived().TransformCXXNamedCastExpr(E);
+TreeTransform<Derived>::TransformCXXConstCastExpr(CXXConstCastExpr *E,
+ bool isAddressOfOperand) {
+ return getDerived().TransformCXXNamedCastExpr(E, isAddressOfOperand);
}
template<typename Derived>
Sema::OwningExprResult
TreeTransform<Derived>::TransformCXXFunctionalCastExpr(
- CXXFunctionalCastExpr *E) {
+ CXXFunctionalCastExpr *E,
+ bool isAddressOfOperand) {
QualType ExplicitTy;
{
TemporaryBase Rebase(*this, E->getTypeBeginLoc(), DeclarationName());
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCXXTypeidExpr(CXXTypeidExpr *E) {
+TreeTransform<Derived>::TransformCXXTypeidExpr(CXXTypeidExpr *E,
+ bool isAddressOfOperand) {
if (E->isTypeOperand()) {
TemporaryBase Rebase(*this, /*FIXME*/E->getLocStart(), DeclarationName());
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCXXBoolLiteralExpr(CXXBoolLiteralExpr *E) {
+TreeTransform<Derived>::TransformCXXBoolLiteralExpr(CXXBoolLiteralExpr *E,
+ bool isAddressOfOperand) {
return SemaRef.Owned(E->Retain());
}
template<typename Derived>
Sema::OwningExprResult
TreeTransform<Derived>::TransformCXXNullPtrLiteralExpr(
- CXXNullPtrLiteralExpr *E) {
+ CXXNullPtrLiteralExpr *E,
+ bool isAddressOfOperand) {
return SemaRef.Owned(E->Retain());
}
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCXXThisExpr(CXXThisExpr *E) {
+TreeTransform<Derived>::TransformCXXThisExpr(CXXThisExpr *E,
+ bool isAddressOfOperand) {
TemporaryBase Rebase(*this, E->getLocStart(), DeclarationName());
QualType T = getDerived().TransformType(E->getType());
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCXXThrowExpr(CXXThrowExpr *E) {
+TreeTransform<Derived>::TransformCXXThrowExpr(CXXThrowExpr *E,
+ bool isAddressOfOperand) {
OwningExprResult SubExpr = getDerived().TransformExpr(E->getSubExpr());
if (SubExpr.isInvalid())
return SemaRef.ExprError();
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
+TreeTransform<Derived>::TransformCXXDefaultArgExpr(CXXDefaultArgExpr *E,
+ bool isAddressOfOperand) {
ParmVarDecl *Param
= cast_or_null<ParmVarDecl>(getDerived().TransformDecl(E->getParam()));
if (!Param)
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCXXZeroInitValueExpr(CXXZeroInitValueExpr *E) {
+TreeTransform<Derived>::TransformCXXZeroInitValueExpr(CXXZeroInitValueExpr *E,
+ bool isAddressOfOperand) {
TemporaryBase Rebase(*this, E->getTypeBeginLoc(), DeclarationName());
QualType T = getDerived().TransformType(E->getType());
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCXXConditionDeclExpr(CXXConditionDeclExpr *E) {
+TreeTransform<Derived>::TransformCXXConditionDeclExpr(CXXConditionDeclExpr *E,
+ bool isAddressOfOperand) {
VarDecl *Var
= cast_or_null<VarDecl>(getDerived().TransformDefinition(E->getVarDecl()));
if (!Var)
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCXXNewExpr(CXXNewExpr *E) {
+TreeTransform<Derived>::TransformCXXNewExpr(CXXNewExpr *E,
+ bool isAddressOfOperand) {
// Transform the type that we're allocating
TemporaryBase Rebase(*this, E->getLocStart(), DeclarationName());
QualType AllocType = getDerived().TransformType(E->getAllocatedType());
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCXXDeleteExpr(CXXDeleteExpr *E) {
+TreeTransform<Derived>::TransformCXXDeleteExpr(CXXDeleteExpr *E,
+ bool isAddressOfOperand) {
OwningExprResult Operand = getDerived().TransformExpr(E->getArgument());
if (Operand.isInvalid())
return SemaRef.ExprError();
template<typename Derived>
Sema::OwningExprResult
TreeTransform<Derived>::TransformCXXPseudoDestructorExpr(
- CXXPseudoDestructorExpr *E) {
+ CXXPseudoDestructorExpr *E,
+ bool isAddressOfOperand) {
OwningExprResult Base = getDerived().TransformExpr(E->getBase());
if (Base.isInvalid())
return SemaRef.ExprError();
template<typename Derived>
Sema::OwningExprResult
TreeTransform<Derived>::TransformUnresolvedFunctionNameExpr(
- UnresolvedFunctionNameExpr *E) {
+ UnresolvedFunctionNameExpr *E,
+ bool isAddressOfOperand) {
// There is no transformation we can apply to an unresolved function name.
return SemaRef.Owned(E->Retain());
}
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformUnaryTypeTraitExpr(UnaryTypeTraitExpr *E) {
+TreeTransform<Derived>::TransformUnaryTypeTraitExpr(UnaryTypeTraitExpr *E,
+ bool isAddressOfOperand) {
TemporaryBase Rebase(*this, /*FIXME*/E->getLocStart(), DeclarationName());
QualType T = getDerived().TransformType(E->getQueriedType());
template<typename Derived>
Sema::OwningExprResult
TreeTransform<Derived>::TransformUnresolvedDeclRefExpr(
- UnresolvedDeclRefExpr *E) {
+ UnresolvedDeclRefExpr *E,
+ bool isAddressOfOperand) {
NestedNameSpecifier *NNS
= getDerived().TransformNestedNameSpecifier(E->getQualifier(),
E->getQualifierRange());
E->getQualifierRange(),
Name,
E->getLocation(),
- /*FIXME:*/false);
+ isAddressOfOperand);
}
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformTemplateIdRefExpr(TemplateIdRefExpr *E) {
+TreeTransform<Derived>::TransformTemplateIdRefExpr(TemplateIdRefExpr *E,
+ bool isAddressOfOperand) {
TemporaryBase Rebase(*this, E->getTemplateNameLoc(), DeclarationName());
TemplateName Template
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCXXConstructExpr(CXXConstructExpr *E) {
+TreeTransform<Derived>::TransformCXXConstructExpr(CXXConstructExpr *E,
+ bool isAddressOfOperand) {
TemporaryBase Rebase(*this, /*FIXME*/E->getLocStart(), DeclarationName());
QualType T = getDerived().TransformType(E->getType());
/// must be unique.
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
+TreeTransform<Derived>::TransformCXXBindTemporaryExpr(CXXBindTemporaryExpr *E,
+ bool isAddressOfOperand) {
OwningExprResult SubExpr = getDerived().TransformExpr(E->getSubExpr());
if (SubExpr.isInvalid())
return SemaRef.ExprError();
template<typename Derived>
Sema::OwningExprResult
TreeTransform<Derived>::TransformCXXExprWithTemporaries(
- CXXExprWithTemporaries *E) {
+ CXXExprWithTemporaries *E,
+ bool isAddressOfOperand) {
OwningExprResult SubExpr = getDerived().TransformExpr(E->getSubExpr());
if (SubExpr.isInvalid())
return SemaRef.ExprError();
template<typename Derived>
Sema::OwningExprResult
TreeTransform<Derived>::TransformCXXTemporaryObjectExpr(
- CXXTemporaryObjectExpr *E) {
+ CXXTemporaryObjectExpr *E,
+ bool isAddressOfOperand) {
TemporaryBase Rebase(*this, E->getTypeBeginLoc(), DeclarationName());
QualType T = getDerived().TransformType(E->getType());
if (T.isNull())
template<typename Derived>
Sema::OwningExprResult
TreeTransform<Derived>::TransformCXXUnresolvedConstructExpr(
- CXXUnresolvedConstructExpr *E) {
+ CXXUnresolvedConstructExpr *E,
+ bool isAddressOfOperand) {
TemporaryBase Rebase(*this, E->getTypeBeginLoc(), DeclarationName());
QualType T = getDerived().TransformType(E->getTypeAsWritten());
if (T.isNull())
template<typename Derived>
Sema::OwningExprResult
TreeTransform<Derived>::TransformCXXUnresolvedMemberExpr(
- CXXUnresolvedMemberExpr *E) {
+ CXXUnresolvedMemberExpr *E,
+ bool isAddressOfOperand) {
// Transform the base of the expression.
OwningExprResult Base = getDerived().TransformExpr(E->getBase());
if (Base.isInvalid())
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformObjCStringLiteral(ObjCStringLiteral *E) {
+TreeTransform<Derived>::TransformObjCStringLiteral(ObjCStringLiteral *E,
+ bool isAddressOfOperand) {
return SemaRef.Owned(E->Retain());
}
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformObjCEncodeExpr(ObjCEncodeExpr *E) {
+TreeTransform<Derived>::TransformObjCEncodeExpr(ObjCEncodeExpr *E,
+ bool isAddressOfOperand) {
// FIXME: poor source location
TemporaryBase Rebase(*this, E->getAtLoc(), DeclarationName());
QualType EncodedType = getDerived().TransformType(E->getEncodedType());
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformObjCMessageExpr(ObjCMessageExpr *E) {
+TreeTransform<Derived>::TransformObjCMessageExpr(ObjCMessageExpr *E,
+ bool isAddressOfOperand) {
// FIXME: Implement this!
assert(false && "Cannot transform Objective-C expressions yet");
return SemaRef.Owned(E->Retain());
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformObjCSelectorExpr(ObjCSelectorExpr *E) {
+TreeTransform<Derived>::TransformObjCSelectorExpr(ObjCSelectorExpr *E,
+ bool isAddressOfOperand) {
return SemaRef.Owned(E->Retain());
}
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformObjCProtocolExpr(ObjCProtocolExpr *E) {
+TreeTransform<Derived>::TransformObjCProtocolExpr(ObjCProtocolExpr *E,
+ bool isAddressOfOperand) {
ObjCProtocolDecl *Protocol
= cast_or_null<ObjCProtocolDecl>(
getDerived().TransformDecl(E->getProtocol()));
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformObjCIvarRefExpr(ObjCIvarRefExpr *E) {
+TreeTransform<Derived>::TransformObjCIvarRefExpr(ObjCIvarRefExpr *E,
+ bool isAddressOfOperand) {
// FIXME: Implement this!
assert(false && "Cannot transform Objective-C expressions yet");
return SemaRef.Owned(E->Retain());
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
+TreeTransform<Derived>::TransformObjCPropertyRefExpr(ObjCPropertyRefExpr *E,
+ bool isAddressOfOperand) {
// FIXME: Implement this!
assert(false && "Cannot transform Objective-C expressions yet");
return SemaRef.Owned(E->Retain());
template<typename Derived>
Sema::OwningExprResult
TreeTransform<Derived>::TransformObjCImplicitSetterGetterRefExpr(
- ObjCImplicitSetterGetterRefExpr *E) {
+ ObjCImplicitSetterGetterRefExpr *E,
+ bool isAddressOfOperand) {
// FIXME: Implement this!
assert(false && "Cannot transform Objective-C expressions yet");
return SemaRef.Owned(E->Retain());
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformObjCSuperExpr(ObjCSuperExpr *E) {
+TreeTransform<Derived>::TransformObjCSuperExpr(ObjCSuperExpr *E,
+ bool isAddressOfOperand) {
// FIXME: Implement this!
assert(false && "Cannot transform Objective-C expressions yet");
return SemaRef.Owned(E->Retain());
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformObjCIsaExpr(ObjCIsaExpr *E) {
+TreeTransform<Derived>::TransformObjCIsaExpr(ObjCIsaExpr *E,
+ bool isAddressOfOperand) {
// FIXME: Implement this!
assert(false && "Cannot transform Objective-C expressions yet");
return SemaRef.Owned(E->Retain());
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformShuffleVectorExpr(ShuffleVectorExpr *E) {
+TreeTransform<Derived>::TransformShuffleVectorExpr(ShuffleVectorExpr *E,
+ bool isAddressOfOperand) {
bool ArgumentChanged = false;
ASTOwningVector<&ActionBase::DeleteExpr> SubExprs(SemaRef);
for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I) {
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformBlockExpr(BlockExpr *E) {
+TreeTransform<Derived>::TransformBlockExpr(BlockExpr *E,
+ bool isAddressOfOperand) {
// FIXME: Implement this!
assert(false && "Cannot transform block expressions yet");
return SemaRef.Owned(E->Retain());
template<typename Derived>
Sema::OwningExprResult
-TreeTransform<Derived>::TransformBlockDeclRefExpr(BlockDeclRefExpr *E) {
+TreeTransform<Derived>::TransformBlockDeclRefExpr(BlockDeclRefExpr *E,
+ bool isAddressOfOperand) {
// FIXME: Implement this!
assert(false && "Cannot transform block-related expressions yet");
return SemaRef.Owned(E->Retain());