Author: matthewbg
Date: Fri Mar 9 14:36:34 2012
New Revision: 152433
URL: http://llvm.org/viewvc/llvm-project?rev=152433&view=rev
Log:
Add a helper to get a CXXConstructExpr from a CXXNewExpr.
Modified:
cfe/trunk/include/clang/AST/ExprCXX.h
Modified: cfe/trunk/include/clang/AST/ExprCXX.h
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprCXX.h?rev=152433&r1=152432&r2=152433&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ExprCXX.h (original)
+++ cfe/trunk/include/clang/AST/ExprCXX.h Fri Mar 9 14:36:34 2012
@@ -1553,6 +1553,11 @@
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.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits