clang API Documentation

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
clang::CallExpr Class Reference

#include <Expr.h>

Inheritance diagram for clang::CallExpr:
Inheritance graph
[legend]
Collaboration diagram for clang::CallExpr:
Collaboration graph
[legend]

List of all members.

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 ExprgetCallee () const
ExprgetCallee ()
void setCallee (Expr *F)
DeclgetCalleeDecl ()
const DeclgetCalleeDecl () const
FunctionDeclgetDirectCallee ()
 If the callee is a FunctionDecl, return it. Otherwise return 0.
const FunctionDeclgetDirectCallee () const
unsigned getNumArgs () const
Expr ** getArgs ()
 Retrieve the call arguments.
const Expr *const * getArgs () const
ExprgetArg (unsigned Arg)
 getArg - Return the specified argument.
const ExprgetArg (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)
StmtgetPreArg (unsigned i)
const StmtgetPreArg (unsigned i) const
void setPreArg (unsigned i, Stmt *PreArg)
unsigned getNumPreArgs () const

Detailed Description

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.

Definition at line 2154 of file Expr.h.


Member Typedef Documentation

Definition at line 2241 of file Expr.h.

Definition at line 2238 of file Expr.h.

typedef llvm::iterator_range<arg_iterator> clang::CallExpr::arg_range

Definition at line 2240 of file Expr.h.

Definition at line 2239 of file Expr.h.


Constructor & Destructor Documentation

CallExpr::CallExpr ( const ASTContext C,
StmtClass  SC,
Expr fn,
unsigned  NumPreArgs,
ArrayRef< Expr * >  args,
QualType  t,
ExprValueKind  VK,
SourceLocation  rparenloc 
) [protected]
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 
)
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.


Member Function Documentation

Definition at line 2252 of file Expr.h.

References getNumPreArgs().

Definition at line 2255 of file Expr.h.

References getNumArgs(), and getNumPreArgs().

Definition at line 2243 of file Expr.h.

References arg_begin(), and arg_end().

Definition at line 2244 of file Expr.h.

References arg_begin(), and arg_end().

Reimplemented from clang::Stmt.

Definition at line 2297 of file Expr.h.

References getNumPreArgs().

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.

Definition at line 2291 of file Expr.h.

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().

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]

Definition at line 2213 of file Expr.h.

References getArgs().

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 2191 of file Expr.h.

const Decl* clang::CallExpr::getCalleeDecl ( ) const [inline]

Definition at line 2195 of file Expr.h.

References getCalleeDecl().

Definition at line 2201 of file Expr.h.

References getDirectCallee().

getNumCommas - Return the number of commas that must have been present in this function call.

Definition at line 2270 of file Expr.h.

unsigned clang::CallExpr::getNumPreArgs ( ) const [inline, protected]
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().

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]
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().

Definition at line 2286 of file Expr.h.


The documentation for this class was generated from the following files: