clang API Documentation
#include "BodyFarm.h"
#include "clang/Analysis/CodeInjector.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprObjC.h"
#include "llvm/ADT/StringSwitch.h"
Go to the source code of this file.
Typedefs | |
typedef Stmt *(* | FunctionFarmer )(ASTContext &C, const FunctionDecl *D) |
Functions | |
static bool | isDispatchBlock (QualType Ty) |
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 Stmt * | createObjCPropertyGetter (ASTContext &Ctx, const ObjCPropertyDecl *Prop) |
typedef Stmt*(* FunctionFarmer)(ASTContext &C, const FunctionDecl *D) |
Definition at line 171 of file BodyFarm.cpp.
static Stmt* create_dispatch_once | ( | ASTContext & | C, |
const FunctionDecl * | D | ||
) | [static] |
Create a fake body for dispatch_once.
Definition at line 174 of file BodyFarm.cpp.
References AttributeLangSupport::C, clang::IntegerLiteral::Create(), clang::Type::getAs(), clang::FunctionDecl::getParamDecl(), clang::PointerType::getPointeeType(), clang::ValueDecl::getType(), clang::ASTContext::getTypeSize(), clang::ASTContext::IntTy, isDispatchBlock(), clang::Type::isIntegerType(), clang::OK_Ordinary, clang::FunctionDecl::param_size(), clang::UO_LNot, clang::VK_RValue, and clang::ASTContext::VoidTy.
Referenced by clang::BodyFarm::getBody().
static Stmt* create_dispatch_sync | ( | ASTContext & | C, |
const FunctionDecl * | D | ||
) | [static] |
Create a fake body for dispatch_sync.
Definition at line 250 of file BodyFarm.cpp.
References AttributeLangSupport::C, clang::FunctionDecl::getParamDecl(), clang::ValueDecl::getType(), isDispatchBlock(), clang::FunctionDecl::param_size(), clang::VK_RValue, and clang::ASTContext::VoidTy.
Referenced by clang::BodyFarm::getBody().
static Stmt* create_OSAtomicCompareAndSwap | ( | ASTContext & | C, |
const FunctionDecl * | D | ||
) | [static] |
Construct the If.
Definition at line 276 of file BodyFarm.cpp.
References clang::BO_EQ, AttributeLangSupport::C, 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().
Referenced by clang::BodyFarm::getBody().
static Stmt* createObjCPropertyGetter | ( | ASTContext & | Ctx, |
const ObjCPropertyDecl * | Prop | ||
) | [static] |
Definition at line 389 of file BodyFarm.cpp.
References clang::ObjCIvarDecl::getContainingInterface(), clang::ObjCPropertyDecl::getGetterMethodDecl(), clang::ObjCInterfaceDecl::getImplementation(), clang::QualType::getNonReferenceType(), clang::ObjCPropertyDecl::getPropertyAttributes(), clang::ObjCPropertyDecl::getPropertyIvarDecl(), 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 bool isDispatchBlock | ( | QualType | Ty | ) | [static] |
Definition at line 29 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().