clang  3.7.0
Typedefs | Functions
CGObjC.cpp File Reference
#include "CGDebugInfo.h"
#include "CGObjCRuntime.h"
#include "CodeGenFunction.h"
#include "CodeGenModule.h"
#include "TargetInfo.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/StmtObjC.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/CodeGen/CGFunctionInfo.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/InlineAsm.h"
Include dependency graph for CGObjC.cpp:

Go to the source code of this file.

Typedefs

typedef llvm::PointerIntPair
< llvm::Value *, 1, bool
TryEmitResult
 

Functions

static TryEmitResult tryEmitARCRetainScalarExpr (CodeGenFunction &CGF, const Expr *e)
 
static RValue AdjustObjCObjectType (CodeGenFunction &CGF, QualType ExpT, RValue Result)
 Adjust the type of an Objective-C object that doesn't match up due to type erasure at various points, e.g., related result types or the use of parameterized classes. More...
 
static llvm::Constant * getNullForVariable (llvm::Value *addr)
 
static bool shouldExtendReceiverForInnerPointerMessage (const ObjCMessageExpr *message)
 
static llvm::ValueemitARCRetainLoadOfScalar (CodeGenFunction &CGF, LValue lvalue, QualType type)
 
static void emitStructGetterCall (CodeGenFunction &CGF, ObjCIvarDecl *ivar, bool isAtomic, bool hasStrong)
 
static bool hasUnalignedAtomics (llvm::Triple::ArchType arch)
 
static CharUnits getMaxAtomicAccessSize (CodeGenModule &CGM, llvm::Triple::ArchType arch)
 
static bool hasTrivialGetExpr (const ObjCPropertyImplDecl *propImpl)
 
static void emitCPPObjectAtomicGetterCall (CodeGenFunction &CGF, llvm::Value *returnAddr, ObjCIvarDecl *ivar, llvm::Constant *AtomicHelperFn)
 
static void emitStructSetterCall (CodeGenFunction &CGF, ObjCMethodDecl *OMD, ObjCIvarDecl *ivar)
 
static void emitCPPObjectAtomicSetterCall (CodeGenFunction &CGF, ObjCMethodDecl *OMD, ObjCIvarDecl *ivar, llvm::Constant *AtomicHelperFn)
 
static bool hasTrivialSetExpr (const ObjCPropertyImplDecl *PID)
 
static bool UseOptimizedSetter (CodeGenModule &CGM)
 
static void destroyARCStrongWithStore (CodeGenFunction &CGF, llvm::Value *addr, QualType type)
 Like CodeGenFunction::destroyARCStrong, but do it with a call. More...
 
static void emitCXXDestructMethod (CodeGenFunction &CGF, ObjCImplementationDecl *impl)
 
static llvm::Constant * createARCRuntimeFunction (CodeGenModule &CGM, llvm::FunctionType *type, StringRef fnName)
 
static llvm::ValueemitARCValueOperation (CodeGenFunction &CGF, llvm::Value *value, llvm::Constant *&fn, StringRef fnName, bool isTailCall=false)
 
static llvm::ValueemitARCLoadOperation (CodeGenFunction &CGF, llvm::Value *addr, llvm::Constant *&fn, StringRef fnName)
 
static llvm::ValueemitARCStoreOperation (CodeGenFunction &CGF, llvm::Value *addr, llvm::Value *value, llvm::Constant *&fn, StringRef fnName, bool ignored)
 
static void emitARCCopyOperation (CodeGenFunction &CGF, llvm::Value *dst, llvm::Value *src, llvm::Constant *&fn, StringRef fnName)
 
static TryEmitResult tryEmitARCRetainLoadOfScalar (CodeGenFunction &CGF, LValue lvalue, QualType type)
 
static TryEmitResult tryEmitARCRetainLoadOfScalar (CodeGenFunction &CGF, const Expr *e)
 
static llvm::ValueemitARCRetainAfterCall (CodeGenFunction &CGF, llvm::Value *value)
 
static llvm::ValueemitARCRetainCall (CodeGenFunction &CGF, const Expr *e)
 
static bool shouldEmitSeparateBlockRetain (const Expr *e)
 
static TryEmitResult tryEmitARCRetainPseudoObject (CodeGenFunction &CGF, const PseudoObjectExpr *E)
 

Typedef Documentation

typedef llvm::PointerIntPair<llvm::Value*,1,bool> TryEmitResult

Definition at line 31 of file CGObjC.cpp.

Function Documentation

static RValue AdjustObjCObjectType ( CodeGenFunction CGF,
QualType  ET,
RValue  Result 
)
static

Adjust the type of an Objective-C object that doesn't match up due to type erasure at various points, e.g., related result types or the use of parameterized classes.

Definition at line 253 of file CGObjC.cpp.

References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::ConvertType(), clang::CodeGen::RValue::get(), clang::CodeGen::RValue::getScalarVal(), and clang::Type::isObjCRetainableType().

Referenced by clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr().

static llvm::Constant* createARCRuntimeFunction ( CodeGenModule CGM,
llvm::FunctionType *  type,
StringRef  fnName 
)
static
static void destroyARCStrongWithStore ( CodeGenFunction CGF,
llvm::Value addr,
QualType  type 
)
static

Like CodeGenFunction::destroyARCStrong, but do it with a call.

Definition at line 1330 of file CGObjC.cpp.

References clang::CodeGen::CodeGenFunction::EmitARCStoreStrongCall(), and getNullForVariable().

Referenced by emitCXXDestructMethod().

static void emitARCCopyOperation ( CodeGenFunction CGF,
llvm::Value dst,
llvm::Value src,
llvm::Constant *&  fn,
StringRef  fnName 
)
static
static llvm::Value* emitARCLoadOperation ( CodeGenFunction CGF,
llvm::Value addr,
llvm::Constant *&  fn,
StringRef  fnName 
)
static
static llvm::Value * emitARCRetainAfterCall ( CodeGenFunction CGF,
llvm::Value value 
)
static
static llvm::Value* emitARCRetainCall ( CodeGenFunction CGF,
const Expr e 
)
static

Given that the given expression is some sort of call (which does not return retained), emit a retain following it.

Definition at line 2442 of file CGObjC.cpp.

References emitARCRetainAfterCall(), and clang::CodeGen::CodeGenFunction::EmitScalarExpr().

Referenced by tryEmitARCRetainScalarExpr().

static llvm::Value * emitARCRetainLoadOfScalar ( CodeGenFunction CGF,
LValue  lvalue,
QualType  type 
)
static
static llvm::Value* emitARCStoreOperation ( CodeGenFunction CGF,
llvm::Value addr,
llvm::Value value,
llvm::Constant *&  fn,
StringRef  fnName,
bool  ignored 
)
static
static llvm::Value* emitARCValueOperation ( CodeGenFunction CGF,
llvm::Value value,
llvm::Constant *&  fn,
StringRef  fnName,
bool  isTailCall = false 
)
static
static void emitCPPObjectAtomicGetterCall ( CodeGenFunction CGF,
llvm::Value returnAddr,
ObjCIvarDecl ivar,
llvm::Constant *  AtomicHelperFn 
)
static
static void emitCPPObjectAtomicSetterCall ( CodeGenFunction CGF,
ObjCMethodDecl OMD,
ObjCIvarDecl ivar,
llvm::Constant *  AtomicHelperFn 
)
static
static void emitCXXDestructMethod ( CodeGenFunction CGF,
ObjCImplementationDecl impl 
)
static
static void emitStructGetterCall ( CodeGenFunction CGF,
ObjCIvarDecl ivar,
bool  isAtomic,
bool  hasStrong 
)
static
static void emitStructSetterCall ( CodeGenFunction CGF,
ObjCMethodDecl OMD,
ObjCIvarDecl ivar 
)
static
static CharUnits getMaxAtomicAccessSize ( CodeGenModule CGM,
llvm::Triple::ArchType  arch 
)
static

Return the maximum size that permits atomic accesses for the given architecture.

Definition at line 576 of file CGObjC.cpp.

References clang::CharUnits::fromQuantity(), and clang::CodeGen::CodeGenTypeCache::PointerSizeInBytes.

static llvm::Constant* getNullForVariable ( llvm::Value addr)
static

Given the address of a variable of pointer type, find the correct null to store into it.

Definition at line 40 of file CGObjC.cpp.

References getElementType(), and clang::ast_matchers::type.

Referenced by destroyARCStrongWithStore(), clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr(), and tryEmitARCRetainLoadOfScalar().

static bool hasTrivialGetExpr ( const ObjCPropertyImplDecl propImpl)
static
static bool hasTrivialSetExpr ( const ObjCPropertyImplDecl PID)
static
static bool hasUnalignedAtomics ( llvm::Triple::ArchType  arch)
static

Determine whether the given architecture supports unaligned atomic accesses. They don't have to be fast, just faster than a function call and a mutex.

Definition at line 568 of file CGObjC.cpp.

static bool shouldEmitSeparateBlockRetain ( const Expr e)
static

Determine whether it might be important to emit a separate objc_retain_block on the result of the given expression, or whether it's okay to just emit it in a +1 context.

Definition at line 2489 of file CGObjC.cpp.

References clang::CK_AnyPointerToBlockPointerCast, clang::CK_ARCConsumeObject, clang::CK_ARCProduceObject, clang::CK_ARCReclaimReturnedObject, clang::CK_BitCast, clang::CK_LValueToRValue, clang::CK_NoOp, clang::Expr::getType(), clang::Expr::IgnoreParens(), and clang::Type::isBlockPointerType().

Referenced by clang::CodeGen::CodeGenFunction::EmitARCExtendBlockObject(), and tryEmitARCRetainScalarExpr().

static bool shouldExtendReceiverForInnerPointerMessage ( const ObjCMessageExpr message)
static
static TryEmitResult tryEmitARCRetainLoadOfScalar ( CodeGenFunction CGF,
LValue  lvalue,
QualType  type 
)
static
static TryEmitResult tryEmitARCRetainLoadOfScalar ( CodeGenFunction CGF,
const Expr e 
)
static
static TryEmitResult tryEmitARCRetainPseudoObject ( CodeGenFunction CGF,
const PseudoObjectExpr E 
)
static
static TryEmitResult tryEmitARCRetainScalarExpr ( CodeGenFunction CGF,
const Expr e 
)
static
static bool UseOptimizedSetter ( CodeGenModule CGM)
static