clang API Documentation
#include <ExprCXX.h>


Public Types | |
| enum | InitializationStyle { NoInit, CallInit, ListInit } |
| typedef ExprIterator | arg_iterator |
| typedef ConstExprIterator | const_arg_iterator |
| typedef Stmt ** | raw_arg_iterator |
Public Member Functions | |
| CXXNewExpr (ASTContext &C, bool globalNew, FunctionDecl *operatorNew, FunctionDecl *operatorDelete, bool usualArrayDeleteWantsSize, Expr **placementArgs, unsigned numPlaceArgs, SourceRange typeIdParens, Expr *arraySize, InitializationStyle initializationStyle, Expr *initializer, QualType ty, TypeSourceInfo *AllocatedTypeInfo, SourceLocation startLoc, SourceRange directInitRange) | |
| CXXNewExpr (EmptyShell Shell) | |
| void | AllocateArgsArray (ASTContext &C, bool isArray, unsigned numPlaceArgs, bool hasInitializer) |
| QualType | getAllocatedType () const |
| TypeSourceInfo * | getAllocatedTypeSourceInfo () const |
| bool | shouldNullCheckAllocation (ASTContext &Ctx) const |
| True if the allocation result needs to be null-checked. C++0x [expr.new]p13: If the allocation function returns null, initialization shall not be done, the deallocation function shall not be called, and the value of the new-expression shall be null. An allocation function is not allowed to return null unless it has a non-throwing exception-specification. The '03 rule is identical except that the definition of a non-throwing exception specification is just "is it throw()?". | |
| FunctionDecl * | getOperatorNew () const |
| void | setOperatorNew (FunctionDecl *D) |
| FunctionDecl * | getOperatorDelete () const |
| void | setOperatorDelete (FunctionDecl *D) |
| bool | isArray () const |
| Expr * | getArraySize () |
| const Expr * | getArraySize () const |
| unsigned | getNumPlacementArgs () const |
| Expr ** | getPlacementArgs () |
| Expr * | getPlacementArg (unsigned i) |
| const Expr * | getPlacementArg (unsigned i) const |
| bool | isParenTypeId () const |
| SourceRange | getTypeIdParens () const |
| bool | isGlobalNew () const |
| bool | hasInitializer () const |
| Whether this new-expression has any initializer at all. | |
| InitializationStyle | getInitializationStyle () const |
| The kind of initializer this new-expression has. | |
| Expr * | getInitializer () |
| The initializer of this new-expression. | |
| const Expr * | getInitializer () const |
| const CXXConstructExpr * | getConstructExpr () |
| Returns the CXXConstructExpr from this new-expression, or NULL. | |
| bool | doesUsualArrayDeleteWantSize () const |
| arg_iterator | placement_arg_begin () |
| arg_iterator | placement_arg_end () |
| const_arg_iterator | placement_arg_begin () const |
| const_arg_iterator | placement_arg_end () const |
| raw_arg_iterator | raw_arg_begin () |
| raw_arg_iterator | raw_arg_end () |
| const_arg_iterator | raw_arg_begin () const |
| const_arg_iterator | raw_arg_end () const |
| SourceLocation | getStartLoc () const |
| SourceLocation | getEndLoc () const |
| SourceRange | getDirectInitRange () const |
| SourceRange | getSourceRange () const LLVM_READONLY |
| child_range | children () |
Static Public Member Functions | |
| static bool | classof (const Stmt *T) |
| static bool | classof (const CXXNewExpr *) |
Friends | |
| class | ASTStmtReader |
| class | ASTStmtWriter |
CXXNewExpr - A new expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
| typedef Stmt** clang::CXXNewExpr::raw_arg_iterator |
| CXXNewExpr::CXXNewExpr | ( | ASTContext & | C, |
| bool | globalNew, | ||
| FunctionDecl * | operatorNew, | ||
| FunctionDecl * | operatorDelete, | ||
| bool | usualArrayDeleteWantsSize, | ||
| Expr ** | placementArgs, | ||
| unsigned | numPlaceArgs, | ||
| SourceRange | typeIdParens, | ||
| Expr * | arraySize, | ||
| InitializationStyle | initializationStyle, | ||
| Expr * | initializer, | ||
| QualType | ty, | ||
| TypeSourceInfo * | AllocatedTypeInfo, | ||
| SourceLocation | startLoc, | ||
| SourceRange | directInitRange | ||
| ) |
Definition at line 47 of file ExprCXX.cpp.
References AllocateArgsArray(), clang::Expr::containsUnexpandedParameterPack(), clang::Stmt::ExprBits, clang::Expr::isInstantiationDependent(), and NoInit.
| clang::CXXNewExpr::CXXNewExpr | ( | EmptyShell | Shell | ) | [inline, explicit] |
| void CXXNewExpr::AllocateArgsArray | ( | ASTContext & | C, |
| bool | isArray, | ||
| unsigned | numPlaceArgs, | ||
| bool | hasInitializer | ||
| ) |
| child_range clang::CXXNewExpr::children | ( | ) | [inline] |
Reimplemented from clang::Stmt.
Definition at line 1622 of file ExprCXX.h.
References raw_arg_begin(), and raw_arg_end().
| static bool clang::CXXNewExpr::classof | ( | const Stmt * | T | ) | [inline, static] |
Reimplemented from clang::Expr.
Definition at line 1616 of file ExprCXX.h.
References clang::Stmt::getStmtClass().
| static bool clang::CXXNewExpr::classof | ( | const CXXNewExpr * | ) | [inline, static] |
| bool clang::CXXNewExpr::doesUsualArrayDeleteWantSize | ( | ) | const [inline] |
Answers whether the usual array deallocation function for the allocated type expects the size of the allocation as a parameter.
Definition at line 1577 of file ExprCXX.h.
Referenced by clang::CodeGen::CGCXXABI::requiresArrayCookie().
| QualType clang::CXXNewExpr::getAllocatedType | ( | ) | const [inline] |
Definition at line 1499 of file ExprCXX.h.
References clang::Expr::getType().
Referenced by EmitCXXNewAllocSize(), clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), EmitNewInitializer(), clang::CodeGen::CGCXXABI::GetArrayCookieSize(), and clang::CodeGen::CGCXXABI::requiresArrayCookie().
| TypeSourceInfo* clang::CXXNewExpr::getAllocatedTypeSourceInfo | ( | ) | const [inline] |
| Expr* clang::CXXNewExpr::getArraySize | ( | ) | [inline] |
Definition at line 1525 of file ExprCXX.h.
Referenced by EmitCXXNewAllocSize().
| const Expr* clang::CXXNewExpr::getArraySize | ( | ) | const [inline] |
| const CXXConstructExpr* clang::CXXNewExpr::getConstructExpr | ( | ) | [inline] |
Returns the CXXConstructExpr from this new-expression, or NULL.
Definition at line 1570 of file ExprCXX.h.
References getInitializer().
| SourceRange clang::CXXNewExpr::getDirectInitRange | ( | ) | const [inline] |
| SourceLocation CXXNewExpr::getEndLoc | ( | ) | const |
Definition at line 114 of file ExprCXX.cpp.
References CallInit, clang::SourceRange::getEnd(), clang::TypeLoc::getEndLoc(), getInitializationStyle(), getInitializer(), clang::Stmt::getSourceRange(), clang::TypeSourceInfo::getTypeLoc(), ListInit, and NoInit.
Referenced by getSourceRange().
| InitializationStyle clang::CXXNewExpr::getInitializationStyle | ( | ) | const [inline] |
The kind of initializer this new-expression has.
Definition at line 1555 of file ExprCXX.h.
References NoInit.
Referenced by getEndLoc().
| Expr* clang::CXXNewExpr::getInitializer | ( | ) | [inline] |
The initializer of this new-expression.
Definition at line 1562 of file ExprCXX.h.
References hasInitializer().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), EmitNewInitializer(), getConstructExpr(), and getEndLoc().
| const Expr* clang::CXXNewExpr::getInitializer | ( | ) | const [inline] |
Definition at line 1565 of file ExprCXX.h.
References hasInitializer().
| unsigned clang::CXXNewExpr::getNumPlacementArgs | ( | ) | const [inline] |
Definition at line 1532 of file ExprCXX.h.
Referenced by EnterNewDeleteCleanup(), placement_arg_end(), and raw_arg_end().
| FunctionDecl* clang::CXXNewExpr::getOperatorDelete | ( | ) | const [inline] |
Definition at line 1521 of file ExprCXX.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), and EnterNewDeleteCleanup().
| FunctionDecl* clang::CXXNewExpr::getOperatorNew | ( | ) | const [inline] |
Definition at line 1519 of file ExprCXX.h.
Referenced by CalculateCookiePadding(), clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), and shouldNullCheckAllocation().
| Expr* clang::CXXNewExpr::getPlacementArg | ( | unsigned | i | ) | [inline] |
Definition at line 1537 of file ExprCXX.h.
References getPlacementArgs().
Referenced by getPlacementArg().
| const Expr* clang::CXXNewExpr::getPlacementArg | ( | unsigned | i | ) | const [inline] |
Definition at line 1541 of file ExprCXX.h.
References getPlacementArg().
| Expr** clang::CXXNewExpr::getPlacementArgs | ( | ) | [inline] |
Definition at line 1533 of file ExprCXX.h.
References hasInitializer().
Referenced by getPlacementArg().
| SourceRange clang::CXXNewExpr::getSourceRange | ( | ) | const [inline] |
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpreted by SourceManager. We assume AST clients will have a pointer to the respective SourceManager.
Reimplemented from clang::Stmt.
Definition at line 1612 of file ExprCXX.h.
References getEndLoc(), and getStartLoc().
| SourceLocation clang::CXXNewExpr::getStartLoc | ( | ) | const [inline] |
Definition at line 1607 of file ExprCXX.h.
Referenced by getSourceRange().
| SourceRange clang::CXXNewExpr::getTypeIdParens | ( | ) | const [inline] |
| bool clang::CXXNewExpr::hasInitializer | ( | ) | const [inline] |
Whether this new-expression has any initializer at all.
Definition at line 1552 of file ExprCXX.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), getInitializer(), getPlacementArgs(), placement_arg_begin(), placement_arg_end(), raw_arg_end(), and clang::ento::ExprEngine::VisitCXXNewExpr().
| bool clang::CXXNewExpr::isArray | ( | ) | const [inline] |
Definition at line 1524 of file ExprCXX.h.
Referenced by AllocateArgsArray(), CalculateCookiePadding(), EmitCXXNewAllocSize(), clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), EmitNewInitializer(), and clang::ento::ExprEngine::VisitCXXNewExpr().
| bool clang::CXXNewExpr::isParenTypeId | ( | ) | const [inline] |
Definition at line 1546 of file ExprCXX.h.
References clang::SourceRange::isValid().
| arg_iterator clang::CXXNewExpr::placement_arg_begin | ( | ) | [inline] |
Definition at line 1584 of file ExprCXX.h.
References hasInitializer().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXNewExpr().
| const_arg_iterator clang::CXXNewExpr::placement_arg_begin | ( | ) | const [inline] |
Definition at line 1590 of file ExprCXX.h.
References hasInitializer().
| arg_iterator clang::CXXNewExpr::placement_arg_end | ( | ) | [inline] |
Definition at line 1587 of file ExprCXX.h.
References getNumPlacementArgs(), and hasInitializer().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXNewExpr().
| const_arg_iterator clang::CXXNewExpr::placement_arg_end | ( | ) | const [inline] |
Definition at line 1593 of file ExprCXX.h.
References getNumPlacementArgs(), and hasInitializer().
| raw_arg_iterator clang::CXXNewExpr::raw_arg_begin | ( | ) | [inline] |
Definition at line 1598 of file ExprCXX.h.
Referenced by children().
| const_arg_iterator clang::CXXNewExpr::raw_arg_begin | ( | ) | const [inline] |
| raw_arg_iterator clang::CXXNewExpr::raw_arg_end | ( | ) | [inline] |
Definition at line 1599 of file ExprCXX.h.
References getNumPlacementArgs(), and hasInitializer().
Referenced by children().
| const_arg_iterator clang::CXXNewExpr::raw_arg_end | ( | ) | const [inline] |
Definition at line 1603 of file ExprCXX.h.
References getNumPlacementArgs(), and hasInitializer().
| void clang::CXXNewExpr::setOperatorDelete | ( | FunctionDecl * | D | ) | [inline] |
| void clang::CXXNewExpr::setOperatorNew | ( | FunctionDecl * | D | ) | [inline] |
| bool CXXNewExpr::shouldNullCheckAllocation | ( | ASTContext & | Ctx | ) | const |
True if the allocation result needs to be null-checked. C++0x [expr.new]p13: If the allocation function returns null, initialization shall not be done, the deallocation function shall not be called, and the value of the new-expression shall be null. An allocation function is not allowed to return null unless it has a non-throwing exception-specification. The '03 rule is identical except that the definition of a non-throwing exception specification is just "is it throw()?".
Definition at line 109 of file ExprCXX.cpp.
References getOperatorNew(), and clang::ValueDecl::getType().
friend class ASTStmtReader [friend] |
Reimplemented from clang::Stmt.
friend class ASTStmtWriter [friend] |
Reimplemented from clang::Stmt.