clang
8.0.0
|
#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 ObjCPropertyDecl *Prop) |
#define DEBUG_TYPE "body-farm" |
Definition at line 28 of file BodyFarm.cpp.
typedef Stmt*(* FunctionFarmer) (ASTContext &C, const FunctionDecl *D) |
Definition at line 248 of file BodyFarm.cpp.
|
static |
Create a fake body for std::call_once.
Emulates the following function body:
Definition at line 318 of file BodyFarm.cpp.
References clang::FunctionDecl::getParamDecl(), and clang::FunctionDecl::param_size().
|
static |
Definition at line 250 of file BodyFarm.cpp.
|
static |
Definition at line 276 of file BodyFarm.cpp.
|
static |
Create a fake body for dispatch_once.
Definition at line 478 of file BodyFarm.cpp.
References clang::C, clang::IfStmt::Create(), clang::CallExpr::Create(), clang::Type::getAs(), clang::FunctionDecl::getParamDecl(), clang::PointerType::getPointeeType(), clang::ValueDecl::getType(), isDispatchBlock(), clang::Type::isIntegerType(), clang::ASTContext::LongTy, clang::None, clang::OK_Ordinary, clang::FunctionDecl::param_size(), clang::VK_RValue, and clang::ASTContext::VoidTy.
|
static |
Create a fake body for dispatch_sync.
Definition at line 561 of file BodyFarm.cpp.
References clang::CallExpr::Create(), clang::FunctionDecl::getParamDecl(), clang::ValueDecl::getType(), isDispatchBlock(), clang::None, clang::FunctionDecl::param_size(), clang::VK_RValue, and clang::ASTContext::VoidTy.
|
static |
Construct the If.
Definition at line 587 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 742 of file BodyFarm.cpp.
References findBackingIvar(), clang::ObjCIvarDecl::getContainingInterface(), clang::ObjCPropertyDecl::getGetterMethodDecl(), clang::ObjCInterfaceDecl::getImplementation(), clang::QualType::getNonReferenceType(), clang::ObjCPropertyDecl::getPropertyAttributes(), clang::ObjCMethodDecl::getSelfDecl(), clang::ValueDecl::getType(), clang::ObjCPropertyDecl::getType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Type::isObjCLifetimeType(), clang::Type::isReferenceType(), clang::QualType::isTriviallyCopyableType(), clang::ObjCPropertyDecl::OBJC_PR_weak, and clang::ObjCImplDecl::property_impls().
Referenced by clang::BodyFarm::getBody().
|
static |
Definition at line 703 of file BodyFarm.cpp.
References clang::ObjCPropertyDecl::getPropertyIvarDecl(), and clang::ObjCPropertyDecl::isReadOnly().
Referenced by createObjCPropertyGetter().
Definition at line 36 of file BodyFarm.cpp.
References clang::C, clang::Type::getAs(), clang::FunctionProtoType::getNumParams(), clang::BlockPointerType::getPointeeType(), clang::FunctionType::getReturnType(), clang::Type::isVoidType(), and clang::VK_LValue.
Referenced by create_dispatch_once(), and create_dispatch_sync().