clang  6.0.0svn
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/OperatorKinds.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/Debug.h"
Include dependency graph for BodyFarm.cpp:

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_call_once (ASTContext &C, const FunctionDecl *D)
 Create a fake body for std::call_once. More...
 
static Stmtcreate_dispatch_once (ASTContext &C, const FunctionDecl *D)
 Create a fake body for dispatch_once. More...
 
static Stmtcreate_dispatch_sync (ASTContext &C, const FunctionDecl *D)
 Create a fake body for dispatch_sync. More...
 
static Stmtcreate_OSAtomicCompareAndSwap (ASTContext &C, const FunctionDecl *D)
 
static const ObjCIvarDeclfindBackingIvar (const ObjCPropertyDecl *Prop)
 
static StmtcreateObjCPropertyGetter (ASTContext &Ctx, const ObjCPropertyDecl *Prop)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "body-farm"

Definition at line 28 of file BodyFarm.cpp.

Typedef Documentation

◆ FunctionFarmer

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

Definition at line 248 of file BodyFarm.cpp.

Function Documentation

◆ create_call_once()

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

Create a fake body for std::call_once.

Emulates the following function body:

typedef struct once_flag_s {
unsigned long __state = 0;
} once_flag;
template<class Callable>
void call_once(once_flag& o, Callable func) {
if (!o.__state) {
func();
}
o.__state = 1;
}

Definition at line 315 of file BodyFarm.cpp.

References clang::FunctionDecl::getParamDecl(), and clang::FunctionDecl::param_size().

◆ create_call_once_funcptr_call()

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

Definition at line 250 of file BodyFarm.cpp.

◆ 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

Definition at line 273 of file BodyFarm.cpp.

◆ 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_OSAtomicCompareAndSwap()

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

◆ createObjCPropertyGetter()

static Stmt* createObjCPropertyGetter ( ASTContext Ctx,
const ObjCPropertyDecl Prop 
)
static

◆ findBackingIvar()

static const ObjCIvarDecl* findBackingIvar ( const ObjCPropertyDecl Prop)
static

◆ isDispatchBlock()

static bool isDispatchBlock ( QualType  Ty)
static