clang
13.0.0git
|
#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"
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 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_call_once (ASTContext &C, const FunctionDecl *D) |
Create a fake body for std::call_once. More... | |
static Stmt * | create_dispatch_once (ASTContext &C, const FunctionDecl *D) |
Create a fake body for dispatch_once. More... | |
static Stmt * | create_dispatch_sync (ASTContext &C, const FunctionDecl *D) |
Create a fake body for dispatch_sync. More... | |
static Stmt * | create_OSAtomicCompareAndSwap (ASTContext &C, const FunctionDecl *D) |
static const ObjCIvarDecl * | findBackingIvar (const ObjCPropertyDecl *Prop) |
static Stmt * | createObjCPropertyGetter (ASTContext &Ctx, const ObjCMethodDecl *MD) |
#define DEBUG_TYPE "body-farm" |
Definition at line 27 of file BodyFarm.cpp.
typedef Stmt*(* FunctionFarmer) (ASTContext &C, const FunctionDecl *D) |
Definition at line 243 of file BodyFarm.cpp.
|
static |
Create a fake body for std::call_once.
Emulates the following function body:
Definition at line 314 of file BodyFarm.cpp.
References clang::FunctionDecl::getParamDecl(), and clang::FunctionDecl::param_size().
|
static |
Definition at line 245 of file BodyFarm.cpp.
|
static |
Definition at line 271 of file BodyFarm.cpp.
|
static |
Create a fake body for dispatch_once.
Definition at line 477 of file BodyFarm.cpp.
References clang::Block, clang::IfStmt::Create(), clang::UnaryOperator::Create(), clang::CallExpr::Create(), clang::Type::getAs(), clang::FunctionDecl::getParamDecl(), clang::PointerType::getPointeeType(), clang::ValueDecl::getType(), isDispatchBlock(), clang::Type::isIntegerType(), clang::OK_Ordinary, clang::FunctionDecl::param_size(), and clang::VK_RValue.
|
static |
Create a fake body for dispatch_sync.
Definition at line 562 of file BodyFarm.cpp.
References clang::CallExpr::Create(), clang::FunctionDecl::getParamDecl(), clang::ValueDecl::getType(), isDispatchBlock(), clang::FunctionDecl::param_size(), and clang::VK_RValue.
|
static |
Construct the If.
Definition at line 588 of file BodyFarm.cpp.
References clang::IfStmt::Create(), clang::Type::getAs(), clang::FunctionDecl::getParamDecl(), clang::PointerType::getPointeeType(), clang::FunctionDecl::getReturnType(), clang::ValueDecl::getType(), clang::Type::isBooleanType(), clang::Type::isIntegralType(), and clang::FunctionDecl::param_size().
|
static |
Definition at line 743 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().
|
static |
Definition at line 704 of file BodyFarm.cpp.
References clang::ObjCPropertyDecl::getPropertyIvarDecl(), and clang::ObjCPropertyDecl::isReadOnly().
Referenced by createObjCPropertyGetter().
Definition at line 35 of file BodyFarm.cpp.
References clang::Type::getAs(), clang::FunctionProtoType::getNumParams(), clang::BlockPointerType::getPointeeType(), clang::FunctionType::getReturnType(), and clang::Type::isVoidType().
Referenced by create_dispatch_once(), and create_dispatch_sync().