clang 20.0.0git
Macros | Typedefs | Functions
BodyFarm.cpp File Reference
#include "clang/Analysis/BodyFarm.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/Decl.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprObjC.h"
#include "clang/AST/NestedNameSpecifier.h"
#include "clang/Analysis/CodeInjector.h"
#include "clang/Basic/Builtins.h"
#include "clang/Basic/OperatorKinds.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/Debug.h"
#include <optional>

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "body-farm"
 

Typedefs

typedef Stmt *(* FunctionFarmer) (ASTContext &C, const FunctionDecl *D)
 

Functions

static bool isDispatchBlock (QualType Ty)
 
static CallExprcreate_call_once_funcptr_call (ASTContext &C, ASTMaker M, const ParmVarDecl *Callback, ArrayRef< Expr * > CallArgs)
 
static CallExprcreate_call_once_lambda_call (ASTContext &C, ASTMaker M, const ParmVarDecl *Callback, CXXRecordDecl *CallbackDecl, ArrayRef< Expr * > CallArgs)
 
static Stmtcreate_std_move_forward (ASTContext &C, const FunctionDecl *D)
 Create a fake body for 'std::move' or 'std::forward'.
 
static Stmtcreate_call_once (ASTContext &C, const FunctionDecl *D)
 Create a fake body for std::call_once.
 
static Stmtcreate_dispatch_once (ASTContext &C, const FunctionDecl *D)
 Create a fake body for dispatch_once.
 
static Stmtcreate_dispatch_sync (ASTContext &C, const FunctionDecl *D)
 Create a fake body for dispatch_sync.
 
static Stmtcreate_OSAtomicCompareAndSwap (ASTContext &C, const FunctionDecl *D)
 
static const ObjCIvarDeclfindBackingIvar (const ObjCPropertyDecl *Prop)
 
static StmtcreateObjCPropertyGetter (ASTContext &Ctx, const ObjCMethodDecl *MD)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "body-farm"

Definition at line 29 of file BodyFarm.cpp.

Typedef Documentation

◆ FunctionFarmer

typedef Stmt *(* FunctionFarmer) (ASTContext &C, const FunctionDecl *D)

Definition at line 259 of file BodyFarm.cpp.

Function Documentation

◆ create_call_once()

static Stmt * create_call_once ( ASTContext C,
const FunctionDecl D 
)
static

◆ create_call_once_funcptr_call()

static CallExpr * create_call_once_funcptr_call ( ASTContext C,
ASTMaker  M,
const ParmVarDecl Callback,
ArrayRef< Expr * >  CallArgs 
)
static

◆ create_call_once_lambda_call()

static CallExpr * create_call_once_lambda_call ( ASTContext C,
ASTMaker  M,
const ParmVarDecl Callback,
CXXRecordDecl CallbackDecl,
ArrayRef< Expr * >  CallArgs 
)
static

◆ create_dispatch_once()

static Stmt * create_dispatch_once ( ASTContext C,
const FunctionDecl D 
)
static

◆ create_dispatch_sync()

static Stmt * create_dispatch_sync ( ASTContext C,
const FunctionDecl D 
)
static

Create a fake body for dispatch_sync.

Definition at line 592 of file BodyFarm.cpp.

References clang::C, clang::CallExpr::Create(), D, clang::ValueDecl::getType(), isDispatchBlock(), and clang::VK_PRValue.

Referenced by clang::BodyFarm::getBody().

◆ create_OSAtomicCompareAndSwap()

static Stmt * create_OSAtomicCompareAndSwap ( ASTContext C,
const FunctionDecl D 
)
static

◆ create_std_move_forward()

static Stmt * create_std_move_forward ( ASTContext C,
const FunctionDecl D 
)
static

Create a fake body for 'std::move' or 'std::forward'.

This is just:

return static_cast<return_type>(param);

Definition at line 320 of file BodyFarm.cpp.

References clang::C, and D.

Referenced by clang::BodyFarm::getBody().

◆ createObjCPropertyGetter()

static Stmt * createObjCPropertyGetter ( ASTContext Ctx,
const ObjCMethodDecl MD 
)
static

◆ findBackingIvar()

static const ObjCIvarDecl * findBackingIvar ( const ObjCPropertyDecl Prop)
static

◆ isDispatchBlock()

static bool isDispatchBlock ( QualType  Ty)
static