clang API Documentation
#include <Expr.h>
Public Types | |
typedef ExprIterator | arg_iterator |
typedef ConstExprIterator | const_arg_iterator |
typedef llvm::iterator_range < arg_iterator > | arg_range |
typedef llvm::iterator_range < const_arg_iterator > | arg_const_range |
Public Member Functions | |
CallExpr (const ASTContext &C, Expr *fn, ArrayRef< Expr * > args, QualType t, ExprValueKind VK, SourceLocation rparenloc) | |
CallExpr (const 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 (const ASTContext &C, unsigned NumArgs) |
arg_range | arguments () |
arg_const_range | arguments () const |
arg_iterator | arg_begin () |
arg_iterator | arg_end () |
const_arg_iterator | arg_begin () const |
const_arg_iterator | arg_end () const |
ArrayRef< Stmt * > | getRawSubExprs () |
unsigned | getNumCommas () const |
unsigned | getBuiltinCallee () const |
getBuiltinCallee - If this is a call to a builtin, return the builtin ID. If not, return 0. | |
bool | isUnevaluatedBuiltinCall (ASTContext &Ctx) const |
Returns true if this is a call to a builtin which does not evaluate side-effects within its arguments. | |
QualType | getCallReturnType () const |
SourceLocation | getRParenLoc () const |
void | setRParenLoc (SourceLocation L) |
SourceLocation | getLocStart () const LLVM_READONLY |
SourceLocation | getLocEnd () const LLVM_READONLY |
child_range | children () |
Static Public Member Functions | |
static bool | classof (const Stmt *T) |
Protected Member Functions | |
CallExpr (const ASTContext &C, StmtClass SC, Expr *fn, unsigned NumPreArgs, ArrayRef< Expr * > args, QualType t, ExprValueKind VK, SourceLocation rparenloc) | |
CallExpr (const 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.
typedef llvm::iterator_range<const_arg_iterator> clang::CallExpr::arg_const_range |
typedef llvm::iterator_range<arg_iterator> clang::CallExpr::arg_range |
CallExpr::CallExpr | ( | const ASTContext & | C, |
StmtClass | SC, | ||
Expr * | fn, | ||
unsigned | NumPreArgs, | ||
ArrayRef< Expr * > | args, | ||
QualType | t, | ||
ExprValueKind | VK, | ||
SourceLocation | rparenloc | ||
) | [protected] |
Definition at line 1114 of file Expr.cpp.
References AttributeLangSupport::C, clang::Stmt::CallExprBits, clang::Expr::containsUnexpandedParameterPack(), clang::Stmt::ExprBits, clang::Expr::isInstantiationDependent(), clang::Expr::isTypeDependent(), and clang::Expr::isValueDependent().
CallExpr::CallExpr | ( | const ASTContext & | C, |
StmtClass | SC, | ||
unsigned | NumPreArgs, | ||
EmptyShell | Empty | ||
) | [protected] |
Definition at line 1178 of file Expr.cpp.
References AttributeLangSupport::C, and clang::Stmt::CallExprBits.
CallExpr::CallExpr | ( | const ASTContext & | C, |
Expr * | fn, | ||
ArrayRef< Expr * > | args, | ||
QualType | t, | ||
ExprValueKind | VK, | ||
SourceLocation | rparenloc | ||
) |
Definition at line 1143 of file Expr.cpp.
References AttributeLangSupport::C, clang::Stmt::CallExprBits, clang::Expr::containsUnexpandedParameterPack(), clang::Stmt::ExprBits, clang::Expr::isInstantiationDependent(), clang::Expr::isTypeDependent(), and clang::Expr::isValueDependent().
CallExpr::CallExpr | ( | const ASTContext & | C, |
StmtClass | SC, | ||
EmptyShell | Empty | ||
) |
Build an empty call expression.
Definition at line 1171 of file Expr.cpp.
References AttributeLangSupport::C, and clang::Stmt::CallExprBits.
arg_iterator clang::CallExpr::arg_begin | ( | ) | [inline] |
Definition at line 2248 of file Expr.h.
References getNumPreArgs().
Referenced by arguments(), commonEmitCXXMemberOrOperatorCall(), clang::CodeGen::CodeGenFunction::EmitBlockCallExpr(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr(), and clang::ento::StackHintGeneratorForSymbol::getMessage().
const_arg_iterator clang::CallExpr::arg_begin | ( | ) | const [inline] |
Definition at line 2252 of file Expr.h.
References getNumPreArgs().
arg_iterator clang::CallExpr::arg_end | ( | ) | [inline] |
Definition at line 2249 of file Expr.h.
References getNumArgs(), and getNumPreArgs().
Referenced by arguments(), commonEmitCXXMemberOrOperatorCall(), clang::CodeGen::CodeGenFunction::EmitBlockCallExpr(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr(), and clang::ento::StackHintGeneratorForSymbol::getMessage().
const_arg_iterator clang::CallExpr::arg_end | ( | ) | const [inline] |
Definition at line 2255 of file Expr.h.
References getNumArgs(), and getNumPreArgs().
arg_range clang::CallExpr::arguments | ( | ) | [inline] |
Definition at line 2243 of file Expr.h.
References arg_begin(), and arg_end().
arg_const_range clang::CallExpr::arguments | ( | ) | const [inline] |
Definition at line 2244 of file Expr.h.
References arg_begin(), and arg_end().
child_range clang::CallExpr::children | ( | ) | [inline] |
static bool clang::CallExpr::classof | ( | const Stmt * | T | ) | [inline, static] |
Reimplemented from clang::Expr.
Reimplemented in clang::UserDefinedLiteral, clang::CUDAKernelCallExpr, clang::CXXMemberCallExpr, and clang::CXXOperatorCallExpr.
Expr* clang::CallExpr::getArg | ( | unsigned | Arg | ) | [inline] |
getArg - Return the specified argument.
Definition at line 2218 of file Expr.h.
References getNumPreArgs().
Referenced by checkArgCount(), checkBuiltinArgument(), checkFormatStringExpr(), DiagnoseShiftCompare(), clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), EmitAArch64TblBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(), EmitBinaryAtomic(), EmitBinaryAtomicPost(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCommonNeonBuiltinExpr(), EmitCommonNeonSISDBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCXXOperatorMemberCallee(), clang::CodeGen::CodeGenFunction::EmitCXXOperatorMemberCallExpr(), emitFPIntBuiltin(), clang::CodeGen::CodeGenFunction::EmitPPCBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitR600BuiltinExpr(), emitTernaryFPBuiltin(), emitUnaryFPBuiltin(), clang::CodeGen::CodeGenFunction::EmitX86BuiltinExpr(), EvaluateBuiltinClassifyType(), findCapturingExpr(), clang::ento::SimpleFunctionCall::getArgExpr(), getArgumentValueString(), clang::UserDefinedLiteral::getCookedLiteral(), getLocEnd(), clang::UserDefinedLiteral::getLocStart(), getLocStart(), clang::consumed::ConsumedStmtVisitor::handleCall(), clang::Expr::isUnusedResultAWarning(), SemaBuiltinAddressof(), SemaBuiltinAnnotation(), SemaBuiltinMemChkCall(), clang::Sema::SemaBuiltinShuffleVector(), clang::ento::ExprEngine::Visit(), clang::consumed::ConsumedStmtVisitor::VisitCallExpr(), clang::threadSafety::BuildLockset::VisitCallExpr(), and clang::consumed::ConsumedStmtVisitor::VisitCXXOperatorCallExpr().
const Expr* clang::CallExpr::getArg | ( | unsigned | Arg | ) | const [inline] |
Definition at line 2222 of file Expr.h.
References getNumPreArgs().
Expr** clang::CallExpr::getArgs | ( | ) | [inline] |
Retrieve the call arguments.
Definition at line 2210 of file Expr.h.
References getNumPreArgs().
Referenced by getArgs().
const Expr* const* clang::CallExpr::getArgs | ( | ) | const [inline] |
unsigned CallExpr::getBuiltinCallee | ( | ) | const |
getBuiltinCallee - If this is a call to a builtin, return the builtin ID. If not, return 0.
getBuiltinCallee - If this is a call to a builtin, return the builtin ID of the callee. If not, return 0.
Definition at line 1245 of file Expr.cpp.
References clang::FunctionDecl::getBuiltinID(), getCallee(), clang::DeclRefExpr::getDecl(), clang::NamedDecl::getIdentifier(), and clang::CastExpr::getSubExpr().
Referenced by CheckICE(), IsStringLiteralCall(), and isUnevaluatedBuiltinCall().
const Expr* clang::CallExpr::getCallee | ( | ) | const [inline] |
Definition at line 2190 of file Expr.h.
Referenced by clang::Sema::canThrow(), checkForFunctionCall(), 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::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), getBuiltinCallee(), clang::ento::CheckerContext::getCalleeDecl(), getCalleeDecl(), getCallReturnType(), clang::CXXInstanceCall::getDecl(), clang::CXXMemberCallExpr::getImplicitObjectArgument(), getLocStart(), clang::CXXMemberCallExpr::getMethodDecl(), clang::CallEventManager::getSimpleCall(), isParenthesizedADLCallee(), clang::Expr::isUnusedResultAWarning(), and clang::Sema::SemaBuiltinShuffleVector().
Expr* clang::CallExpr::getCallee | ( | ) | [inline] |
Decl * CallExpr::getCalleeDecl | ( | ) |
Definition at line 1186 of file Expr.cpp.
References getCallee(), clang::Expr::IgnoreParenCasts(), clang::Expr::IgnoreParenImpCasts(), and clang::UO_Deref.
Referenced by clang::Sema::ActOnStartCXXMemberReference(), clang::Sema::canThrow(), checkForFunctionCall(), checkFormatStringExpr(), clang::CodeGen::CodeGenFunction::EmitCallExpr(), findCapturingExpr(), getCalleeDecl(), getDirectCallee(), clang::threadSafety::ThreadSafetyAnalyzer::getEdgeLockset(), clang::UserDefinedLiteral::getLiteralOperatorKind(), clang::UserDefinedLiteral::getUDSuffix(), clang::Expr::isUnusedResultAWarning(), clang::ento::ExprEngine::Visit(), and clang::threadSafety::BuildLockset::VisitCallExpr().
const Decl* clang::CallExpr::getCalleeDecl | ( | ) | const [inline] |
Definition at line 2195 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 1273 of file Expr.cpp.
References clang::Type::castAs(), clang::Expr::findBoundMemberType(), clang::Type::getAs(), getCallee(), clang::Type::getPointeeType(), clang::FunctionType::getReturnType(), clang::Expr::getType(), and clang::Type::isSpecificPlaceholderType().
Referenced by clang::Sema::ActOnDecltypeExpression(), CheckForReference(), clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCallExprLValue(), clang::Expr::isUnusedResultAWarning(), and clang::CodeGen::CodeGenFunction::LookupNeonLLVMIntrinsic().
If the callee is a FunctionDecl, return it. Otherwise return 0.
Definition at line 1210 of file Expr.cpp.
References getCalleeDecl().
Referenced by clang::Sema::ActOnDecltypeExpression(), checkBuiltinArgument(), CheckForReference(), commonEmitCXXMemberOrOperatorCall(), DiagnoseShiftCompare(), clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCallExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberPointerCallExpr(), getCalleeName(), clang::ento::SimpleFunctionCall::getDecl(), clang::CXXInstanceCall::getDecl(), getDirectCallee(), clang::consumed::ConsumedStmtVisitor::VisitCallExpr(), clang::threadSafety::BuildLockset::VisitCallExpr(), and clang::consumed::ConsumedStmtVisitor::VisitCXXOperatorCallExpr().
const FunctionDecl* clang::CallExpr::getDirectCallee | ( | ) | const [inline] |
Definition at line 2201 of file Expr.h.
References getDirectCallee().
SourceLocation CallExpr::getLocEnd | ( | ) | const |
Reimplemented from clang::Stmt.
Reimplemented in clang::UserDefinedLiteral, and clang::CXXOperatorCallExpr.
Definition at line 1296 of file Expr.cpp.
References getArg(), getNumArgs(), getRParenLoc(), and clang::SourceLocation::isInvalid().
Referenced by checkArgCount(), and clang::Sema::SemaBuiltinShuffleVector().
SourceLocation CallExpr::getLocStart | ( | ) | const |
Reimplemented from clang::Stmt.
Reimplemented in clang::UserDefinedLiteral, and clang::CXXOperatorCallExpr.
Definition at line 1287 of file Expr.cpp.
References getArg(), getCallee(), clang::Stmt::getLocStart(), getNumArgs(), and clang::SourceLocation::isInvalid().
Referenced by clang::Sema::ActOnDecltypeExpression(), clang::Sema::ConvertArgumentsForCall(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitCallExpr(), SemaBuiltinAddressof(), SemaBuiltinMemChkCall(), and clang::Sema::SemaBuiltinShuffleVector().
unsigned clang::CallExpr::getNumArgs | ( | ) | const [inline] |
getNumArgs - Return the number of actual arguments to this call.
Definition at line 2207 of file Expr.h.
Referenced by arg_end(), checkArgCount(), DecodeOperatorCall(), clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), EmitAArch64TblBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCommonNeonBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitPPCBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitX86BuiltinExpr(), EvaluateBuiltinClassifyType(), findCapturingExpr(), getArgumentValueString(), clang::UserDefinedLiteral::getLiteralOperatorKind(), getLocEnd(), getLocStart(), clang::ento::SimpleFunctionCall::getNumArgs(), getPrintfFormatArgumentNum(), getRawSubExprs(), clang::consumed::ConsumedStmtVisitor::handleCall(), clang::Expr::isUnusedResultAWarning(), SemaBuiltinMemChkCall(), clang::Sema::SemaBuiltinShuffleVector(), setNumArgs(), clang::consumed::ConsumedStmtVisitor::VisitCallExpr(), and clang::threadSafety::BuildLockset::VisitCallExpr().
unsigned clang::CallExpr::getNumCommas | ( | ) | const [inline] |
unsigned clang::CallExpr::getNumPreArgs | ( | ) | const [inline, protected] |
Definition at line 2181 of file Expr.h.
References clang::Stmt::CallExprBits.
Referenced by arg_begin(), arg_end(), children(), getArg(), getArgs(), getPreArg(), getRawSubExprs(), setArg(), setNumArgs(), and setPreArg().
Stmt* clang::CallExpr::getPreArg | ( | unsigned | i | ) | [inline, protected] |
Definition at line 2168 of file Expr.h.
References getNumPreArgs().
Referenced by clang::CUDAKernelCallExpr::getConfig().
const Stmt* clang::CallExpr::getPreArg | ( | unsigned | i | ) | const [inline, protected] |
Definition at line 2172 of file Expr.h.
References getNumPreArgs().
ArrayRef<Stmt*> clang::CallExpr::getRawSubExprs | ( | ) | [inline] |
This method provides fast access to all the subexpressions of a CallExpr without going through the slower virtual child_iterator interface. This provides efficient reverse iteration of the subexpressions. This is currently used for CFG construction.
Definition at line 2263 of file Expr.h.
References getNumArgs(), and getNumPreArgs().
SourceLocation clang::CallExpr::getRParenLoc | ( | ) | const [inline] |
Definition at line 2285 of file Expr.h.
Referenced by clang::UserDefinedLiteral::getLocEnd(), getLocEnd(), clang::UserDefinedLiteral::getLocStart(), clang::CXXOperatorCallExpr::getOperatorLoc(), and clang::Sema::SemaBuiltinShuffleVector().
bool CallExpr::isUnevaluatedBuiltinCall | ( | ASTContext & | Ctx | ) | const |
Returns true
if this is a call to a builtin which does not evaluate side-effects within its arguments.
Definition at line 1267 of file Expr.cpp.
References clang::ASTContext::BuiltinInfo, getBuiltinCallee(), and clang::Builtin::Context::isUnevaluated().
Referenced by clang::EvaluatedExprVisitor< ImplClass >::VisitCallExpr().
void clang::CallExpr::setArg | ( | unsigned | Arg, |
Expr * | ArgExpr | ||
) | [inline] |
setArg - Set the specified argument.
Definition at line 2228 of file Expr.h.
References getNumPreArgs().
Referenced by clang::Sema::BuildResolvedCallExpr(), checkBuiltinArgument(), clang::Sema::ConvertArgumentsForCall(), SemaBuiltinAddressof(), and clang::Sema::SemaBuiltinShuffleVector().
void clang::CallExpr::setCallee | ( | Expr * | F | ) | [inline] |
Definition at line 2192 of file Expr.h.
Referenced by clang::Sema::BuildResolvedCallExpr().
void CallExpr::setNumArgs | ( | const 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 1217 of file Expr.cpp.
References AttributeLangSupport::C, clang::ASTContext::Deallocate(), getNumArgs(), and getNumPreArgs().
Referenced by clang::Sema::BuildCallToObjectOfClassType(), and clang::Sema::ConvertArgumentsForCall().
void clang::CallExpr::setPreArg | ( | unsigned | i, |
Stmt * | PreArg | ||
) | [inline, protected] |
Definition at line 2176 of file Expr.h.
References getNumPreArgs().
Referenced by clang::CUDAKernelCallExpr::setConfig().
void clang::CallExpr::setRParenLoc | ( | SourceLocation | L | ) | [inline] |