public:
static CXXTempVarDecl *Create(ASTContext &C, DeclContext *DC,
QualType T);
+
+ static bool classof(const Decl *D) {
+ return D->getKind() == Decl::CXXTempVar;
+ }
+ static bool classof(CXXTempVarDecl *D) { return true; }
};
/// Insertion operator for diagnostics. This allows sending AccessSpecifier's
virtual StmtIterator child_end();
};
+class CXXDestroyExpr : public Expr {
+ VarDecl *VD;
+
+protected:
+ CXXDestroyExpr(VarDecl* vd, QualType T)
+ : Expr(CXXDestroyExprClass, T, false, vd->getType()->isDependentType()),
+ VD(vd) { }
+
+public:
+ static CXXDestroyExpr *Create(ASTContext &C, VarDecl *vd);
+
+ virtual SourceRange getSourceRange() const { return SourceRange(); }
+
+ // Implement isa/cast/dyncast/etc.
+ static bool classof(const Stmt *T) {
+ return T->getStmtClass() == CXXDestroyExprClass;
+ }
+ static bool classof(const CXXDestroyExpr *) { return true; }
+
+ // Iterators
+ virtual child_iterator child_begin();
+ virtual child_iterator child_end();
+};
+
} // end namespace clang
#endif
STMT(UnaryTypeTraitExpr , Expr)
STMT(QualifiedDeclRefExpr , DeclRefExpr)
STMT(UnresolvedDeclRefExpr , Expr)
+STMT(CXXDestroyExpr , Expr)
// Obj-C Expressions.
STMT(ObjCStringLiteral , Expr)
CXXTemporaryObjectExpr::~CXXTemporaryObjectExpr() {
delete [] Args;
}
+
+CXXDestroyExpr *CXXDestroyExpr::Create(ASTContext &C, VarDecl *vd) {
+ assert(vd->getKind() == Decl::CXXTempVar || vd->getKind() == Decl::Var &&
+ "Can only create a destroy expr with a temp var decl or a var decl!");
+
+ return new (C) CXXDestroyExpr(vd, C.VoidTy);
+}
+
+Stmt::child_iterator CXXDestroyExpr::child_begin() {
+ return child_iterator();
+}
+Stmt::child_iterator CXXDestroyExpr::child_end() {
+ return child_iterator();
+}
OS << E->getName().getAsString();
}
+void StmtPrinter::VisitCXXDestroyExpr(CXXDestroyExpr *E) {
+ // Nothing to print.
+}
+
static const char *getTypeTraitName(UnaryTypeTrait UTT) {
switch (UTT) {
default: assert(false && "Unknown type trait");