clang API Documentation
#include <Expr.h>


Public Types | |
| typedef ExprIterator | arg_iterator |
| typedef ConstExprIterator | const_arg_iterator |
Public Member Functions | |
| CallExpr (ASTContext &C, Expr *fn, Expr **args, unsigned numargs, QualType t, ExprValueKind VK, SourceLocation rparenloc) | |
| CallExpr (ASTContext &C, StmtClass SC, EmptyShell Empty) | |
| Build an empty call expression. | |
| const Expr * | getCallee () const |
| Expr * | getCallee () |
| void | setCallee (Expr *F) |
| Decl * | getCalleeDecl () |
| const Decl * | getCalleeDecl () const |
| FunctionDecl * | getDirectCallee () |
| If the callee is a FunctionDecl, return it. Otherwise return 0. | |
| const FunctionDecl * | getDirectCallee () const |
| unsigned | getNumArgs () const |
| Expr ** | getArgs () |
| Retrieve the call arguments. | |
| const Expr *const * | getArgs () const |
| Expr * | getArg (unsigned Arg) |
| getArg - Return the specified argument. | |
| const Expr * | getArg (unsigned Arg) const |
| void | setArg (unsigned Arg, Expr *ArgExpr) |
| setArg - Set the specified argument. | |
| void | setNumArgs (ASTContext &C, unsigned NumArgs) |
| arg_iterator | arg_begin () |
| arg_iterator | arg_end () |
| const_arg_iterator | arg_begin () const |
| const_arg_iterator | arg_end () const |
| unsigned | getNumCommas () const |
| unsigned | isBuiltinCall () const |
| QualType | getCallReturnType () const |
| SourceLocation | getRParenLoc () const |
| void | setRParenLoc (SourceLocation L) |
| SourceRange | getSourceRange () const |
| child_range | children () |
Static Public Member Functions | |
| static bool | classof (const Stmt *T) |
| static bool | classof (const CallExpr *) |
Protected Member Functions | |
| CallExpr (ASTContext &C, StmtClass SC, Expr *fn, unsigned NumPreArgs, Expr **args, unsigned numargs, QualType t, ExprValueKind VK, SourceLocation rparenloc) | |
| CallExpr (ASTContext &C, StmtClass SC, unsigned NumPreArgs, EmptyShell Empty) | |
| Stmt * | getPreArg (unsigned i) |
| const Stmt * | getPreArg (unsigned i) const |
| void | setPreArg (unsigned i, Stmt *PreArg) |
| unsigned | getNumPreArgs () const |
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]). CallExpr itself represents a normal function call, e.g., "f(x, 2)", while its subclasses may represent alternative syntax that (semantically) results in a function call. For example, CXXOperatorCallExpr is a subclass for overloaded operator calls that use operator syntax, e.g., "str1 + str2" to resolve to a function call.
| CallExpr::CallExpr | ( | ASTContext & | C, |
| StmtClass | SC, | ||
| Expr * | fn, | ||
| unsigned | NumPreArgs, | ||
| Expr ** | args, | ||
| unsigned | numargs, | ||
| QualType | t, | ||
| ExprValueKind | VK, | ||
| SourceLocation | rparenloc | ||
| ) | [protected] |
Definition at line 714 of file Expr.cpp.
References clang::Stmt::CallExprBits, clang::Expr::containsUnexpandedParameterPack(), clang::Stmt::ExprBits, clang::Expr::isInstantiationDependent(), clang::Expr::isTypeDependent(), and clang::Expr::isValueDependent().
| CallExpr::CallExpr | ( | ASTContext & | C, |
| StmtClass | SC, | ||
| unsigned | NumPreArgs, | ||
| EmptyShell | Empty | ||
| ) | [protected] |
Definition at line 778 of file Expr.cpp.
References clang::Stmt::CallExprBits.
| CallExpr::CallExpr | ( | ASTContext & | C, |
| Expr * | fn, | ||
| Expr ** | args, | ||
| unsigned | numargs, | ||
| QualType | t, | ||
| ExprValueKind | VK, | ||
| SourceLocation | rparenloc | ||
| ) |
Definition at line 743 of file Expr.cpp.
References clang::Stmt::CallExprBits, clang::Expr::containsUnexpandedParameterPack(), clang::Stmt::ExprBits, clang::Expr::isInstantiationDependent(), clang::Expr::isTypeDependent(), and clang::Expr::isValueDependent().
| CallExpr::CallExpr | ( | ASTContext & | C, |
| StmtClass | SC, | ||
| EmptyShell | Empty | ||
| ) |
Build an empty call expression.
Definition at line 771 of file Expr.cpp.
References clang::Stmt::CallExprBits.
| arg_iterator clang::CallExpr::arg_begin | ( | ) | [inline] |
Definition at line 2087 of file Expr.h.
References getNumPreArgs().
Referenced by clang::CodeGen::CodeGenFunction::EmitBlockCallExpr(), clang::CodeGen::CodeGenFunction::EmitCallExpr(), clang::CodeGen::CGCUDARuntime::EmitCUDAKernelCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXOperatorMemberCallExpr(), and emitLibraryCall().
| const_arg_iterator clang::CallExpr::arg_begin | ( | ) | const [inline] |
Definition at line 2091 of file Expr.h.
References getNumPreArgs().
| arg_iterator clang::CallExpr::arg_end | ( | ) | [inline] |
Definition at line 2088 of file Expr.h.
References getNumArgs(), and getNumPreArgs().
Referenced by clang::CodeGen::CodeGenFunction::EmitBlockCallExpr(), clang::CodeGen::CodeGenFunction::EmitCallExpr(), clang::CodeGen::CGCUDARuntime::EmitCUDAKernelCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXOperatorMemberCallExpr(), emitLibraryCall(), and ReplaceUsesOfNonProtoTypeWithRealFunction().
| const_arg_iterator clang::CallExpr::arg_end | ( | ) | const [inline] |
Definition at line 2094 of file Expr.h.
References getNumArgs(), and getNumPreArgs().
| child_range clang::CallExpr::children | ( | ) | [inline] |
| static bool clang::CallExpr::classof | ( | const Stmt * | T | ) | [inline, static] |
Reimplemented from clang::Expr.
Reimplemented in clang::CUDAKernelCallExpr, clang::CXXMemberCallExpr, and clang::CXXOperatorCallExpr.
Definition at line 2116 of file Expr.h.
References clang::Stmt::getStmtClass().
| static bool clang::CallExpr::classof | ( | const CallExpr * | ) | [inline, static] |
| Expr* clang::CallExpr::getArg | ( | unsigned | Arg | ) | [inline] |
getArg - Return the specified argument.
Definition at line 2064 of file Expr.h.
References getNumPreArgs().
Referenced by checkArgCount(), checkBuiltinArgument(), clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(), EmitBinaryAtomic(), EmitBinaryAtomicPost(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCXXOperatorMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitHexagonBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitPPCBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitX86BuiltinExpr(), EvaluateBuiltinClassifyType(), clang::CXXOperatorCallExpr::getSourceRange(), getSourceRange(), getStrlenExprArg(), clang::Expr::isUnusedResultAWarning(), clang::Sema::SemaBuiltinShuffleVector(), and UseVirtualCall().
| const Expr* clang::CallExpr::getArg | ( | unsigned | Arg | ) | const [inline] |
Definition at line 2068 of file Expr.h.
References getNumPreArgs().
| Expr** clang::CallExpr::getArgs | ( | ) | [inline] |
Retrieve the call arguments.
Definition at line 2056 of file Expr.h.
References getNumPreArgs().
Referenced by getArgs().
| const Expr* const* clang::CallExpr::getArgs | ( | ) | const [inline] |
| const Expr* clang::CallExpr::getCallee | ( | ) | const [inline] |
Definition at line 2036 of file Expr.h.
Referenced by clang::Expr::CanThrow(), clang::CodeGen::CodeGenFunction::EmitBlockCallExpr(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCallExpr(), clang::CodeGen::CGCUDARuntime::EmitCUDAKernelCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr(), emitLibraryCall(), clang::ento::ExprEngine::evalCallee(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::ento::CheckerContext::getCalleeDecl(), getCalleeDecl(), getCalleeName(), getCallReturnType(), clang::CXXMemberCallExpr::getImplicitObjectArgument(), clang::CXXMemberCallExpr::getMethodDecl(), clang::ento::CallOrObjCMessage::getResultType(), getSourceRange(), isBuiltinCall(), isParenthesizedADLCallee(), clang::Expr::isUnusedResultAWarning(), clang::Sema::SemaBuiltinShuffleVector(), and clang::ento::ExprEngine::VisitCallExpr().
| Decl * CallExpr::getCalleeDecl | ( | ) |
Definition at line 786 of file Expr.cpp.
References getCallee(), clang::Expr::IgnoreParenCasts(), clang::Expr::IgnoreParenImpCasts(), and clang::UO_Deref.
Referenced by clang::Expr::CanThrow(), clang::CodeGen::CodeGenFunction::EmitCallExpr(), getCalleeDecl(), getDirectCallee(), and clang::Expr::isUnusedResultAWarning().
| const Decl* clang::CallExpr::getCalleeDecl | ( | ) | const [inline] |
Definition at line 2041 of file Expr.h.
References getCalleeDecl().
| QualType CallExpr::getCallReturnType | ( | ) | const |
getCallReturnType - Get the return type of the call expr. This is not always the type of the expr itself, if the return type is a reference type.
Definition at line 867 of file Expr.cpp.
References clang::Expr::findBoundMemberType(), getCallee(), clang::FunctionType::getResultType(), and clang::Expr::getType().
Referenced by clang::CodeGen::CodeGenFunction::EmitCallExprLValue().
| FunctionDecl * CallExpr::getDirectCallee | ( | ) |
If the callee is a FunctionDecl, return it. Otherwise return 0.
Definition at line 810 of file Expr.cpp.
References getCalleeDecl().
Referenced by checkBuiltinArgument(), clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(), getCalleeName(), getDirectCallee(), and getStrlenExprArg().
| const FunctionDecl* clang::CallExpr::getDirectCallee | ( | ) | const [inline] |
Definition at line 2047 of file Expr.h.
References getDirectCallee().
| unsigned clang::CallExpr::getNumArgs | ( | ) | const [inline] |
getNumArgs - Return the number of actual arguments to this call.
Definition at line 2053 of file Expr.h.
Referenced by arg_end(), checkArgCount(), DecodeOperatorCall(), clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitHexagonBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitPPCBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitX86BuiltinExpr(), EvaluateBuiltinClassifyType(), getPrintfFormatArgumentNum(), clang::CXXOperatorCallExpr::getSourceRange(), getSourceRange(), clang::Expr::isUnusedResultAWarning(), clang::Sema::SemaBuiltinShuffleVector(), and setNumArgs().
| unsigned clang::CallExpr::getNumCommas | ( | ) | const [inline] |
| unsigned clang::CallExpr::getNumPreArgs | ( | ) | const [inline, protected] |
Definition at line 2027 of file Expr.h.
References clang::Stmt::CallExprBits.
Referenced by arg_begin(), arg_end(), children(), getArg(), getArgs(), getPreArg(), setArg(), setNumArgs(), and setPreArg().
| Stmt* clang::CallExpr::getPreArg | ( | unsigned | i | ) | [inline, protected] |
Definition at line 2014 of file Expr.h.
References getNumPreArgs().
Referenced by clang::CUDAKernelCallExpr::getConfig().
| const Stmt* clang::CallExpr::getPreArg | ( | unsigned | i | ) | const [inline, protected] |
Definition at line 2018 of file Expr.h.
References getNumPreArgs().
| SourceLocation clang::CallExpr::getRParenLoc | ( | ) | const [inline] |
Definition at line 2111 of file Expr.h.
Referenced by clang::CXXOperatorCallExpr::getOperatorLoc(), clang::CXXOperatorCallExpr::getSourceRange(), getSourceRange(), and clang::Sema::SemaBuiltinShuffleVector().
| SourceRange CallExpr::getSourceRange | ( | ) | const |
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.
Reimplemented in clang::CXXOperatorCallExpr.
Definition at line 881 of file Expr.cpp.
References getArg(), getCallee(), clang::Stmt::getLocEnd(), clang::Stmt::getLocStart(), getNumArgs(), getRParenLoc(), and clang::SourceLocation::isInvalid().
Referenced by checkArgCount(), clang::Sema::CheckCallReturnType(), clang::Sema::ConvertArgumentsForCall(), and clang::Sema::SemaBuiltinShuffleVector().
| unsigned CallExpr::isBuiltinCall | ( | ) | const |
isBuiltinCall - If this is a call to a builtin, return the builtin ID. If not, return 0.
Definition at line 845 of file Expr.cpp.
References clang::FunctionDecl::getBuiltinID(), getCallee(), clang::DeclRefExpr::getDecl(), clang::NamedDecl::getIdentifier(), and clang::CastExpr::getSubExpr().
Referenced by CheckICE(), and IsStringLiteralCall().
| void clang::CallExpr::setArg | ( | unsigned | Arg, |
| Expr * | ArgExpr | ||
| ) | [inline] |
setArg - Set the specified argument.
Definition at line 2074 of file Expr.h.
References getNumPreArgs().
Referenced by clang::Sema::BuildResolvedCallExpr(), checkBuiltinArgument(), clang::Sema::ConvertArgumentsForCall(), and clang::Sema::SemaBuiltinShuffleVector().
| void clang::CallExpr::setCallee | ( | Expr * | F | ) | [inline] |
Definition at line 2038 of file Expr.h.
Referenced by clang::Sema::BuildResolvedCallExpr().
| void CallExpr::setNumArgs | ( | ASTContext & | C, |
| unsigned | NumArgs | ||
| ) |
setNumArgs - This changes the number of arguments present in this call. Any orphaned expressions are deleted by this, and any new operands are set to null.
Definition at line 817 of file Expr.cpp.
References clang::ASTContext::Deallocate(), getNumArgs(), and getNumPreArgs().
Referenced by clang::Sema::ConvertArgumentsForCall().
| void clang::CallExpr::setPreArg | ( | unsigned | i, |
| Stmt * | PreArg | ||
| ) | [inline, protected] |
Definition at line 2022 of file Expr.h.
References getNumPreArgs().
Referenced by clang::CUDAKernelCallExpr::setConfig().
| void clang::CallExpr::setRParenLoc | ( | SourceLocation | L | ) | [inline] |