From: Matt Beaumont-Gay Date: Fri, 9 Mar 2012 20:36:34 +0000 (+0000) Subject: Add a helper to get a CXXConstructExpr from a CXXNewExpr. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=feb1f4a0a71868a271fa284dadfda7a2beeaccff;p=clang Add a helper to get a CXXConstructExpr from a CXXNewExpr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152433 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/ExprCXX.h b/include/clang/AST/ExprCXX.h index 4b7bfde818..178a9ce3e2 100644 --- a/include/clang/AST/ExprCXX.h +++ b/include/clang/AST/ExprCXX.h @@ -1553,6 +1553,11 @@ public: return hasInitializer() ? cast(SubExprs[Array]) : 0; } + /// \brief Returns the CXXConstructExpr from this new-expression, or NULL. + const CXXConstructExpr* getConstructExpr() { + return dyn_cast_or_null(getInitializer()); + } + /// Answers whether the usual array deallocation function for the /// allocated type expects the size of the allocation as a /// parameter.