[cfe-commits] r152433 - /cfe/trunk/include/clang/AST/ExprCXX.h

Matt Beaumont-Gay matthewbg at google.com
Fri Mar 9 12:36:34 PST 2012


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.





More information about the cfe-commits mailing list