aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Beaumont-Gay <matthewbg@google.com>2012-03-09 20:36:34 +0000
committerMatt Beaumont-Gay <matthewbg@google.com>2012-03-09 20:36:34 +0000
commitfeb1f4a0a71868a271fa284dadfda7a2beeaccff (patch)
treee20d4e03ec53485a1e9d95e069dca0d478b53da2
parent216f78b7333dbc89f58fa69066396ae3237da6da (diff)
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
-rw-r--r--include/clang/AST/ExprCXX.h5
1 files changed, 5 insertions, 0 deletions
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<Expr>(SubExprs[Array]) : 0;
}
+ /// \brief Returns the CXXConstructExpr from this new-expression, or NULL.
+ const CXXConstructExpr* getConstructExpr() {
+ return dyn_cast_or_null<CXXConstructExpr>(getInitializer());
+ }
+
/// Answers whether the usual array deallocation function for the
/// allocated type expects the size of the allocation as a
/// parameter.