diff options
| author | Matt Beaumont-Gay <matthewbg@google.com> | 2012-03-09 20:36:34 +0000 |
|---|---|---|
| committer | Matt Beaumont-Gay <matthewbg@google.com> | 2012-03-09 20:36:34 +0000 |
| commit | 639ac334c751edcc5cca1752aa8bef16afa847e9 (patch) | |
| tree | dc5560c7feb6cbecb1bb023d44478db24b938f4b /clang | |
| parent | 2559629c5bf218bf74ab52c49e88bfe04e895a85 (diff) | |
| download | bcm5719-llvm-639ac334c751edcc5cca1752aa8bef16afa847e9.tar.gz bcm5719-llvm-639ac334c751edcc5cca1752aa8bef16afa847e9.zip | |
Add a helper to get a CXXConstructExpr from a CXXNewExpr.
llvm-svn: 152433
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/include/clang/AST/ExprCXX.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/include/clang/AST/ExprCXX.h b/clang/include/clang/AST/ExprCXX.h index 4b7bfde8182..178a9ce3e2c 100644 --- a/clang/include/clang/AST/ExprCXX.h +++ b/clang/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. |

