clang: lib/Analysis/BodyFarm.cpp File Reference (original) (raw)

Go to the source code of this file.

Functions
static bool isDispatchBlock (QualType Ty)
static CallExpr * create_call_once_funcptr_call (ASTContext &C, ASTMaker M, const ParmVarDecl *Callback, ArrayRef< Expr * > CallArgs)
static CallExpr * create_call_once_lambda_call (ASTContext &C, ASTMaker M, const ParmVarDecl *Callback, CXXRecordDecl *CallbackDecl, ArrayRef< Expr * > CallArgs)
static Stmt * create_std_move_forward (ASTContext &C, const FunctionDecl *D)
Create a fake body for 'std::move' or 'std::forward'.
static Stmt * create_call_once (ASTContext &C, const FunctionDecl *D)
Create a fake body for std::call_once.
static Stmt * create_dispatch_once (ASTContext &C, const FunctionDecl *D)
Create a fake body for dispatch_once.
static Stmt * create_dispatch_sync (ASTContext &C, const FunctionDecl *D)
Create a fake body for dispatch_sync.
static Stmt * create_OSAtomicCompareAndSwap (ASTContext &C, const FunctionDecl *D)
static const ObjCIvarDecl * findBackingIvar (const ObjCPropertyDecl *Prop)
static Stmt * createObjCPropertyGetter (ASTContext &Ctx, const ObjCMethodDecl *MD)

DEBUG_TYPE

#define DEBUG_TYPE "body-farm"

FunctionFarmer

create_call_once()

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

void call_once(once_flag& o, Callable func) {

if (!o.__state) {

func();

}

o.__state = 1;

}

Definition at line 346 of file BodyFarm.cpp.

References clang::C, clang::UnaryOperator::Create(), clang::IfStmt::Create(), create_call_once_funcptr_call(), create_call_once_lambda_call(), D, clang::Type::getAs(), clang::Type::getAsCXXRecordDecl(), clang::Type::getAsRecordDecl(), clang::QualType::getCanonicalType(), clang::CXXRecordDecl::getLambdaCallOperator(), clang::QualType::getNonReferenceType(), clang::FunctionProtoType::getNumParams(), clang::FunctionProtoType::getParamType(), clang::Type::getPointeeType(), clang::ValueDecl::getType(), clang::CXXRecordDecl::isLambda(), clang::QualType::isNull(), clang::Type::isReferenceType(), clang::OK_Ordinary, and clang::VK_PRValue.

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

create_call_once_funcptr_call()

create_call_once_lambda_call()

create_dispatch_once()

Create a fake body for dispatch_once.

Definition at line 508 of file BodyFarm.cpp.

References Block, clang::C, clang::UnaryOperator::Create(), clang::CallExpr::Create(), clang::IfStmt::Create(), D, clang::Type::getAs(), clang::PointerType::getPointeeType(), clang::ValueDecl::getType(), clang::If, isDispatchBlock(), clang::Type::isIntegerType(), clang::OK_Ordinary, and clang::VK_PRValue.

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

create_dispatch_sync()

create_OSAtomicCompareAndSwap()

create_std_move_forward()

createObjCPropertyGetter()

Definition at line 785 of file BodyFarm.cpp.

References findBackingIvar(), clang::ObjCMethodDecl::findPropertyDecl(), clang::ObjCMethodDecl::getClassInterface(), clang::ObjCIvarDecl::getContainingInterface(), clang::ObjCInterfaceDecl::getImplementation(), clang::QualType::getNonReferenceType(), clang::ObjCPropertyDecl::getPropertyAttributes(), clang::ObjCPropertyDecl::getPropertyIvarDecl(), clang::ObjCMethodDecl::getReturnType(), clang::ObjCMethodDecl::getSelector(), clang::ObjCMethodDecl::getSelfDecl(), clang::ValueDecl::getType(), clang::ObjCPropertyDecl::getType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Type::isObjCLifetimeType(), clang::Type::isReferenceType(), clang::ObjCMethodDecl::isSynthesizedAccessorStub(), clang::QualType::isTriviallyCopyableType(), clang::ObjCPropertyAttribute::kind_weak, and clang::ObjCImplDecl::property_impls().

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

findBackingIvar()

isDispatchBlock()