clang API Documentation

Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends
clang::CodeGen::CodeGenFunction Class Reference

#include <CodeGenFunction.h>

Inheritance diagram for clang::CodeGen::CodeGenFunction:
Inheritance graph
[legend]
Collaboration diagram for clang::CodeGen::CodeGenFunction:
Collaboration graph
[legend]

List of all members.

Classes

class  AutoVarEmission
struct  BreakContinue
class  ConditionalEvaluation
 An object to manage conditionally-evaluated expressions. More...
class  ConstantEmission
class  FinallyInfo
 A class controlling the emission of a finally block. More...
struct  JumpDest
class  LexicalScope
class  OpaqueValueMapping
 An RAII object to set (and then clear) a mapping for an OpaqueValueExpr. More...
class  OpaqueValueMappingData
class  PeepholeProtection
class  RunCleanupsScope
 Enters a new scope for capturing cleanups, all of which will be executed once the scope is exited. More...
class  StmtExprEvaluation

Public Types

typedef std::pair< llvm::Value
*, llvm::Value * > 
ComplexPairTy
typedef void Destroyer (CodeGenFunction &CGF, llvm::Value *addr, QualType ty)
typedef llvm::SmallPtrSet
< const CXXRecordDecl *, 4 > 
VisitedVirtualBasesSetTy
typedef void SpecialInitFn (CodeGenFunction &Init, const VarDecl &D, llvm::Value *Address)

Public Member Functions

llvm::BasicBlock * EmitLandingPad ()
 Emits a landing pad for the current EH stack.
llvm::BasicBlock * getInvokeDestImpl ()
template<class T >
DominatingValue< T >::saved_type saveValueInCond (T value)
template<class T , class A0 >
void pushFullExprCleanup (CleanupKind kind, A0 a0)
template<class T , class A0 , class A1 >
void pushFullExprCleanup (CleanupKind kind, A0 a0, A1 a1)
template<class T , class A0 , class A1 , class A2 >
void pushFullExprCleanup (CleanupKind kind, A0 a0, A1 a1, A2 a2)
template<class T , class A0 , class A1 , class A2 , class A3 >
void pushFullExprCleanup (CleanupKind kind, A0 a0, A1 a1, A2 a2, A3 a3)
void initFullExprCleanup ()
void PushDestructorCleanup (QualType T, llvm::Value *Addr)
void PushDestructorCleanup (const CXXDestructorDecl *Dtor, llvm::Value *Addr)
void PopCleanupBlock (bool FallThroughIsBranchThrough=false)
void DeactivateCleanupBlock (EHScopeStack::stable_iterator Cleanup, llvm::Instruction *DominatingIP)
 Deactive a cleanup that was created in an active state.
void ActivateCleanupBlock (EHScopeStack::stable_iterator Cleanup, llvm::Instruction *DominatingIP)
 Activate a cleanup that was created in an inactivated state.
void PopCleanupBlocks (EHScopeStack::stable_iterator OldCleanupStackSize)
 Pops cleanup blocks until the given savepoint is reached.
void ResolveBranchFixups (llvm::BasicBlock *Target)
JumpDest getJumpDestInCurrentScope (llvm::BasicBlock *Target)
JumpDest getJumpDestInCurrentScope (StringRef Name=StringRef())
void EmitBranchThroughCleanup (JumpDest Dest)
bool isObviouslyBranchWithoutCleanups (JumpDest Dest) const
void popCatchScope ()
llvm::BasicBlock * getEHResumeBlock ()
llvm::BasicBlock * getEHDispatchBlock (EHScopeStack::stable_iterator scope)
bool isInConditionalBranch () const
void setBeforeOutermostConditional (llvm::Value *value, llvm::Value *addr)
unsigned getByRefValueLLVMField (const ValueDecl *VD) const
llvm::ValueBuildBlockByrefAddress (llvm::Value *BaseAddr, const VarDecl *V)
 CodeGenFunction (CodeGenModule &cgm)
 ~CodeGenFunction ()
CodeGenTypesgetTypes () const
ASTContextgetContext () const
CGDebugInfogetDebugInfo ()
void disableDebugInfo ()
void enableDebugInfo ()
bool shouldUseFusedARCCalls ()
const LangOptionsgetLangOpts () const
llvm::ValuegetExceptionSlot ()
llvm::ValuegetEHSelectorSlot ()
llvm::ValuegetExceptionFromSlot ()
llvm::ValuegetSelectorFromSlot ()
llvm::ValuegetNormalCleanupDestSlot ()
llvm::BasicBlock * getUnreachableBlock ()
llvm::BasicBlock * getInvokeDest ()
llvm::LLVMContext & getLLVMContext ()
void pushIrregularPartialArrayCleanup (llvm::Value *arrayBegin, llvm::Value *arrayEndPointer, QualType elementType, Destroyer *destroyer)
void pushRegularPartialArrayCleanup (llvm::Value *arrayBegin, llvm::Value *arrayEnd, QualType elementType, Destroyer *destroyer)
void pushDestroy (QualType::DestructionKind dtorKind, llvm::Value *addr, QualType type)
 pushDestroy - Push the standard destructor for the given type.
void pushDestroy (CleanupKind kind, llvm::Value *addr, QualType type, Destroyer *destroyer, bool useEHCleanupForArray)
void emitDestroy (llvm::Value *addr, QualType type, Destroyer *destroyer, bool useEHCleanupForArray)
llvm::Function * generateDestroyHelper (llvm::Constant *addr, QualType type, Destroyer *destroyer, bool useEHCleanupForArray)
void emitArrayDestroy (llvm::Value *begin, llvm::Value *end, QualType type, Destroyer *destroyer, bool checkZeroLength, bool useEHCleanup)
DestroyergetDestroyer (QualType::DestructionKind destructionKind)
bool needsEHCleanup (QualType::DestructionKind kind)
CleanupKind getCleanupKind (QualType::DestructionKind kind)
void GenerateObjCMethod (const ObjCMethodDecl *OMD)
void StartObjCMethod (const ObjCMethodDecl *MD, const ObjCContainerDecl *CD, SourceLocation StartLoc)
void GenerateObjCGetter (ObjCImplementationDecl *IMP, const ObjCPropertyImplDecl *PID)
 GenerateObjCGetter - Synthesize an Objective-C property getter function.
void generateObjCGetterBody (const ObjCImplementationDecl *classImpl, const ObjCPropertyImplDecl *propImpl, llvm::Constant *AtomicHelperFn)
void GenerateObjCCtorDtorMethod (ObjCImplementationDecl *IMP, ObjCMethodDecl *MD, bool ctor)
void GenerateObjCSetter (ObjCImplementationDecl *IMP, const ObjCPropertyImplDecl *PID)
void generateObjCSetterBody (const ObjCImplementationDecl *classImpl, const ObjCPropertyImplDecl *propImpl, llvm::Constant *AtomicHelperFn)
bool IndirectObjCSetterArg (const CGFunctionInfo &FI)
bool IvarTypeWithAggrGCObjects (QualType Ty)
llvm::ValueEmitBlockLiteral (const BlockExpr *)
 Emit a block literal expression in the current function.
llvm::ValueEmitBlockLiteral (const CGBlockInfo &Info)
llvm::Constant * BuildDescriptorBlockDecl (const BlockExpr *, const CGBlockInfo &Info, llvm::StructType *, llvm::Constant *BlockVarLayout)
llvm::Function * GenerateBlockFunction (GlobalDecl GD, const CGBlockInfo &Info, const Decl *OuterFuncDecl, const DeclMapTy &ldm, bool IsLambdaConversionToBlock)
llvm::Constant * GenerateCopyHelperFunction (const CGBlockInfo &blockInfo)
llvm::Constant * GenerateDestroyHelperFunction (const CGBlockInfo &blockInfo)
llvm::Constant * GenerateObjCAtomicSetterCopyHelperFunction (const ObjCPropertyImplDecl *PID)
llvm::Constant * GenerateObjCAtomicGetterCopyHelperFunction (const ObjCPropertyImplDecl *PID)
llvm::ValueEmitBlockCopyAndAutorelease (llvm::Value *Block, QualType Ty)
void BuildBlockRelease (llvm::Value *DeclPtr, BlockFieldFlags flags)
void emitByrefStructureInit (const AutoVarEmission &emission)
void enterByrefCleanup (const AutoVarEmission &emission)
llvm::ValueLoadBlockStruct ()
void AllocateBlockCXXThisPointer (const CXXThisExpr *E)
void AllocateBlockDecl (const DeclRefExpr *E)
llvm::ValueGetAddrOfBlockDecl (const VarDecl *var, bool ByRef)
llvm::Type * BuildByRefType (const VarDecl *var)
void GenerateCode (GlobalDecl GD, llvm::Function *Fn, const CGFunctionInfo &FnInfo)
void StartFunction (GlobalDecl GD, QualType RetTy, llvm::Function *Fn, const CGFunctionInfo &FnInfo, const FunctionArgList &Args, SourceLocation StartLoc)
void EmitConstructorBody (FunctionArgList &Args)
 EmitConstructorBody - Emits the body of the current constructor.
void EmitDestructorBody (FunctionArgList &Args)
 EmitDestructorBody - Emits the body of the current destructor.
void EmitFunctionBody (FunctionArgList &Args)
void EmitForwardingCallToLambda (const CXXRecordDecl *Lambda, CallArgList &CallArgs)
void EmitLambdaToBlockPointerBody (FunctionArgList &Args)
void EmitLambdaBlockInvokeBody ()
void EmitLambdaDelegatingInvokeBody (const CXXMethodDecl *MD)
void EmitLambdaStaticInvokeFunction (const CXXMethodDecl *MD)
void EmitReturnBlock ()
void FinishFunction (SourceLocation EndLoc=SourceLocation())
void GenerateThunk (llvm::Function *Fn, const CGFunctionInfo &FnInfo, GlobalDecl GD, const ThunkInfo &Thunk)
 GenerateThunk - Generate a thunk for the given method.
void GenerateVarArgsThunk (llvm::Function *Fn, const CGFunctionInfo &FnInfo, GlobalDecl GD, const ThunkInfo &Thunk)
void EmitCtorPrologue (const CXXConstructorDecl *CD, CXXCtorType Type, FunctionArgList &Args)
void EmitInitializerForField (FieldDecl *Field, LValue LHS, Expr *Init, ArrayRef< VarDecl * > ArrayIndexes)
void InitializeVTablePointer (BaseSubobject Base, const CXXRecordDecl *NearestVBase, CharUnits OffsetFromNearestVBase, llvm::Constant *VTable, const CXXRecordDecl *VTableClass)
void InitializeVTablePointers (BaseSubobject Base, const CXXRecordDecl *NearestVBase, CharUnits OffsetFromNearestVBase, bool BaseIsNonVirtualPrimaryBase, llvm::Constant *VTable, const CXXRecordDecl *VTableClass, VisitedVirtualBasesSetTy &VBases)
void InitializeVTablePointers (const CXXRecordDecl *ClassDecl)
llvm::ValueGetVTablePtr (llvm::Value *This, llvm::Type *Ty)
void EnterDtorCleanups (const CXXDestructorDecl *Dtor, CXXDtorType Type)
bool ShouldInstrumentFunction ()
void EmitFunctionInstrumentation (const char *Fn)
void EmitMCountInstrumentation ()
 EmitMCountInstrumentation - Emit call to .mcount.
void EmitFunctionProlog (const CGFunctionInfo &FI, llvm::Function *Fn, const FunctionArgList &Args)
void EmitFunctionEpilog (const CGFunctionInfo &FI)
void EmitStartEHSpec (const Decl *D)
 EmitStartEHSpec - Emit the start of the exception spec.
void EmitEndEHSpec (const Decl *D)
 EmitEndEHSpec - Emit the end of the exception spec.
llvm::BasicBlock * getTerminateLandingPad ()
 getTerminateLandingPad - Return a landing pad that just calls terminate.
llvm::BasicBlock * getTerminateHandler ()
llvm::Type * ConvertTypeForMem (QualType T)
llvm::Type * ConvertType (QualType T)
llvm::Type * ConvertType (const TypeDecl *T)
llvm::ValueLoadObjCSelf ()
QualType TypeOfSelfObject ()
 TypeOfSelfObject - Return type of object that this self represents.
llvm::BasicBlock * createBasicBlock (StringRef name="", llvm::Function *parent=0, llvm::BasicBlock *before=0)
 createBasicBlock - Create an LLVM basic block.
JumpDest getJumpDestForLabel (const LabelDecl *S)
void SimplifyForwardingBlocks (llvm::BasicBlock *BB)
void EmitBlock (llvm::BasicBlock *BB, bool IsFinished=false)
void EmitBlockAfterUses (llvm::BasicBlock *BB)
void EmitBranch (llvm::BasicBlock *Block)
bool HaveInsertPoint () const
void EnsureInsertPoint ()
void ErrorUnsupported (const Stmt *S, const char *Type, bool OmitOnError=false)
LValue MakeAddrLValue (llvm::Value *V, QualType T, CharUnits Alignment=CharUnits())
LValue MakeNaturalAlignAddrLValue (llvm::Value *V, QualType T)
llvm::AllocaInst * CreateTempAlloca (llvm::Type *Ty, const Twine &Name="tmp")
void InitTempAlloca (llvm::AllocaInst *Alloca, llvm::Value *Value)
 InitTempAlloca - Provide an initial value for the given alloca.
llvm::AllocaInst * CreateIRTemp (QualType T, const Twine &Name="tmp")
llvm::AllocaInst * CreateMemTemp (QualType T, const Twine &Name="tmp")
AggValueSlot CreateAggTemp (QualType T, const Twine &Name="tmp")
llvm::ValueEmitCastToVoidPtr (llvm::Value *value)
 Emit a cast to void* in the appropriate address space.
llvm::ValueEvaluateExprAsBool (const Expr *E)
void EmitIgnoredExpr (const Expr *E)
 EmitIgnoredExpr - Emit an expression in a context which ignores the result.
RValue EmitAnyExpr (const Expr *E, AggValueSlot AggSlot=AggValueSlot::ignored(), bool IgnoreResult=false)
llvm::ValueEmitVAListRef (const Expr *E)
RValue EmitAnyExprToTemp (const Expr *E)
void EmitAnyExprToMem (const Expr *E, llvm::Value *Location, Qualifiers Quals, bool IsInitializer)
void EmitExprAsInit (const Expr *init, const ValueDecl *D, LValue lvalue, bool capturedByInit)
void EmitAggregateCopy (llvm::Value *DestPtr, llvm::Value *SrcPtr, QualType EltTy, bool isVolatile=false, unsigned Alignment=0)
void StartBlock (const char *N)
llvm::Constant * GetAddrOfStaticLocalVar (const VarDecl *BVD)
 GetAddrOfStaticLocalVar - Return the address of a static local variable.
llvm::ValueGetAddrOfLocalVar (const VarDecl *VD)
 GetAddrOfLocalVar - Return the address of a local variable.
const LValuegetOpaqueLValueMapping (const OpaqueValueExpr *e)
const RValuegetOpaqueRValueMapping (const OpaqueValueExpr *e)
llvm::BlockAddress * GetAddrOfLabel (const LabelDecl *L)
llvm::BasicBlock * GetIndirectGotoBlock ()
void EmitNullInitialization (llvm::Value *DestPtr, QualType Ty)
llvm::ValueEmitVAArg (llvm::Value *VAListAddr, QualType Ty)
llvm::ValueemitArrayLength (const ArrayType *arrayType, QualType &baseType, llvm::Value *&addr)
void EmitVariablyModifiedType (QualType Ty)
std::pair< llvm::Value
*, QualType
getVLASize (const VariableArrayType *vla)
std::pair< llvm::Value
*, QualType
getVLASize (QualType vla)
llvm::ValueLoadCXXThis ()
llvm::ValueLoadCXXVTT ()
llvm::ValueGetAddressOfDirectBaseInCompleteClass (llvm::Value *Value, const CXXRecordDecl *Derived, const CXXRecordDecl *Base, bool BaseIsVirtual)
llvm::ValueGetAddressOfBaseClass (llvm::Value *Value, const CXXRecordDecl *Derived, CastExpr::path_const_iterator PathBegin, CastExpr::path_const_iterator PathEnd, bool NullCheckValue)
llvm::ValueGetAddressOfDerivedClass (llvm::Value *Value, const CXXRecordDecl *Derived, CastExpr::path_const_iterator PathBegin, CastExpr::path_const_iterator PathEnd, bool NullCheckValue)
llvm::ValueGetVirtualBaseClassOffset (llvm::Value *This, const CXXRecordDecl *ClassDecl, const CXXRecordDecl *BaseClassDecl)
void EmitDelegateCXXConstructorCall (const CXXConstructorDecl *Ctor, CXXCtorType CtorType, const FunctionArgList &Args)
void EmitDelegatingCXXConstructorCall (const CXXConstructorDecl *Ctor, const FunctionArgList &Args)
void EmitCXXConstructorCall (const CXXConstructorDecl *D, CXXCtorType Type, bool ForVirtualBase, llvm::Value *This, CallExpr::const_arg_iterator ArgBeg, CallExpr::const_arg_iterator ArgEnd)
void EmitSynthesizedCXXCopyCtorCall (const CXXConstructorDecl *D, llvm::Value *This, llvm::Value *Src, CallExpr::const_arg_iterator ArgBeg, CallExpr::const_arg_iterator ArgEnd)
void EmitCXXAggrConstructorCall (const CXXConstructorDecl *D, const ConstantArrayType *ArrayTy, llvm::Value *ArrayPtr, CallExpr::const_arg_iterator ArgBeg, CallExpr::const_arg_iterator ArgEnd, bool ZeroInitialization=false)
void EmitCXXAggrConstructorCall (const CXXConstructorDecl *D, llvm::Value *NumElements, llvm::Value *ArrayPtr, CallExpr::const_arg_iterator ArgBeg, CallExpr::const_arg_iterator ArgEnd, bool ZeroInitialization=false)
void EmitCXXDestructorCall (const CXXDestructorDecl *D, CXXDtorType Type, bool ForVirtualBase, llvm::Value *This)
void EmitNewArrayInitializer (const CXXNewExpr *E, QualType elementType, llvm::Value *NewPtr, llvm::Value *NumElements)
void EmitCXXTemporary (const CXXTemporary *Temporary, QualType TempType, llvm::Value *Ptr)
 Emits all the code to cause the given temporary to be cleaned up.
llvm::ValueEmitCXXNewExpr (const CXXNewExpr *E)
void EmitCXXDeleteExpr (const CXXDeleteExpr *E)
void EmitDeleteCall (const FunctionDecl *DeleteFD, llvm::Value *Ptr, QualType DeleteTy)
llvm::ValueEmitCXXTypeidExpr (const CXXTypeidExpr *E)
llvm::ValueEmitDynamicCast (llvm::Value *V, const CXXDynamicCastExpr *DCE)
void MaybeEmitStdInitializerListCleanup (llvm::Value *loc, const Expr *init)
void EmitStdInitializerListCleanup (llvm::Value *loc, const InitListExpr *init)
void EmitCheck (llvm::Value *, unsigned Size)
llvm::ValueEmitScalarPrePostIncDec (const UnaryOperator *E, LValue LV, bool isInc, bool isPre)
ComplexPairTy EmitComplexPrePostIncDec (const UnaryOperator *E, LValue LV, bool isInc, bool isPre)
void EmitDecl (const Decl &D)
void EmitVarDecl (const VarDecl &D)
void EmitScalarInit (const Expr *init, const ValueDecl *D, LValue lvalue, bool capturedByInit)
void EmitScalarInit (llvm::Value *init, LValue lvalue)
 EmitScalarInit - Initialize the given lvalue with the given object.
void EmitAutoVarDecl (const VarDecl &D)
AutoVarEmission EmitAutoVarAlloca (const VarDecl &var)
void EmitAutoVarInit (const AutoVarEmission &emission)
void EmitAutoVarCleanups (const AutoVarEmission &emission)
void emitAutoVarTypeCleanup (const AutoVarEmission &emission, QualType::DestructionKind dtorKind)
 Enter a destroy cleanup for the given local variable.
void EmitStaticVarDecl (const VarDecl &D, llvm::GlobalValue::LinkageTypes Linkage)
void EmitParmDecl (const VarDecl &D, llvm::Value *Arg, unsigned ArgNo)
 EmitParmDecl - Emit a ParmVarDecl or an ImplicitParamDecl.
PeepholeProtection protectFromPeepholes (RValue rvalue)
void unprotectFromPeepholes (PeepholeProtection protection)
void EmitStopPoint (const Stmt *S)
 EmitStopPoint - Emit a debug stoppoint if we are emitting debug info.
void EmitStmt (const Stmt *S)
bool EmitSimpleStmt (const Stmt *S)
RValue EmitCompoundStmt (const CompoundStmt &S, bool GetLast=false, AggValueSlot AVS=AggValueSlot::ignored())
void EmitLabel (const LabelDecl *D)
void EmitLabelStmt (const LabelStmt &S)
void EmitAttributedStmt (const AttributedStmt &S)
void EmitGotoStmt (const GotoStmt &S)
void EmitIndirectGotoStmt (const IndirectGotoStmt &S)
void EmitIfStmt (const IfStmt &S)
void EmitWhileStmt (const WhileStmt &S)
void EmitDoStmt (const DoStmt &S)
void EmitForStmt (const ForStmt &S)
void EmitReturnStmt (const ReturnStmt &S)
void EmitDeclStmt (const DeclStmt &S)
void EmitBreakStmt (const BreakStmt &S)
void EmitContinueStmt (const ContinueStmt &S)
void EmitSwitchStmt (const SwitchStmt &S)
void EmitDefaultStmt (const DefaultStmt &S)
void EmitCaseStmt (const CaseStmt &S)
void EmitCaseStmtRange (const CaseStmt &S)
void EmitAsmStmt (const AsmStmt &S)
void EmitObjCForCollectionStmt (const ObjCForCollectionStmt &S)
void EmitObjCAtTryStmt (const ObjCAtTryStmt &S)
void EmitObjCAtThrowStmt (const ObjCAtThrowStmt &S)
void EmitObjCAtSynchronizedStmt (const ObjCAtSynchronizedStmt &S)
void EmitObjCAutoreleasePoolStmt (const ObjCAutoreleasePoolStmt &S)
llvm::Constant * getUnwindResumeFn ()
llvm::Constant * getUnwindResumeOrRethrowFn ()
void EnterCXXTryStmt (const CXXTryStmt &S, bool IsFnTryBlock=false)
void ExitCXXTryStmt (const CXXTryStmt &S, bool IsFnTryBlock=false)
void EmitCXXTryStmt (const CXXTryStmt &S)
void EmitCXXForRangeStmt (const CXXForRangeStmt &S)
RValue GetUndefRValue (QualType Ty)
 GetUndefRValue - Get an appropriate 'undef' rvalue for the given type.
RValue EmitUnsupportedRValue (const Expr *E, const char *Name)
LValue EmitUnsupportedLValue (const Expr *E, const char *Name)
LValue EmitLValue (const Expr *E)
LValue EmitCheckedLValue (const Expr *E)
llvm::ValueEmitToMemory (llvm::Value *Value, QualType Ty)
llvm::ValueEmitFromMemory (llvm::Value *Value, QualType Ty)
llvm::ValueEmitLoadOfScalar (llvm::Value *Addr, bool Volatile, unsigned Alignment, QualType Ty, llvm::MDNode *TBAAInfo=0)
llvm::ValueEmitLoadOfScalar (LValue lvalue)
void EmitStoreOfScalar (llvm::Value *Value, llvm::Value *Addr, bool Volatile, unsigned Alignment, QualType Ty, llvm::MDNode *TBAAInfo=0, bool isInit=false)
void EmitStoreOfScalar (llvm::Value *value, LValue lvalue, bool isInit=false)
RValue EmitLoadOfLValue (LValue V)
RValue EmitLoadOfExtVectorElementLValue (LValue V)
RValue EmitLoadOfBitfieldLValue (LValue LV)
void EmitStoreThroughLValue (RValue Src, LValue Dst, bool isInit=false)
void EmitStoreThroughExtVectorComponentLValue (RValue Src, LValue Dst)
void EmitStoreThroughBitfieldLValue (RValue Src, LValue Dst, llvm::Value **Result=0)
LValue EmitComplexAssignmentLValue (const BinaryOperator *E)
 Emit an l-value for an assignment (simple or compound) of complex type.
LValue EmitComplexCompoundAssignmentLValue (const CompoundAssignOperator *E)
LValue EmitBinaryOperatorLValue (const BinaryOperator *E)
LValue EmitCompoundAssignmentLValue (const CompoundAssignOperator *E)
LValue EmitCallExprLValue (const CallExpr *E)
LValue EmitVAArgExprLValue (const VAArgExpr *E)
LValue EmitDeclRefLValue (const DeclRefExpr *E)
LValue EmitStringLiteralLValue (const StringLiteral *E)
LValue EmitObjCEncodeExprLValue (const ObjCEncodeExpr *E)
LValue EmitPredefinedLValue (const PredefinedExpr *E)
LValue EmitUnaryOpLValue (const UnaryOperator *E)
LValue EmitArraySubscriptExpr (const ArraySubscriptExpr *E)
LValue EmitExtVectorElementExpr (const ExtVectorElementExpr *E)
LValue EmitMemberExpr (const MemberExpr *E)
LValue EmitObjCIsaExpr (const ObjCIsaExpr *E)
LValue EmitCompoundLiteralLValue (const CompoundLiteralExpr *E)
LValue EmitInitListLValue (const InitListExpr *E)
LValue EmitConditionalOperatorLValue (const AbstractConditionalOperator *E)
LValue EmitCastLValue (const CastExpr *E)
LValue EmitNullInitializationLValue (const CXXScalarValueInitExpr *E)
LValue EmitMaterializeTemporaryExpr (const MaterializeTemporaryExpr *E)
LValue EmitOpaqueValueLValue (const OpaqueValueExpr *e)
RValue EmitRValueForField (LValue LV, const FieldDecl *FD)
ConstantEmission tryEmitAsConstant (DeclRefExpr *refExpr)
RValue EmitPseudoObjectRValue (const PseudoObjectExpr *e, AggValueSlot slot=AggValueSlot::ignored())
LValue EmitPseudoObjectLValue (const PseudoObjectExpr *e)
llvm::ValueEmitIvarOffset (const ObjCInterfaceDecl *Interface, const ObjCIvarDecl *Ivar)
LValue EmitLValueForAnonRecordField (llvm::Value *Base, const IndirectFieldDecl *Field, unsigned CVRQualifiers)
LValue EmitLValueForField (LValue Base, const FieldDecl *Field)
LValue EmitLValueForFieldInitialization (LValue Base, const FieldDecl *Field)
LValue EmitLValueForIvar (QualType ObjectTy, llvm::Value *Base, const ObjCIvarDecl *Ivar, unsigned CVRQualifiers)
LValue EmitLValueForBitfield (llvm::Value *Base, const FieldDecl *Field, unsigned CVRQualifiers)
LValue EmitCXXConstructLValue (const CXXConstructExpr *E)
LValue EmitCXXBindTemporaryLValue (const CXXBindTemporaryExpr *E)
LValue EmitLambdaLValue (const LambdaExpr *E)
LValue EmitCXXTypeidLValue (const CXXTypeidExpr *E)
LValue EmitObjCMessageExprLValue (const ObjCMessageExpr *E)
LValue EmitObjCIvarRefLValue (const ObjCIvarRefExpr *E)
LValue EmitStmtExprLValue (const StmtExpr *E)
LValue EmitPointerToDataMemberBinaryExpr (const BinaryOperator *E)
LValue EmitObjCSelectorLValue (const ObjCSelectorExpr *E)
void EmitDeclRefExprDbgValue (const DeclRefExpr *E, llvm::Constant *Init)
RValue EmitCall (const CGFunctionInfo &FnInfo, llvm::Value *Callee, ReturnValueSlot ReturnValue, const CallArgList &Args, const Decl *TargetDecl=0, llvm::Instruction **callOrInvoke=0)
RValue EmitCall (QualType FnType, llvm::Value *Callee, ReturnValueSlot ReturnValue, CallExpr::const_arg_iterator ArgBeg, CallExpr::const_arg_iterator ArgEnd, const Decl *TargetDecl=0)
RValue EmitCallExpr (const CallExpr *E, ReturnValueSlot ReturnValue=ReturnValueSlot())
llvm::CallSite EmitCallOrInvoke (llvm::Value *Callee, ArrayRef< llvm::Value * > Args, const Twine &Name="")
llvm::CallSite EmitCallOrInvoke (llvm::Value *Callee, const Twine &Name="")
llvm::ValueBuildVirtualCall (const CXXMethodDecl *MD, llvm::Value *This, llvm::Type *Ty)
llvm::ValueBuildVirtualCall (const CXXDestructorDecl *DD, CXXDtorType Type, llvm::Value *This, llvm::Type *Ty)
llvm::ValueBuildAppleKextVirtualCall (const CXXMethodDecl *MD, NestedNameSpecifier *Qual, llvm::Type *Ty)
llvm::ValueBuildAppleKextVirtualDestructorCall (const CXXDestructorDecl *DD, CXXDtorType Type, const CXXRecordDecl *RD)
RValue EmitCXXMemberCall (const CXXMethodDecl *MD, llvm::Value *Callee, ReturnValueSlot ReturnValue, llvm::Value *This, llvm::Value *VTT, CallExpr::const_arg_iterator ArgBeg, CallExpr::const_arg_iterator ArgEnd)
RValue EmitCXXMemberCallExpr (const CXXMemberCallExpr *E, ReturnValueSlot ReturnValue)
RValue EmitCXXMemberPointerCallExpr (const CXXMemberCallExpr *E, ReturnValueSlot ReturnValue)
llvm::ValueEmitCXXOperatorMemberCallee (const CXXOperatorCallExpr *E, const CXXMethodDecl *MD, llvm::Value *This)
RValue EmitCXXOperatorMemberCallExpr (const CXXOperatorCallExpr *E, const CXXMethodDecl *MD, ReturnValueSlot ReturnValue)
RValue EmitCUDAKernelCallExpr (const CUDAKernelCallExpr *E, ReturnValueSlot ReturnValue)
RValue EmitBuiltinExpr (const FunctionDecl *FD, unsigned BuiltinID, const CallExpr *E)
RValue EmitBlockCallExpr (const CallExpr *E, ReturnValueSlot ReturnValue)
llvm::ValueEmitTargetBuiltinExpr (unsigned BuiltinID, const CallExpr *E)
llvm::ValueEmitARMBuiltinExpr (unsigned BuiltinID, const CallExpr *E)
llvm::ValueEmitNeonCall (llvm::Function *F, SmallVectorImpl< llvm::Value * > &O, const char *name, unsigned shift=0, bool rightshift=false)
llvm::ValueEmitNeonSplat (llvm::Value *V, llvm::Constant *Idx)
llvm::ValueEmitNeonShiftVector (llvm::Value *V, llvm::Type *Ty, bool negateForRightShift)
llvm::ValueBuildVector (ArrayRef< llvm::Value * > Ops)
llvm::ValueEmitX86BuiltinExpr (unsigned BuiltinID, const CallExpr *E)
llvm::ValueEmitHexagonBuiltinExpr (unsigned BuiltinID, const CallExpr *E)
llvm::ValueEmitPPCBuiltinExpr (unsigned BuiltinID, const CallExpr *E)
llvm::ValueEmitObjCProtocolExpr (const ObjCProtocolExpr *E)
llvm::ValueEmitObjCStringLiteral (const ObjCStringLiteral *E)
 Emits an instance of NSConstantString representing the object.
llvm::ValueEmitObjCBoxedExpr (const ObjCBoxedExpr *E)
llvm::ValueEmitObjCArrayLiteral (const ObjCArrayLiteral *E)
llvm::ValueEmitObjCDictionaryLiteral (const ObjCDictionaryLiteral *E)
llvm::ValueEmitObjCCollectionLiteral (const Expr *E, const ObjCMethodDecl *MethodWithObjects)
llvm::ValueEmitObjCSelectorExpr (const ObjCSelectorExpr *E)
 Emit a selector.
RValue EmitObjCMessageExpr (const ObjCMessageExpr *E, ReturnValueSlot Return=ReturnValueSlot())
CleanupKind getARCCleanupKind ()
void EmitARCInitWeak (llvm::Value *value, llvm::Value *addr)
void EmitARCDestroyWeak (llvm::Value *addr)
llvm::ValueEmitARCLoadWeak (llvm::Value *addr)
llvm::ValueEmitARCLoadWeakRetained (llvm::Value *addr)
 i8* (i8** addr)
llvm::ValueEmitARCStoreWeak (llvm::Value *value, llvm::Value *addr, bool ignored)
void EmitARCCopyWeak (llvm::Value *dst, llvm::Value *src)
void EmitARCMoveWeak (llvm::Value *dst, llvm::Value *src)
llvm::ValueEmitARCRetainAutorelease (QualType type, llvm::Value *value)
llvm::ValueEmitARCRetainAutoreleaseNonBlock (llvm::Value *value)
llvm::ValueEmitARCStoreStrong (LValue lvalue, llvm::Value *value, bool ignored)
llvm::ValueEmitARCStoreStrongCall (llvm::Value *addr, llvm::Value *value, bool ignored)
llvm::ValueEmitARCRetain (QualType type, llvm::Value *value)
llvm::ValueEmitARCRetainNonBlock (llvm::Value *value)
llvm::ValueEmitARCRetainBlock (llvm::Value *value, bool mandatory)
void EmitARCRelease (llvm::Value *value, bool precise)
llvm::ValueEmitARCAutorelease (llvm::Value *value)
llvm::ValueEmitARCAutoreleaseReturnValue (llvm::Value *value)
llvm::ValueEmitARCRetainAutoreleaseReturnValue (llvm::Value *value)
llvm::ValueEmitARCRetainAutoreleasedReturnValue (llvm::Value *value)
std::pair< LValue, llvm::Value * > EmitARCStoreAutoreleasing (const BinaryOperator *e)
std::pair< LValue, llvm::Value * > EmitARCStoreStrong (const BinaryOperator *e, bool ignored)
llvm::ValueEmitObjCThrowOperand (const Expr *expr)
llvm::ValueEmitObjCProduceObject (QualType T, llvm::Value *Ptr)
llvm::ValueEmitObjCConsumeObject (QualType T, llvm::Value *Ptr)
llvm::ValueEmitObjCExtendObjectLifetime (QualType T, llvm::Value *Ptr)
llvm::ValueEmitARCExtendBlockObject (const Expr *expr)
llvm::ValueEmitARCRetainScalarExpr (const Expr *expr)
llvm::ValueEmitARCRetainAutoreleaseScalarExpr (const Expr *expr)
void EmitObjCAutoreleasePoolPop (llvm::Value *Ptr)
llvm::ValueEmitObjCAutoreleasePoolPush ()
llvm::ValueEmitObjCMRRAutoreleasePoolPush ()
void EmitObjCAutoreleasePoolCleanup (llvm::Value *Ptr)
void EmitObjCMRRAutoreleasePoolPop (llvm::Value *Ptr)
RValue EmitReferenceBindingToExpr (const Expr *E, const NamedDecl *InitializedDecl)
llvm::ValueEmitScalarExpr (const Expr *E, bool IgnoreResultAssign=false)
llvm::ValueEmitScalarConversion (llvm::Value *Src, QualType SrcTy, QualType DstTy)
llvm::ValueEmitComplexToScalarConversion (ComplexPairTy Src, QualType SrcTy, QualType DstTy)
void EmitAggExpr (const Expr *E, AggValueSlot AS, bool IgnoreResult=false)
LValue EmitAggExprToLValue (const Expr *E)
void EmitGCMemmoveCollectable (llvm::Value *DestPtr, llvm::Value *SrcPtr, QualType Ty)
void EmitExtendGCLifetime (llvm::Value *object)
ComplexPairTy EmitComplexExpr (const Expr *E, bool IgnoreReal=false, bool IgnoreImag=false)
void EmitComplexExprIntoAddr (const Expr *E, llvm::Value *DestAddr, bool DestIsVolatile)
void StoreComplexToAddr (ComplexPairTy V, llvm::Value *DestAddr, bool DestIsVolatile)
 StoreComplexToAddr - Store a complex number into the specified address.
ComplexPairTy LoadComplexFromAddr (llvm::Value *SrcAddr, bool SrcIsVolatile)
 LoadComplexFromAddr - Load a complex number from the specified address.
llvm::GlobalVariable * CreateStaticVarDecl (const VarDecl &D, const char *Separator, llvm::GlobalValue::LinkageTypes Linkage)
llvm::GlobalVariable * AddInitializerToStaticVarDecl (const VarDecl &D, llvm::GlobalVariable *GV)
void EmitCXXGlobalVarDeclInit (const VarDecl &D, llvm::Constant *DeclPtr, bool PerformInit)
void registerGlobalDtorWithAtExit (llvm::Constant *fn, llvm::Constant *addr)
 Register a global destructor using the C atexit runtime function.
void EmitCXXGuardedInit (const VarDecl &D, llvm::GlobalVariable *DeclPtr, bool PerformInit)
void GenerateCXXGlobalInitFunc (llvm::Function *Fn, llvm::Constant **Decls, unsigned NumDecls)
void GenerateCXXGlobalDtorsFunc (llvm::Function *Fn, const std::vector< std::pair< llvm::WeakVH, llvm::Constant * > > &DtorsAndObjects)
void GenerateCXXGlobalVarDeclInitFunc (llvm::Function *Fn, const VarDecl *D, llvm::GlobalVariable *Addr, bool PerformInit)
 Emit the code necessary to initialize the given global variable.
void EmitCXXConstructExpr (const CXXConstructExpr *E, AggValueSlot Dest)
void EmitSynthesizedCXXCopyCtor (llvm::Value *Dest, llvm::Value *Src, const Expr *Exp)
void enterFullExpression (const ExprWithCleanups *E)
void enterNonTrivialFullExpression (const ExprWithCleanups *E)
void EmitCXXThrowExpr (const CXXThrowExpr *E)
void EmitLambdaExpr (const LambdaExpr *E, AggValueSlot Dest)
RValue EmitAtomicExpr (AtomicExpr *E, llvm::Value *Dest=0)
llvm::ValueEmitAnnotationCall (llvm::Value *AnnotationFn, llvm::Value *AnnotatedVal, llvm::StringRef AnnotationStr, SourceLocation Location)
 Emit an annotation call (intrinsic or builtin).
void EmitVarAnnotations (const VarDecl *D, llvm::Value *V)
 Emit local annotations for the local variable V, declared by D.
llvm::ValueEmitFieldAnnotations (const FieldDecl *D, llvm::Value *V)
bool ConstantFoldsToSimpleInteger (const Expr *Cond, bool &Result)
bool ConstantFoldsToSimpleInteger (const Expr *Cond, llvm::APInt &Result)
void EmitBranchOnBoolExpr (const Expr *Cond, llvm::BasicBlock *TrueBlock, llvm::BasicBlock *FalseBlock)
llvm::BasicBlock * getTrapBB ()
void EmitCallArg (CallArgList &args, const Expr *E, QualType ArgType)
 EmitCallArg - Emit a single call argument.
void EmitDelegateCallArg (CallArgList &args, const VarDecl *param)
void SetFPAccuracy (llvm::Value *Val, float Accuracy)

Static Public Member Functions

static void destroyBlockInfos (CGBlockInfo *info)
 Destroy a chain of block layouts.
static bool hasAggregateLLVMType (QualType T)
static unsigned getAccessedFieldNo (unsigned Idx, const llvm::Constant *Elts)
static bool ContainsLabel (const Stmt *S, bool IgnoreCaseStmts=false)
static bool containsBreak (const Stmt *S)

Public Attributes

CodeGenModuleCGM
const TargetInfoTarget
CGBuilderTy Builder
const DeclCurFuncDecl
const DeclCurCodeDecl
 CurCodeDecl - This is the inner-most code context, which includes blocks.
const CGFunctionInfoCurFnInfo
QualType FnRetTy
llvm::Function * CurFn
GlobalDecl CurGD
 CurGD - The GlobalDecl for the current function being compiled.
EHScopeStack::stable_iterator PrologueCleanupDepth
JumpDest ReturnBlock
 ReturnBlock - Unified return block.
llvm::ValueReturnValue
llvm::AssertingVH
< llvm::Instruction > 
AllocaInsertPt
unsigned char BoundsChecking
bool CatchUndefined
 CatchUndefined - Emit run-time checks to catch undefined behaviors.
bool AutoreleaseResult
 In ARC, whether we should autorelease the return value.
const CodeGen::CGBlockInfoBlockInfo
llvm::ValueBlockPointer
llvm::DenseMap< const VarDecl
*, FieldDecl * > 
LambdaCaptureFields
FieldDeclLambdaThisCaptureField
llvm::DenseMap< const VarDecl
*, llvm::Value * > 
NRVOFlags
 A mapping from NRVO variables to the flags used to indicate when the NRVO has been applied to this variable.
EHScopeStack EHStack
llvm::AllocaInst * NormalCleanupDest
 i32s containing the indexes of the cleanup destinations.
unsigned NextCleanupDestIndex
CGBlockInfoFirstBlockInfo
 FirstBlockInfo - The head of a singly-linked-list of block layouts.
llvm::BasicBlock * EHResumeBlock
 EHResumeBlock - Unified block containing a call to llvm.eh.resume.
llvm::ValueExceptionSlot
llvm::AllocaInst * EHSelectorSlot
SmallVector< llvm::Value *, 8 > ObjCEHValueStack

Static Public Attributes

static Destroyer destroyCXXObject
static Destroyer destroyARCStrongImprecise
static Destroyer destroyARCStrongPrecise
static Destroyer destroyARCWeak

Friends

class CGCXXABI

Detailed Description

CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code.

Definition at line 535 of file CodeGenFunction.h.


Member Typedef Documentation

Definition at line 564 of file CodeGenFunction.h.

Definition at line 1251 of file CodeGenFunction.h.

Definition at line 1849 of file CodeGenFunction.h.

Definition at line 1420 of file CodeGenFunction.h.


Constructor & Destructor Documentation

CodeGenFunction::CodeGenFunction ( CodeGenModule cgm)
CodeGenFunction::~CodeGenFunction ( )

Definition at line 48 of file CodeGenFunction.cpp.

References destroyBlockInfos(), and FirstBlockInfo.


Member Function Documentation

void CodeGenFunction::ActivateCleanupBlock ( EHScopeStack::stable_iterator  Cleanup,
llvm::Instruction *  DominatingIP 
)

Activate a cleanup that was created in an inactivated state.

ActivateCleanupBlock - Activates an initially-inactive cleanup. Cannot be used to resurrect a deactivated cleanup.

Parameters:
DominatingIP- An instruction which is known to dominate the current IP (if set) and which lies along all paths of execution between the current IP and the the point at which the cleanup comes into scope.

Definition at line 1056 of file CGCleanup.cpp.

References ForActivation, and SetupCleanupBlockActivation().

llvm::GlobalVariable * CodeGenFunction::AddInitializerToStaticVarDecl ( const VarDecl D,
llvm::GlobalVariable *  GV 
)

AddInitializerToStaticVarDecl - Add the initializer for 'D' to the global variable that has already been created for it. If the initializer has a different type than GV does, this may free GV and return a different one. Otherwise it just returns GV.

Definition at line 212 of file CGDecl.cpp.

References Builder, CGM, clang::frontend::CPlusPlus, clang::CodeGen::CodeGenModule::EmitConstantInit(), EmitCXXGuardedInit(), clang::CodeGen::CodeGenModule::ErrorUnsupported(), clang::CodeGen::CodeGenModule::getContext(), getContext(), clang::VarDecl::getInit(), getLangOpts(), clang::CodeGen::CodeGenModule::getModule(), clang::ASTContext::getTargetAddressSpace(), clang::ValueDecl::getType(), hasNontrivialDestruction(), clang::VarDecl::isThreadSpecified(), and clang::CodeGen::CodeGenModule::isTypeConstant().

Referenced by EmitStaticVarDecl().

void clang::CodeGen::CodeGenFunction::AllocateBlockCXXThisPointer ( const CXXThisExpr E)
void clang::CodeGen::CodeGenFunction::AllocateBlockDecl ( const DeclRefExpr E)
llvm::Value * CodeGenFunction::BuildAppleKextVirtualCall ( const CXXMethodDecl MD,
NestedNameSpecifier Qual,
llvm::Type *  Ty 
)
llvm::Value * CodeGenFunction::BuildAppleKextVirtualDestructorCall ( const CXXDestructorDecl DD,
CXXDtorType  Type,
const CXXRecordDecl RD 
)
llvm::Value * CodeGenFunction::BuildBlockByrefAddress ( llvm::Value BaseAddr,
const VarDecl V 
)

BuildBlockByrefAddress - Computes address location of the variable which is declared as __block.

Definition at line 1813 of file CGBlocks.cpp.

References clang::NamedDecl::getNameAsString().

Referenced by drillIntoBlockVariable(), and EmitDeclRefLValue().

void CodeGenFunction::BuildBlockRelease ( llvm::Value DeclPtr,
BlockFieldFlags  flags 
)
llvm::Type * CodeGenFunction::BuildByRefType ( const VarDecl D)

BuildByRefType - This routine changes a __block variable declared as T x into:

struct { void *__isa; void *__forwarding; int32_t __flags; int32_t __size; void *__copy_helper; // only if needed void *__destroy_helper; // only if needed char padding[X]; // only if needed T x; } x

void *__copy_helper;

void *__destroy_helper;

Definition at line 1836 of file CGBlocks.cpp.

References clang::serialized_diags::create(), clang::ASTContext::getBlockVarCopyInits(), clang::CodeGen::CodeGenModule::getContext(), clang::ASTContext::getDeclAlign(), clang::CodeGen::CodeGenModule::getLLVMContext(), clang::NamedDecl::getNameAsString(), clang::CharUnits::getQuantity(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int8PtrTy, and clang::CodeGen::CodeGenTypeCache::Int8Ty.

Referenced by EmitAutoVarAlloca().

llvm::Constant* clang::CodeGen::CodeGenFunction::BuildDescriptorBlockDecl ( const BlockExpr ,
const CGBlockInfo Info,
llvm::StructType *  ,
llvm::Constant *  BlockVarLayout 
)
llvm::Value * CodeGenFunction::BuildVector ( ArrayRef< llvm::Value * >  Ops)

Definition at line 2223 of file CGBuiltin.cpp.

llvm::Value * CodeGenFunction::BuildVirtualCall ( const CXXMethodDecl MD,
llvm::Value This,
llvm::Type *  Ty 
)
llvm::Value * CodeGenFunction::BuildVirtualCall ( const CXXDestructorDecl DD,
CXXDtorType  Type,
llvm::Value This,
llvm::Type *  Ty 
)
bool CodeGenFunction::ConstantFoldsToSimpleInteger ( const Expr Cond,
bool &  ResultBool 
)

ConstantFoldsToSimpleInteger - If the specified expression does not fold to a constant, or if it does but contains a label, return false. If it constant folds return true and set the boolean result in Result.

Definition at line 538 of file CodeGenFunction.cpp.

Referenced by EmitBranchOnBoolExpr(), EmitConditionalOperatorLValue(), EmitIfStmt(), and EmitSwitchStmt().

bool CodeGenFunction::ConstantFoldsToSimpleInteger ( const Expr Cond,
llvm::APInt &  ResultInt 
)

ConstantFoldsToSimpleInteger - If the specified expression does not fold to a constant, or if it does but contains a label, return false. If it constant folds return true and set the folded value.

Definition at line 552 of file CodeGenFunction.cpp.

References ContainsLabel(), clang::Expr::EvaluateAsInt(), and getContext().

bool CodeGenFunction::containsBreak ( const Stmt S) [static]

containsBreak - Return true if the statement contains a break out of it. If the statement (recursively) contains a switch or loop with a break inside of it, this is fine.

Definition at line 513 of file CodeGenFunction.cpp.

References clang::Stmt::children().

Referenced by CollectStatementsForCase().

bool CodeGenFunction::ContainsLabel ( const Stmt S,
bool  IgnoreCaseStmts = false 
) [static]

ContainsLabel - Return true if the statement contains a label in it. If this statement is not executed normally, it not containing a label means that we can just remove the code.

Definition at line 481 of file CodeGenFunction.cpp.

References clang::Stmt::children().

Referenced by CollectStatementsForCase(), ConstantFoldsToSimpleInteger(), EmitAutoVarInit(), EmitConditionalOperatorLValue(), EmitIfStmt(), EmitStmt(), and FindCaseStatementsForValue().

llvm::Type * CodeGenFunction::ConvertType ( QualType  T)
llvm::Type* clang::CodeGen::CodeGenFunction::ConvertType ( const TypeDecl T) [inline]

Definition at line 1480 of file CodeGenFunction.h.

References ConvertType(), and getContext().

llvm::Type * CodeGenFunction::ConvertTypeForMem ( QualType  T)
AggValueSlot clang::CodeGen::CodeGenFunction::CreateAggTemp ( QualType  T,
const Twine &  Name = "tmp" 
) [inline]
llvm::BasicBlock* clang::CodeGen::CodeGenFunction::createBasicBlock ( StringRef  name = "",
llvm::Function *  parent = 0,
llvm::BasicBlock *  before = 0 
) [inline]
llvm::AllocaInst * CodeGenFunction::CreateIRTemp ( QualType  T,
const Twine &  Name = "tmp" 
)

CreateIRTemp - Create a temporary IR object of the given type, with appropriate alignment. This routine should only be used when an temporary value needs to be stored into an alloca (for example, to avoid explicit PHI construction), but the type is the IR type, not the type appropriate for storing in memory.

Definition at line 64 of file CGExpr.cpp.

References ConvertType(), CreateTempAlloca(), getContext(), clang::CharUnits::getQuantity(), and clang::ASTContext::getTypeAlignInChars().

Referenced by StartFunction().

llvm::AllocaInst * CodeGenFunction::CreateMemTemp ( QualType  T,
const Twine &  Name = "tmp" 
)
llvm::GlobalVariable * CodeGenFunction::CreateStaticVarDecl ( const VarDecl D,
const char *  Separator,
llvm::GlobalValue::LinkageTypes  Linkage 
)
llvm::AllocaInst * CodeGenFunction::CreateTempAlloca ( llvm::Type *  Ty,
const Twine &  Name = "tmp" 
)

CreateTempAlloca - This creates a alloca and inserts it into the entry block. The caller is responsible for setting an appropriate alignment on the alloca.

CreateTempAlloca - This creates a alloca and inserts it into the entry block.

Definition at line 50 of file CGExpr.cpp.

References AllocaInsertPt, and Builder.

Referenced by CreateCoercedLoad(), CreateCoercedStore(), CreateIRTemp(), CreateMemTemp(), EmitAutoVarAlloca(), EmitFunctionProlog(), EmitInitializerForField(), EmitNewArrayInitializer(), EmitParmDecl(), emitWritebackArg(), clang::CodeGen::CodeGenFunction::FinallyInfo::enter(), enterBlockScope(), getEHSelectorSlot(), getExceptionSlot(), InitCatchParam(), initFullExprCleanup(), clang::CodeGen::DominatingLLVMValue::save(), and SetupCleanupBlockActivation().

void CodeGenFunction::DeactivateCleanupBlock ( EHScopeStack::stable_iterator  Cleanup,
llvm::Instruction *  DominatingIP 
)

Deactive a cleanup that was created in an active state.

DeactivateCleanupBlock - Deactivates the given cleanup block. The block cannot be reactivated. Pops it if it's the top of the stack.

Parameters:
DominatingIP- An instruction which is known to dominate the current IP (if set) and which lies along all paths of execution between the current IP and the the point at which the cleanup comes into scope.

Definition at line 1068 of file CGCleanup.cpp.

References ForDeactivation, and SetupCleanupBlockActivation().

Referenced by EmitAnyExprToExn(), EmitCXXNewExpr(), and EmitNewArrayInitializer().

void CodeGenFunction::destroyBlockInfos ( CGBlockInfo info) [static]

Destroy a chain of block layouts.

Definition at line 600 of file CGBlocks.cpp.

References clang::CodeGen::CGBlockInfo::NextBlockInfo.

Referenced by ~CodeGenFunction().

void clang::CodeGen::CodeGenFunction::disableDebugInfo ( ) [inline]

Definition at line 1211 of file CodeGenFunction.h.

Referenced by EmitScalarExpr().

void CodeGenFunction::EmitAggExpr ( const Expr E,
AggValueSlot  Slot,
bool  IgnoreResult = false 
)

EmitAggExpr - Emit the computation of the specified expression of aggregate type. The result is computed into the given slot, which may be null to indicate that the value is not needed.

EmitAggExpr - Emit the computation of the specified expression of aggregate type. The result is computed into DestPtr. Note that if DestPtr is null, the value of the aggregate expression is not needed. If VolatileDest is true, DestPtr cannot be 0.

Parameters:
IsInitializer- true if this evaluation is initializing an object whose lifetime is already being managed.

Definition at line 1170 of file CGExprAgg.cpp.

References CheckAggExprForMemSetUse(), clang::CodeGen::AggValueSlot::getAddr(), clang::Expr::getType(), hasAggregateLLVMType(), and clang::CodeGen::AggValueSlot::isIgnored().

Referenced by EmitAggExprToLValue(), EmitAggMemberInitializer(), EmitAnyExpr(), EmitAnyExprToMem(), EmitAtomicExpr(), EmitBaseInitializer(), EmitCXXBindTemporaryLValue(), EmitCXXConstructExpr(), EmitDeclInit(), EmitDelegatingCXXConstructorCall(), EmitExprAsInit(), emitPseudoObjectExpr(), EmitReturnStmt(), GenerateObjCAtomicGetterCopyHelperFunction(), GenerateObjCCtorDtorMethod(), InitCatchParam(), and StoreAnyExprIntoOneUnit().

LValue CodeGenFunction::EmitAggExprToLValue ( const Expr E)
void CodeGenFunction::EmitAggregateCopy ( llvm::Value DestPtr,
llvm::Value SrcPtr,
QualType  EltTy,
bool  isVolatile = false,
unsigned  Alignment = 0 
)
llvm::Value * CodeGenFunction::EmitAnnotationCall ( llvm::Value AnnotationFn,
llvm::Value AnnotatedVal,
llvm::StringRef  AnnotationStr,
SourceLocation  Location 
)
RValue CodeGenFunction::EmitAnyExpr ( const Expr E,
AggValueSlot  AggSlot = AggValueSlot::ignored(),
bool  IgnoreResult = false 
)

EmitAnyExpr - Emit code to compute the specified expression which can have any type. The result is returned as an RValue struct. If this is an aggregate expression, the aggloc/agglocvolatile arguments indicate where the result should be returned.

Parameters:
IgnoreResult- True if the resulting value isn't used.

EmitAnyExpr - Emit code to compute the specified expression which can have any type. The result is returned as an RValue struct. If this is an aggregate expression, AggSlot indicates where the result should be returned.

Definition at line 111 of file CGExpr.cpp.

References clang::CodeGen::AggValueSlot::asRValue(), EmitAggExpr(), EmitComplexExpr(), EmitScalarExpr(), clang::CodeGen::RValue::get(), clang::CodeGen::RValue::getComplex(), clang::Expr::getType(), and hasAggregateLLVMType().

Referenced by clang::CodeGen::CodeGenFunction::OpaqueValueMappingData::bind(), EmitAnyExprToTemp(), EmitBinaryOperatorLValue(), EmitCompoundStmt(), EmitExprForReferenceBinding(), EmitIgnoredExpr(), EmitObjCBoxedExpr(), emitPseudoObjectExpr(), EmitReturnStmt(), and GenerateObjCAtomicGetterCopyHelperFunction().

void CodeGenFunction::EmitAnyExprToMem ( const Expr E,
llvm::Value Location,
Qualifiers  Quals,
bool  IsInit 
)
RValue CodeGenFunction::EmitAnyExprToTemp ( const Expr E)

EmitAnyExprToTemp - Similary to EmitAnyExpr(), however, the result will always be accessible even if no aggregate location is provided.

Definition at line 124 of file CGExpr.cpp.

References CreateAggTemp(), EmitAnyExpr(), clang::Expr::getType(), hasAggregateLLVMType(), and clang::CodeGen::AggValueSlot::ignored().

Referenced by EmitCallArg(), and EmitStmtExprLValue().

llvm::Value * CodeGenFunction::EmitARCAutorelease ( llvm::Value value)
llvm::Value * CodeGenFunction::EmitARCAutoreleaseReturnValue ( llvm::Value value)

Autorelease the given object. call i8* (i8* value)

Definition at line 2007 of file CGObjC.cpp.

References emitARCValueOperation(), clang::CodeGen::CodeGenModule::getARCEntrypoints(), and clang::CodeGen::ARCEntrypoints::objc_autoreleaseReturnValue.

Referenced by emitAutoreleaseOfResult().

void CodeGenFunction::EmitARCCopyWeak ( llvm::Value dst,
llvm::Value src 
)

void (i8** dest, i8** src) Disregards the current value in dest. Essentially objc_release(objc_initWeak(dest, objc_readWeakRetained(src)))

Definition at line 2125 of file CGObjC.cpp.

References emitARCCopyOperation(), clang::CodeGen::CodeGenModule::getARCEntrypoints(), and clang::CodeGen::ARCEntrypoints::objc_copyWeak.

void CodeGenFunction::EmitARCDestroyWeak ( llvm::Value addr)
llvm::Value * CodeGenFunction::EmitARCExtendBlockObject ( const Expr expr)
void CodeGenFunction::EmitARCInitWeak ( llvm::Value addr,
llvm::Value value 
)

i8* (i8** addr, i8* value) Returns value. addr is known to not have a current weak entry. Essentially equivalent to: addr = nil; objc_storeWeak(addr, value);

Definition at line 2079 of file CGObjC.cpp.

References Builder, emitARCStoreOperation(), clang::CodeGen::CodeGenModule::getARCEntrypoints(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::ARCEntrypoints::objc_initWeak, and clang::CodeGenOptions::OptimizationLevel.

Referenced by EmitParmDecl(), EmitScalarInit(), clang::CodeGen::CGObjCRuntime::EmitTryCatchStmt(), and InitCatchParam().

llvm::Value * CodeGenFunction::EmitARCLoadWeak ( llvm::Value addr)

i8* (i8** addr) Essentially objc_autorelease(objc_loadWeakRetained(addr)).

Definition at line 2052 of file CGObjC.cpp.

References emitARCLoadOperation(), clang::CodeGen::CodeGenModule::getARCEntrypoints(), and clang::CodeGen::ARCEntrypoints::objc_loadWeak.

Referenced by EmitLoadOfLValue().

llvm::Value * CodeGenFunction::EmitARCLoadWeakRetained ( llvm::Value addr)
void CodeGenFunction::EmitARCMoveWeak ( llvm::Value dst,
llvm::Value src 
)

void (i8** dest, i8** src) Disregards the current value in dest. Leaves src pointing to nothing. Essentially (objc_copyWeak(dest, src), objc_destroyWeak(src)).

Definition at line 2116 of file CGObjC.cpp.

References emitARCCopyOperation(), clang::CodeGen::CodeGenModule::getARCEntrypoints(), and clang::CodeGen::ARCEntrypoints::objc_moveWeak.

void CodeGenFunction::EmitARCRelease ( llvm::Value value,
bool  precise 
)
llvm::Value * CodeGenFunction::EmitARCRetain ( QualType  type,
llvm::Value value 
)

Produce the code to do a retain. Based on the type, calls one of: call i8* (i8* value) call i8* (i8* value)

Definition at line 1813 of file CGObjC.cpp.

References EmitARCRetainBlock(), and EmitARCRetainNonBlock().

Referenced by emitARCRetainLoadOfScalar(), EmitARCRetainScalarExpr(), EmitARCStoreStrong(), EmitObjCProduceObject(), and EmitScalarInit().

llvm::Value * CodeGenFunction::EmitARCRetainAutorelease ( QualType  type,
llvm::Value value 
)

Do a fused retain/autorelease of the given object. call i8* (i8* value) or retain = call i8* (i8* value) call i8* (i8* retain)

Definition at line 2027 of file CGObjC.cpp.

References Builder, EmitARCAutorelease(), EmitARCRetainAutoreleaseNonBlock(), EmitARCRetainBlock(), and clang::CodeGen::CodeGenTypeCache::Int8PtrTy.

Referenced by EmitARCRetainAutoreleaseScalarExpr(), EmitObjCExtendObjectLifetime(), EmitObjCMessageExpr(), and EmitScalarInit().

llvm::Value * CodeGenFunction::EmitARCRetainAutoreleasedReturnValue ( llvm::Value value)
llvm::Value * CodeGenFunction::EmitARCRetainAutoreleaseNonBlock ( llvm::Value value)

Do a fused retain/autorelease of the given object. call i8* (i8* value)

Definition at line 2044 of file CGObjC.cpp.

References emitARCValueOperation(), clang::CodeGen::CodeGenModule::getARCEntrypoints(), and clang::CodeGen::ARCEntrypoints::objc_retainAutorelease.

Referenced by EmitARCRetainAutorelease().

llvm::Value * CodeGenFunction::EmitARCRetainAutoreleaseReturnValue ( llvm::Value value)

Do a fused retain/autorelease of the given object. call i8* (i8* value)

Definition at line 2016 of file CGObjC.cpp.

References emitARCValueOperation(), clang::CodeGen::CodeGenModule::getARCEntrypoints(), and clang::CodeGen::ARCEntrypoints::objc_retainAutoreleaseReturnValue.

Referenced by tryEmitFusedAutoreleaseOfResult().

llvm::Value * CodeGenFunction::EmitARCRetainAutoreleaseScalarExpr ( const Expr expr)
llvm::Value * CodeGenFunction::EmitARCRetainBlock ( llvm::Value value,
bool  mandatory 
)

Retain the given block, with _Block_copy semantics. call i8* (i8* value)

Parameters:
mandatory- If false, emit the call with metadata indicating that it's okay for the optimizer to eliminate this call if it can prove that the block never escapes except down the stack.

Definition at line 1834 of file CGObjC.cpp.

References Builder, emitARCValueOperation(), clang::CodeGen::CodeGenModule::getARCEntrypoints(), and clang::CodeGen::ARCEntrypoints::objc_retainBlock.

Referenced by EmitARCExtendBlockObject(), EmitARCRetain(), EmitARCRetainAutorelease(), EmitARCStoreStrong(), and tryEmitARCRetainScalarExpr().

llvm::Value * CodeGenFunction::EmitARCRetainNonBlock ( llvm::Value value)
llvm::Value * CodeGenFunction::EmitARCRetainScalarExpr ( const Expr e)

EmitARCRetainScalarExpr - Semantically equivalent to EmitARCRetainObject(e->getType(), EmitScalarExpr(e)), but making a best-effort attempt to peephole expressions that naturally produce retained objects.

Definition at line 2604 of file CGObjC.cpp.

References EmitARCRetain(), clang::Expr::getType(), and tryEmitARCRetainScalarExpr().

Referenced by clang::CodeGen::CGObjCRuntime::EmitAtSynchronizedStmt(), EmitObjCForCollectionStmt(), and EmitScalarInit().

std::pair< LValue, llvm::Value * > CodeGenFunction::EmitARCStoreAutoreleasing ( const BinaryOperator e)
llvm::Value * CodeGenFunction::EmitARCStoreStrong ( LValue  dst,
llvm::Value newValue,
bool  ignored 
)
std::pair< LValue, llvm::Value * > CodeGenFunction::EmitARCStoreStrong ( const BinaryOperator e,
bool  ignored 
)
llvm::Value * CodeGenFunction::EmitARCStoreStrongCall ( llvm::Value addr,
llvm::Value value,
bool  ignored 
)
llvm::Value * CodeGenFunction::EmitARCStoreWeak ( llvm::Value addr,
llvm::Value value,
bool  ignored 
)

i8* (i8** addr, i8* value) Returns value.

Definition at line 2067 of file CGObjC.cpp.

References emitARCStoreOperation(), clang::CodeGen::CodeGenModule::getARCEntrypoints(), and clang::CodeGen::ARCEntrypoints::objc_storeWeak.

Referenced by EmitScalarInit(), and EmitStoreThroughLValue().

Value * CodeGenFunction::EmitARMBuiltinExpr ( unsigned  BuiltinID,
const CallExpr E 
)
void CodeGenFunction::emitArrayDestroy ( llvm::Value begin,
llvm::Value end,
QualType  type,
Destroyer destroyer,
bool  checkZeroLength,
bool  useEHCleanup 
)

emitArrayDestroy - Destroys all the elements of the given array, beginning from last to first. The array cannot be zero-length.

Parameters:
begin- a type* denoting the first element of the array
end- a type* denoting one past the end of the array
type- the element type of the array
destroyer- the function to call to destroy elements
useEHCleanup- whether to push an EH cleanup to destroy the remaining elements in case the destruction of a single element throws

Definition at line 1288 of file CGDecl.cpp.

References Builder, createBasicBlock(), EmitBlock(), PopCleanupBlock(), pushRegularPartialArrayCleanup(), and clang::CodeGen::CodeGenTypeCache::SizeTy.

Referenced by EmitArrayDelete(), emitDestroy(), and emitPartialArrayDestroy().

llvm::Value * CodeGenFunction::emitArrayLength ( const ArrayType origArrayType,
QualType baseType,
llvm::Value *&  addr 
)

emitArrayLength - Compute the length of an array, even if it's a VLA, and drill down to the base element type.

Computes the length of an array in elements, as well as the base element type and a properly-typed first element pointer.

Definition at line 847 of file CodeGenFunction.cpp.

References Builder, ConvertType(), clang::ASTContext::getAsArrayType(), getContext(), clang::ArrayType::getElementType(), getElementType(), getVLASize(), and clang::CodeGen::CodeGenTypeCache::SizeTy.

Referenced by EmitCXXAggrConstructorCall(), and emitDestroy().

LValue CodeGenFunction::EmitArraySubscriptExpr ( const ArraySubscriptExpr E)
void CodeGenFunction::EmitAsmStmt ( const AsmStmt S)

Definition at line 1398 of file CGStmt.cpp.

References AddVariableConstraints(), clang::TargetCodeGenInfo::adjustInlineAsmType(), clang::TargetInfo::ConstraintInfo::allowsMemory(), clang::TargetInfo::ConstraintInfo::allowsRegister(), clang::AsmStmt::AnalyzeAsmString(), Args, Builder, CGM, ConvertType(), ConvertTypeForMem(), EmitLValue(), EmitStoreThroughLValue(), clang::CodeGen::RValue::get(), clang::CodeGen::LValue::getAddress(), getAsmSrcLocInfo(), clang::AsmStmt::getAsmString(), clang::AsmStmt::getClobber(), clang::TargetInfo::getClobbers(), getContext(), clang::AsmStmt::getInputConstraint(), clang::AsmStmt::getInputExpr(), clang::AsmStmt::getInputName(), getLLVMContext(), clang::TargetInfo::getNormalizedGCCRegisterName(), clang::AsmStmt::getNumClobbers(), clang::AsmStmt::getNumInputs(), clang::AsmStmt::getNumOutputs(), clang::AsmStmt::getOutputConstraint(), clang::AsmStmt::getOutputExpr(), clang::AsmStmt::getOutputName(), clang::StringLiteral::getString(), clang::CodeGen::CodeGenModule::getTargetData(), clang::TargetInfo::ConstraintInfo::getTiedOperand(), clang::Expr::getType(), clang::ASTContext::getTypeSize(), hasAggregateLLVMType(), clang::TargetInfo::ConstraintInfo::hasMatchingInput(), clang::TargetInfo::ConstraintInfo::hasTiedOperand(), clang::Expr::IgnoreParenNoopCasts(), Input, clang::CodeGen::CodeGenTypeCache::IntPtrTy, clang::TargetInfo::ConstraintInfo::isReadWrite(), clang::AsmStmt::isVolatile(), S, SimplifyConstraint(), Target, clang::TargetInfo::validateInputConstraint(), clang::TargetInfo::validateOutputConstraint(), and clang::CodeGen::CodeGenTypeCache::VoidTy.

Referenced by EmitStmt().

RValue CodeGenFunction::EmitAtomicExpr ( AtomicExpr E,
llvm::Value Dest = 0 
)

Definition at line 2824 of file CGExpr.cpp.

References clang::CodeGen::CallArgList::add(), clang::CodeGen::RequiredArgs::All, clang::prec::And, Args, clang::CodeGen::CodeGenTypes::arrangeFunctionCall(), clang::ASTContext::BoolTy, Builder, CGM, ConvertTempToRValue(), createBasicBlock(), CreateMemTemp(), clang::CodeGen::CodeGenModule::CreateRuntimeFunction(), CurFn, clang::CodeGen::AggValueSlot::DoesNotNeedGCBarriers, EmitAggExpr(), EmitAtomicOp(), EmitCall(), EmitCastToVoidPtr(), EmitComplexExprIntoAddr(), EmitScalarExpr(), EmitScalarInit(), EmitStoreOfScalar(), EmitUnsupportedRValue(), EmitValToTemp(), clang::CodeGen::AggValueSlot::forAddr(), clang::CodeGen::RValue::get(), getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), getLLVMContext(), clang::TargetInfo::getMaxAtomicInlineWidth(), clang::AtomicExpr::getNumSubExprs(), clang::AtomicExpr::getOp(), clang::AtomicExpr::getOrder(), clang::AtomicExpr::getOrderFail(), clang::AtomicExpr::getPtr(), clang::QualType::getQualifiers(), clang::CharUnits::getQuantity(), clang::CodeGen::CodeGenModule::getSize(), clang::ASTContext::getTargetInfo(), clang::Expr::getType(), clang::ASTContext::getTypeAlignInChars(), clang::CodeGen::CodeGenModule::getTypes(), clang::ASTContext::getTypeSizeInChars(), clang::AtomicExpr::getVal1(), clang::AtomicExpr::getVal2(), clang::AtomicExpr::getWeak(), hasAggregateLLVMType(), clang::CodeGen::CodeGenTypeCache::IntTy, clang::AtomicExpr::isCmpXChg(), clang::CodeGen::AggValueSlot::IsNotAliased, clang::CodeGen::AggValueSlot::IsNotDestructed, clang::AtomicExpr::isVolatile(), clang::CodeGen::LValue::MakeAddr(), MakeAddrLValue(), clang::CodeGen::CodeGenTypeCache::SizeTy, clang::CodeGen::CodeGenTypeCache::VoidPtrTy, and clang::ASTContext::VoidTy.

void CodeGenFunction::EmitAttributedStmt ( const AttributedStmt S)

Definition at line 338 of file CGStmt.cpp.

References EmitStmt(), and clang::AttributedStmt::getSubStmt().

Referenced by EmitSimpleStmt().

CodeGenFunction::AutoVarEmission CodeGenFunction::EmitAutoVarAlloca ( const VarDecl D)
void CodeGenFunction::EmitAutoVarCleanups ( const AutoVarEmission emission)
void CodeGenFunction::EmitAutoVarDecl ( const VarDecl D)

EmitAutoVarDecl - Emit an auto variable declaration.

This function can be called with a null (unreachable) insert point.

EmitAutoVarDecl - Emit code and set up an entry in LocalDeclMap for a variable declaration with auto, register, or no storage class specifier. These turn into simple stack objects, or GlobalValues depending on target.

Definition at line 755 of file CGDecl.cpp.

References EmitAutoVarAlloca(), EmitAutoVarCleanups(), and EmitAutoVarInit().

Referenced by EmitForStmt(), EmitIfStmt(), EmitInitializerForField(), EmitSwitchStmt(), clang::CodeGen::CGObjCRuntime::EmitTryCatchStmt(), EmitVarDecl(), and EmitWhileStmt().

void CodeGenFunction::EmitAutoVarInit ( const AutoVarEmission emission)
void CodeGenFunction::emitAutoVarTypeCleanup ( const AutoVarEmission emission,
QualType::DestructionKind  dtorKind 
)
LValue CodeGenFunction::EmitBinaryOperatorLValue ( const BinaryOperator E)
void CodeGenFunction::EmitBlock ( llvm::BasicBlock *  BB,
bool  IsFinished = false 
)

EmitBlock - Emit the given block

  • BB and set it as the insert point, adding a fall-through branch from the current insert block if necessary. It is legal to call this function even if there is no current insertion point.

IsFinished - If true, indicates that the caller has finished emitting branches to the given block and does not expect to emit code into it. This means the block can be ignored if it is unreachable.

Definition at line 244 of file CGStmt.cpp.

References Builder, CurFn, and EmitBranch().

Referenced by EmitAggMemberInitializer(), emitArrayDestroy(), EmitBranchOnBoolExpr(), EmitCall(), EmitCallOrInvoke(), EmitCaseStmt(), EmitCaseStmtRange(), emitCatchDispatchBlock(), EmitCheck(), EmitCleanup(), EmitConditionalOperatorLValue(), clang::CodeGen::CGCUDARuntime::EmitCUDAKernelCallExpr(), EmitCXXAggrConstructorCall(), EmitCXXDeleteExpr(), EmitCXXForRangeStmt(), EmitCXXNewExpr(), EmitCXXThrowExpr(), EmitDefaultStmt(), EmitDoStmt(), EmitDynamicCast(), EmitDynamicCastCall(), EmitDynamicCastToNull(), emitFilterDispatchBlock(), EmitForStmt(), EmitIfStmt(), EmitLabel(), EmitLandingPad(), EmitNewArrayInitializer(), emitNonZeroVLAInit(), EmitObjCForCollectionStmt(), EmitReturnBlock(), EmitSwitchStmt(), clang::CodeGen::CGObjCRuntime::EmitTryCatchStmt(), EmitTypeidFromVTable(), EmitWhileStmt(), emitWriteback(), emitWritebackArg(), EnsureInsertPoint(), clang::CodeGen::CodeGenFunction::FinallyInfo::exit(), ExitCXXTryStmt(), FinishFunction(), GetAddressOfBaseClass(), GetAddressOfDerivedClass(), getTrapBB(), and PerformReturnAdjustment().

void CodeGenFunction::EmitBlockAfterUses ( llvm::BasicBlock *  BB)

EmitBlockAfterUses - Emit the given block somewhere hopefully near its uses, and leave the insertion point in it.

Definition at line 281 of file CGStmt.cpp.

References Builder, and CurFn.

Referenced by emitCatchDispatchBlock(), emitFilterDispatchBlock(), and ExitCXXTryStmt().

RValue CodeGenFunction::EmitBlockCallExpr ( const CallExpr E,
ReturnValueSlot  ReturnValue 
)
llvm::Value * CodeGenFunction::EmitBlockCopyAndAutorelease ( llvm::Value Block,
QualType  Ty 
)
llvm::Value * CodeGenFunction::EmitBlockLiteral ( const BlockExpr blockExpr)

Emit a block literal expression in the current function.

Definition at line 610 of file CGBlocks.cpp.

References computeBlockInfo(), findAndRemoveBlockInfo(), clang::BlockExpr::getBlockDecl(), and clang::BlockDecl::hasCaptures().

llvm::Value * CodeGenFunction::EmitBlockLiteral ( const CGBlockInfo Info)

Definition at line 629 of file CGBlocks.cpp.

References clang::CodeGen::CGBlockInfo::Address, clang::CodeGen::BLOCK_HAS_COPY_DISPOSE, clang::CodeGen::BLOCK_HAS_CXX_OBJ, clang::CodeGen::BLOCK_HAS_SIGNATURE, clang::CodeGen::BLOCK_USE_STRET, buildBlockDescriptor(), buildGlobalBlock(), clang::CodeGen::CGBlockInfo::CanBeGlobal, clang::BlockDecl::capture_begin(), clang::BlockDecl::capture_end(), clang::BlockDecl::capturesCXXThis(), clang::CK_LValueToRValue, clang::CodeGen::CGBlockInfo::CXXThisIndex, clang::CodeGen::AggValueSlot::DoesNotNeedGCBarriers, clang::CodeGen::CGBlockInfo::DominatingIP, clang::CodeGen::AggValueSlot::forAddr(), GenerateBlockFunction(), clang::CodeGen::BlockFlags::getBitMask(), clang::CodeGen::CGBlockInfo::getBlockDecl(), clang::CodeGen::CGBlockInfo::getBlockExpr(), clang::CodeGen::CGBlockInfo::getCapture(), clang::CodeGen::CGBlockInfo::Capture::getCleanup(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CGBlockInfo::Capture::getIndex(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::ASTContext::getTypeAlignInChars(), clang::CodeGen::CGBlockInfo::HasCXXObject, clang::CodeGen::CodeGenTypeCache::IntTy, clang::CodeGen::CGBlockInfo::Capture::isConstant(), clang::BlockDecl::isConversionFromLambda(), clang::CodeGen::AggValueSlot::IsDestructed, clang::CodeGen::AggValueSlot::IsNotAliased, clang::CodeGen::EHScopeStack::stable_iterator::isValid(), clang::CodeGen::CGBlockInfo::NeedsCopyDispose, clang::ImplicitCastExpr::OnStack, clang::CodeGen::CGBlockInfo::UsesStret, clang::VK_LValue, clang::VK_RValue, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.

void CodeGenFunction::EmitBranch ( llvm::BasicBlock *  Block)

EmitBranch - Emit a branch to the specified basic block from the current insert block, taking care to avoid creation of branches from dummy blocks. It is legal to call this function even if there is no current insertion point.

This function clears the current insertion point. The caller should follow calls to this function with calls to Emit*Block prior to generation new code.

Definition at line 264 of file CGStmt.cpp.

References Builder.

Referenced by EmitAggMemberInitializer(), EmitBlock(), clang::CodeGen::CGCUDARuntime::EmitCUDAKernelCallExpr(), EmitCXXForRangeStmt(), EmitDynamicCast(), EmitForStmt(), EmitIfStmt(), EmitIndirectGotoStmt(), EmitWhileStmt(), and getTrapBB().

void CodeGenFunction::EmitBranchOnBoolExpr ( const Expr Cond,
llvm::BasicBlock *  TrueBlock,
llvm::BasicBlock *  FalseBlock 
)

EmitBranchOnBoolExpr - Emit a branch on a boolean condition (e.g. for an if statement) to the specified blocks. Based on the condition, this might try to simplify the codegen of the conditional based on the branch.

Definition at line 572 of file CodeGenFunction.cpp.

References clang::CodeGen::CodeGenFunction::ConditionalEvaluation::begin(), clang::BO_LAnd, clang::BO_LOr, Builder, ConstantFoldsToSimpleInteger(), createBasicBlock(), EmitBlock(), clang::CodeGen::CodeGenFunction::ConditionalEvaluation::end(), EvaluateExprAsBool(), clang::Expr::IgnoreParens(), and clang::UO_LNot.

Referenced by EmitConditionalOperatorLValue(), clang::CodeGen::CGCUDARuntime::EmitCUDAKernelCallExpr(), and EmitIfStmt().

void CodeGenFunction::EmitBranchThroughCleanup ( JumpDest  Dest)

EmitBranchThroughCleanup - Emit a branch from the current insert block through the normal cleanup handling code (if any) and then on to

  • Dest.

Terminate the current block by emitting a branch which might leave the current cleanup-protected scope. The target scope may not yet be known, in which case this will require a fixup.

As a side-effect, this method clears the insertion point.

Definition at line 873 of file CGCleanup.cpp.

References clang::CodeGen::EHCleanupScope::addBranchAfter(), clang::CodeGen::EHCleanupScope::addBranchThrough(), CreateNormalEntry(), clang::CodeGen::BranchFixup::Destination, clang::CodeGen::BranchFixup::DestinationIndex, clang::CodeGen::EHScopeStack::stable_iterator::encloses(), clang::CodeGen::CodeGenFunction::JumpDest::getBlock(), clang::CodeGen::CodeGenFunction::JumpDest::getDestIndex(), clang::CodeGen::EHCleanupScope::getEnclosingNormalCleanup(), clang::CodeGen::CodeGenFunction::JumpDest::getScopeDepth(), Index, clang::CodeGen::BranchFixup::InitialBranch, clang::CodeGen::EHCleanupScope::isNormalCleanup(), clang::CodeGen::EHScopeStack::stable_iterator::isValid(), clang::CodeGen::BranchFixup::OptimisticBranchBlock, and clang::CodeGen::EHScopeStack::stable_iterator::strictlyEncloses().

Referenced by EmitBreakStmt(), EmitContinueStmt(), EmitCXXForRangeStmt(), EmitForStmt(), EmitGotoStmt(), EmitIndirectGotoStmt(), EmitReturnStmt(), clang::CodeGen::CGObjCRuntime::EmitTryCatchStmt(), EmitWhileStmt(), and clang::CodeGen::CodeGenFunction::FinallyInfo::exit().

void CodeGenFunction::EmitBreakStmt ( const BreakStmt S)

Definition at line 796 of file CGStmt.cpp.

References EmitBranchThroughCleanup(), EmitStopPoint(), and HaveInsertPoint().

Referenced by EmitSimpleStmt().

RValue CodeGenFunction::EmitBuiltinExpr ( const FunctionDecl FD,
unsigned  BuiltinID,
const CallExpr E 
)
void CodeGenFunction::emitByrefStructureInit ( const AutoVarEmission emission)
RValue CodeGenFunction::EmitCall ( const CGFunctionInfo FnInfo,
llvm::Value Callee,
ReturnValueSlot  ReturnValue,
const CallArgList Args,
const Decl TargetDecl = 0,
llvm::Instruction **  callOrInvoke = 0 
)

EmitCall - Generate a call of the given function, expecting the given result type, and using the given argument list which specifies both the LLVM arguments and the types they were derived from.

Parameters:
TargetDecl- If given, the decl of the function in a direct call; used to set attributes on the call (noreturn, etc.).

Definition at line 1859 of file CGCall.cpp.

References clang::CodeGen::CGFunctionInfo::arg_begin(), clang::CodeGen::CGFunctionInfo::arg_size(), Args, BuildAggStore(), Builder, CGM, checkArgMatches(), clang::CodeGen::CodeGenModule::ConstructAttributeList(), ConvertType(), createBasicBlock(), CreateCoercedLoad(), CreateCoercedStore(), CreateMemTemp(), clang::ABIArgInfo::Direct, EmitAggregateCopy(), EmitBlock(), EmitLoadOfScalar(), EmitStoreOfScalar(), emitWritebacks(), EnsureInsertPoint(), clang::ABIArgInfo::Expand, clang::ABIArgInfo::Extend, clang::CodeGen::RValue::get(), clang::CodeGen::RValue::getAggregate(), clang::CodeGen::RValue::getAggregateAddr(), clang::ABIArgInfo::getCoerceToType(), clang::CodeGen::RValue::getComplex(), clang::CodeGen::RValue::getComplexVal(), getContext(), clang::ABIArgInfo::getDirectOffset(), getElementType(), clang::ABIArgInfo::getIndirectAlign(), clang::ABIArgInfo::getIndirectByVal(), getInvokeDest(), clang::ABIArgInfo::getKind(), clang::CodeGen::CodeGenModule::getLangOpts(), clang::ABIArgInfo::getPaddingType(), clang::CharUnits::getQuantity(), clang::CodeGen::CGFunctionInfo::getReturnInfo(), clang::CodeGen::CGFunctionInfo::getReturnType(), clang::CodeGen::RValue::getScalarVal(), clang::CodeGen::CodeGenModule::getTargetData(), clang::ASTContext::getTypeAlignInChars(), GetUndefRValue(), clang::CodeGen::ReturnValueSlot::getValue(), hasAggregateLLVMType(), clang::CodeGen::CallArgList::hasWritebacks(), clang::ABIArgInfo::Ignore, clang::ABIArgInfo::Indirect, clang::CodeGen::RValue::isComplex(), clang::CodeGen::RValue::isScalar(), clang::CodeGen::ReturnValueSlot::isVolatile(), clang::CodeGen::RValue::isVolatileQualified(), LoadComplexFromAddr(), clang::CodeGen::CodeGenModule::ReturnTypeUsesSRet(), and StoreComplexToAddr().

Referenced by EmitAtomicExpr(), EmitCall(), EmitCallExpr(), emitCPPObjectAtomicGetterCall(), emitCPPObjectAtomicSetterCall(), clang::CodeGen::CGCUDARuntime::EmitCUDAKernelCallExpr(), EmitCXXMemberCall(), EmitCXXMemberCallExpr(), EmitCXXMemberPointerCallExpr(), EmitCXXNewExpr(), EmitDelegateCXXConstructorCall(), EmitDeleteCall(), EmitForwardingCallToLambda(), emitLibraryCall(), EmitObjCForCollectionStmt(), emitStructGetterCall(), emitStructSetterCall(), EmitSynthesizedCXXCopyCtorCall(), generateObjCGetterBody(), generateObjCSetterBody(), and GenerateThunk().

RValue CodeGenFunction::EmitCall ( QualType  FnType,
llvm::Value Callee,
ReturnValueSlot  ReturnValue,
CallExpr::const_arg_iterator  ArgBeg,
CallExpr::const_arg_iterator  ArgEnd,
const Decl TargetDecl = 0 
)
void CodeGenFunction::EmitCallArg ( CallArgList args,
const Expr E,
QualType  ArgType 
)
RValue CodeGenFunction::EmitCallExpr ( const CallExpr E,
ReturnValueSlot  ReturnValue = ReturnValueSlot() 
)
LValue CodeGenFunction::EmitCallExprLValue ( const CallExpr E)
llvm::CallSite CodeGenFunction::EmitCallOrInvoke ( llvm::Value Callee,
ArrayRef< llvm::Value * >  Args,
const Twine &  Name = "" 
)

Emits a call or invoke instruction to the given function, depending on the current state of the EH stack.

Definition at line 1750 of file CGCall.cpp.

References Builder, CGM, createBasicBlock(), EmitBlock(), getInvokeDest(), and clang::CodeGen::CodeGenModule::getLangOpts().

Referenced by EmitBadCastCall(), EmitBadTypeidCall(), and EmitCallOrInvoke().

llvm::CallSite CodeGenFunction::EmitCallOrInvoke ( llvm::Value Callee,
const Twine &  Name = "" 
)

Definition at line 1773 of file CGCall.cpp.

References EmitCallOrInvoke().

void CodeGenFunction::EmitCaseStmt ( const CaseStmt S)
void CodeGenFunction::EmitCaseStmtRange ( const CaseStmt S)

EmitCaseStmtRange - If case statement range is not too big then add multiple cases to switch instruction, one for each value within the range. If range is too big then emit "if" condition check.

Definition at line 825 of file CGStmt.cpp.

References Builder, createBasicBlock(), CurFn, EmitBlock(), EmitStmt(), clang::Expr::EvaluateKnownConstInt(), getContext(), clang::CaseStmt::getLHS(), clang::CaseStmt::getRHS(), and clang::CaseStmt::getSubStmt().

Referenced by EmitCaseStmt().

LValue CodeGenFunction::EmitCastLValue ( const CastExpr E)

EmitCastLValue - Casts are never lvalues unless that cast is to a reference type. If the cast is to a reference, we can have the usual lvalue result, otherwise if a cast is needed by the code generator in an lvalue context, then it must mean that we need the address of an aggregate in order to access one of its members. This can happen for all the reasons that casts are permitted with aggregate result, including noop aggregate casts, and cast from scalar to union.

Definition at line 2204 of file CGExpr.cpp.

References Builder, clang::CK_AnyPointerToBlockPointerCast, clang::CK_ARCConsumeObject, clang::CK_ARCExtendBlockObject, clang::CK_ARCProduceObject, clang::CK_ARCReclaimReturnedObject, clang::CK_ArrayToPointerDecay, clang::CK_AtomicToNonAtomic, clang::CK_BaseToDerived, clang::CK_BaseToDerivedMemberPointer, clang::CK_BitCast, clang::CK_BlockPointerToObjCPointerCast, clang::CK_ConstructorConversion, clang::CK_CopyAndAutoreleaseBlockObject, clang::CK_CPointerToObjCPointerCast, clang::CK_Dependent, clang::CK_DerivedToBase, clang::CK_DerivedToBaseMemberPointer, clang::CK_Dynamic, clang::CK_FloatingCast, clang::CK_FloatingComplexCast, clang::CK_FloatingComplexToBoolean, clang::CK_FloatingComplexToIntegralComplex, clang::CK_FloatingComplexToReal, clang::CK_FloatingRealToComplex, clang::CK_FloatingToBoolean, clang::CK_FloatingToIntegral, clang::CK_FunctionToPointerDecay, clang::CK_IntegralCast, clang::CK_IntegralComplexCast, clang::CK_IntegralComplexToBoolean, clang::CK_IntegralComplexToFloatingComplex, clang::CK_IntegralComplexToReal, clang::CK_IntegralRealToComplex, clang::CK_IntegralToBoolean, clang::CK_IntegralToFloating, clang::CK_IntegralToPointer, clang::CK_LValueBitCast, clang::CK_LValueToRValue, clang::CK_MemberPointerToBoolean, clang::CK_NonAtomicToAtomic, clang::CK_NoOp, clang::CK_NullToMemberPointer, clang::CK_NullToPointer, clang::CK_ObjCObjectLValueCast, clang::CK_PointerToBoolean, clang::CK_PointerToIntegral, clang::CK_ReinterpretMemberPointer, clang::CK_ToUnion, clang::CK_ToVoid, clang::CK_UncheckedDerivedToBase, clang::CK_UserDefinedConversion, clang::CK_VectorSplat, clang::Expr::Classify(), ConvertType(), CreateMemTemp(), EmitAggExprToLValue(), EmitAnyExprToMem(), EmitDynamicCast(), EmitLValue(), EmitUnsupportedLValue(), clang::CodeGen::LValue::getAddress(), GetAddressOfBaseClass(), GetAddressOfDerivedClass(), clang::CastExpr::getCastKind(), getContext(), clang::RecordType::getDecl(), clang::ASTContext::getLValueReferenceType(), clang::QualType::getQualifiers(), clang::CastExpr::getSubExpr(), clang::Expr::getType(), clang::ExplicitCastExpr::getTypeAsWritten(), MakeAddrLValue(), clang::CastExpr::path_begin(), and clang::CastExpr::path_end().

Referenced by EmitLValue().

llvm::Value * CodeGenFunction::EmitCastToVoidPtr ( llvm::Value value)
void CodeGenFunction::EmitCheck ( llvm::Value Address,
unsigned  Size 
)
LValue CodeGenFunction::EmitCheckedLValue ( const Expr E)

EmitCheckedLValue - Same as EmitLValue but additionally we generate checking code to guard against undefined behavior. This is only suitable when we know that the address will be used to access the object.

Definition at line 611 of file CGExpr.cpp.

References EmitCheck(), EmitLValue(), clang::CodeGen::LValue::getAddress(), getContext(), clang::Expr::getType(), clang::ASTContext::getTypeSizeInChars(), clang::CodeGen::LValue::isBitField(), and clang::CodeGen::LValue::isSimple().

LValue CodeGenFunction::EmitComplexAssignmentLValue ( const BinaryOperator E)

Emit an l-value for an assignment (simple or compound) of complex type.

Definition at line 818 of file CGExprComplex.cpp.

References clang::BO_Assign, and clang::BinaryOperator::getOpcode().

Referenced by EmitBinaryOperatorLValue().

LValue CodeGenFunction::EmitComplexCompoundAssignmentLValue ( const CompoundAssignOperator E)
ComplexPairTy CodeGenFunction::EmitComplexExpr ( const Expr E,
bool  IgnoreReal = false,
bool  IgnoreImag = false 
)

EmitComplexExpr - Emit the computation of the specified expression of complex type, returning the result.

EmitComplexExpr - Emit the computation of the specified expression of complex type, ignoring the result.

Definition at line 784 of file CGExprComplex.cpp.

References clang::Expr::getType().

Referenced by EmitAnyExpr(), EmitExprAsInit(), and EvaluateExprAsBool().

void CodeGenFunction::EmitComplexExprIntoAddr ( const Expr E,
llvm::Value DestAddr,
bool  DestIsVolatile 
)

EmitComplexExprIntoAddr - Emit the computation of the specified expression of complex type, storing into the specified Value*.

Definition at line 795 of file CGExprComplex.cpp.

References clang::Expr::getType().

Referenced by EmitAggMemberInitializer(), EmitAnyExprToMem(), EmitAtomicExpr(), EmitDeclInit(), EmitInitializerForField(), EmitReturnStmt(), and StoreAnyExprIntoOneUnit().

CodeGenFunction::ComplexPairTy CodeGenFunction::EmitComplexPrePostIncDec ( const UnaryOperator E,
LValue  LV,
bool  isInc,
bool  isPre 
)
Value * CodeGenFunction::EmitComplexToScalarConversion ( ComplexPairTy  Src,
QualType  SrcTy,
QualType  DstTy 
)

EmitComplexToScalarConversion - Emit a conversion from the specified complex type to the specified destination type, where the destination type is an LLVM scalar type.

Definition at line 2767 of file CGExprScalar.cpp.

References hasAggregateLLVMType().

Referenced by EvaluateExprAsBool().

LValue CodeGenFunction::EmitCompoundAssignmentLValue ( const CompoundAssignOperator E)
LValue CodeGenFunction::EmitCompoundLiteralLValue ( const CompoundLiteralExpr E)
RValue CodeGenFunction::EmitCompoundStmt ( const CompoundStmt S,
bool  GetLast = false,
AggValueSlot  AggSlot = AggValueSlot::ignored() 
)

EmitCompoundStmt - Emit a compound statement {..} node. If GetLast is true, this captures the expression result of the last sub-statement and returns it (for use by the statement expression extension).

Definition at line 192 of file CGStmt.cpp.

References clang::CompoundStmt::body_back(), clang::CompoundStmt::body_begin(), clang::CompoundStmt::body_end(), EmitAnyExpr(), EmitLabel(), EmitStmt(), EnsureInsertPoint(), clang::CodeGen::RValue::get(), getContext(), clang::CompoundStmt::getLBracLoc(), and clang::CompoundStmt::getSourceRange().

Referenced by EmitSimpleStmt().

LValue CodeGenFunction::EmitConditionalOperatorLValue ( const AbstractConditionalOperator E)
void CodeGenFunction::EmitConstructorBody ( FunctionArgList Args)
void CodeGenFunction::EmitContinueStmt ( const ContinueStmt S)

Definition at line 809 of file CGStmt.cpp.

References EmitBranchThroughCleanup(), EmitStopPoint(), and HaveInsertPoint().

Referenced by EmitSimpleStmt().

void CodeGenFunction::EmitCtorPrologue ( const CXXConstructorDecl CD,
CXXCtorType  CtorType,
FunctionArgList Args 
)
RValue CodeGenFunction::EmitCUDAKernelCallExpr ( const CUDAKernelCallExpr E,
ReturnValueSlot  ReturnValue 
)
void CodeGenFunction::EmitCXXAggrConstructorCall ( const CXXConstructorDecl ctor,
const ConstantArrayType arrayType,
llvm::Value arrayBegin,
CallExpr::const_arg_iterator  argBegin,
CallExpr::const_arg_iterator  argEnd,
bool  zeroInitialize = false 
)

EmitCXXAggrConstructorCall - Emit a loop to call a particular constructor for each of several members of an array.

Parameters:
ctorthe constructor to call for each element
argBegin,argEndthe arguments to evaluate and pass to the constructor
arrayTypethe type of the array to initialize
arrayBeginan arrayType*
zeroInitializetrue if each element should be zero-initialized before it is constructed

Definition at line 1096 of file CGClass.cpp.

References emitArrayLength().

Referenced by EmitCXXConstructExpr(), and EmitNewInitializer().

void CodeGenFunction::EmitCXXAggrConstructorCall ( const CXXConstructorDecl ctor,
llvm::Value numElements,
llvm::Value arrayBegin,
CallExpr::const_arg_iterator  argBegin,
CallExpr::const_arg_iterator  argEnd,
bool  zeroInitialize = false 
)

EmitCXXAggrConstructorCall - Emit a loop to call a particular constructor for each of several members of an array.

Parameters:
ctorthe constructor to call for each element
numElementsthe number of elements in the array; may be zero
argBegin,argEndthe arguments to evaluate and pass to the constructor
arrayBegina T*, where T is the type constructed by ctor
zeroInitializetrue if each element should be zero-initialized before it is constructed

Definition at line 1122 of file CGClass.cpp.

References Builder, createBasicBlock(), clang::Ctor_Complete, destroyCXXObject, EmitBlock(), EmitCXXConstructorCall(), EmitNullInitialization(), getContext(), getLangOpts(), clang::CXXMethodDecl::getParent(), clang::ASTContext::getTypeDeclType(), clang::CXXRecordDecl::hasTrivialDestructor(), pushRegularPartialArrayCleanup(), and clang::CodeGen::CodeGenTypeCache::SizeTy.

LValue CodeGenFunction::EmitCXXBindTemporaryLValue ( const CXXBindTemporaryExpr E)
void CodeGenFunction::EmitCXXConstructExpr ( const CXXConstructExpr E,
AggValueSlot  Dest 
)
LValue CodeGenFunction::EmitCXXConstructLValue ( const CXXConstructExpr E)

Definition at line 2520 of file CGExpr.cpp.

References CreateAggTemp(), EmitCXXConstructExpr(), clang::Expr::getType(), and MakeAddrLValue().

Referenced by EmitLValue().

void CodeGenFunction::EmitCXXConstructorCall ( const CXXConstructorDecl D,
CXXCtorType  Type,
bool  ForVirtualBase,
llvm::Value This,
CallExpr::const_arg_iterator  ArgBeg,
CallExpr::const_arg_iterator  ArgEnd 
)
void CodeGenFunction::EmitCXXDeleteExpr ( const CXXDeleteExpr E)
void CodeGenFunction::EmitCXXDestructorCall ( const CXXDestructorDecl D,
CXXDtorType  Type,
bool  ForVirtualBase,
llvm::Value This 
)
void CodeGenFunction::EmitCXXForRangeStmt ( const CXXForRangeStmt S)
void CodeGenFunction::EmitCXXGlobalVarDeclInit ( const VarDecl D,
llvm::Constant *  DeclPtr,
bool  PerformInit 
)
void CodeGenFunction::EmitCXXGuardedInit ( const VarDecl D,
llvm::GlobalVariable *  DeclPtr,
bool  PerformInit 
)

Emit code in this function to perform a guarded variable initialization. Guarded initializations are used when it's not possible to prove that an initialization will be done exactly once, e.g. with a static local variable or a static data member of a class template.

Definition at line 200 of file CGDeclCXX.cpp.

References CGM, clang::CodeGen::CGCXXABI::EmitGuardedInit(), clang::CodeGen::CodeGenModule::Error(), clang::CodeGenOptions::ForbidGuardVariables, clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenModule::getCXXABI(), and clang::Decl::getLocation().

Referenced by AddInitializerToStaticVarDecl(), and GenerateCXXGlobalVarDeclInitFunc().

RValue CodeGenFunction::EmitCXXMemberCall ( const CXXMethodDecl MD,
llvm::Value Callee,
ReturnValueSlot  ReturnValue,
llvm::Value This,
llvm::Value VTT,
CallExpr::const_arg_iterator  ArgBeg,
CallExpr::const_arg_iterator  ArgEnd 
)
RValue CodeGenFunction::EmitCXXMemberCallExpr ( const CXXMemberCallExpr E,
ReturnValueSlot  ReturnValue 
)
RValue CodeGenFunction::EmitCXXMemberPointerCallExpr ( const CXXMemberCallExpr E,
ReturnValueSlot  ReturnValue 
)
llvm::Value * CodeGenFunction::EmitCXXNewExpr ( const CXXNewExpr E)

Definition at line 1116 of file CGExprCXX.cpp.

References clang::CodeGen::CodeGenTypes::arrangeFunctionCall(), clang::CodeGen::CodeGenFunction::ConditionalEvaluation::begin(), Builder, CalculateCookiePadding(), CGM, ConvertTypeForMem(), createBasicBlock(), DeactivateCleanupBlock(), EmitBlock(), EmitCall(), EmitCallArg(), EmitCXXNewAllocSize(), EmitNewInitializer(), clang::CodeGen::CodeGenFunction::ConditionalEvaluation::end(), EnterNewDeleteCleanup(), clang::CodeGen::RValue::get(), clang::CodeGen::CodeGenModule::GetAddrOfFunction(), clang::CXXNewExpr::getAllocatedType(), clang::FunctionProtoType::getArgType(), clang::ASTContext::getBaseElementType(), getContext(), clang::CodeGen::CodeGenModule::getCXXABI(), clang::CXXNewExpr::getInitializer(), clang::QualType::getNonReferenceType(), clang::FunctionProtoType::getNumArgs(), clang::CXXNewExpr::getOperatorDelete(), clang::CXXNewExpr::getOperatorNew(), clang::CodeGen::RValue::getScalarVal(), clang::ASTContext::getSizeType(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenModule::getTypes(), clang::CXXNewExpr::hasInitializer(), clang::CodeGen::CGCXXABI::InitializeArrayCookie(), clang::CXXNewExpr::isArray(), clang::FunctionProtoType::isNothrow(), clang::QualType::isPODType(), clang::FunctionDecl::isReservedGlobalPlacementOperator(), clang::CodeGen::EHScopeStack::stable_iterator::isValid(), clang::FunctionProtoType::isVariadic(), clang::CXXNewExpr::placement_arg_begin(), and clang::CXXNewExpr::placement_arg_end().

llvm::Value * CodeGenFunction::EmitCXXOperatorMemberCallee ( const CXXOperatorCallExpr E,
const CXXMethodDecl MD,
llvm::Value This 
)
RValue CodeGenFunction::EmitCXXOperatorMemberCallExpr ( const CXXOperatorCallExpr E,
const CXXMethodDecl MD,
ReturnValueSlot  ReturnValue 
)
void CodeGenFunction::EmitCXXTemporary ( const CXXTemporary Temporary,
QualType  TempType,
llvm::Value Ptr 
)

Emits all the code to cause the given temporary to be cleaned up.

Definition at line 1098 of file CGCleanup.cpp.

References clang::CodeGen::NormalAndEHCleanup.

Referenced by EmitCXXBindTemporaryLValue().

void CodeGenFunction::EmitCXXThrowExpr ( const CXXThrowExpr E)
void CodeGenFunction::EmitCXXTryStmt ( const CXXTryStmt S)

Definition at line 563 of file CGException.cpp.

References EmitStmt(), EnterCXXTryStmt(), ExitCXXTryStmt(), and clang::CXXTryStmt::getTryBlock().

Referenced by EmitStmt().

llvm::Value * CodeGenFunction::EmitCXXTypeidExpr ( const CXXTypeidExpr E)
LValue CodeGenFunction::EmitCXXTypeidLValue ( const CXXTypeidExpr E)

Definition at line 2529 of file CGExpr.cpp.

References EmitCXXTypeidExpr(), clang::Expr::getType(), and MakeAddrLValue().

Referenced by EmitLValue().

void CodeGenFunction::EmitDecl ( const Decl D)

EmitDecl - Emit a declaration.

This function can be called with a null (unreachable) insert point.

Definition at line 33 of file CGDecl.cpp.

References EmitVarDecl(), EmitVariablyModifiedType(), clang::Decl::getKind(), clang::TypedefNameDecl::getUnderlyingType(), and clang::VarDecl::isLocalVarDecl().

Referenced by EmitDeclStmt().

void CodeGenFunction::EmitDeclRefExprDbgValue ( const DeclRefExpr E,
llvm::Constant *  Init 
)
LValue CodeGenFunction::EmitDeclRefLValue ( const DeclRefExpr E)
void CodeGenFunction::EmitDeclStmt ( const DeclStmt S)
void CodeGenFunction::EmitDefaultStmt ( const DefaultStmt S)

Definition at line 948 of file CGStmt.cpp.

References EmitBlock(), EmitStmt(), and clang::DefaultStmt::getSubStmt().

Referenced by EmitSimpleStmt().

void CodeGenFunction::EmitDelegateCallArg ( CallArgList args,
const VarDecl param 
)
void CodeGenFunction::EmitDelegateCXXConstructorCall ( const CXXConstructorDecl Ctor,
CXXCtorType  CtorType,
const FunctionArgList Args 
)
void CodeGenFunction::EmitDelegatingCXXConstructorCall ( const CXXConstructorDecl Ctor,
const FunctionArgList Args 
)
void CodeGenFunction::EmitDeleteCall ( const FunctionDecl DeleteFD,
llvm::Value Ptr,
QualType  DeleteTy 
)
void CodeGenFunction::emitDestroy ( llvm::Value addr,
QualType  type,
Destroyer destroyer,
bool  useEHCleanupForArray 
)

emitDestroy - Immediately perform the destruction of the given object.

Parameters:
addr- the address of the object; a type*
type- the type of the object; if an array type, all objects are destroyed in reverse order
destroyer- the function to call to destroy individual elements
useEHCleanupForArray- whether an EH cleanup should be used when destroying array elements, in case one of the destructions throws an exception

Definition at line 1253 of file CGDecl.cpp.

References Builder, emitArrayDestroy(), emitArrayLength(), clang::ASTContext::getAsArrayType(), and getContext().

Referenced by generateDestroyHelper().

void CodeGenFunction::EmitDestructorBody ( FunctionArgList Args)
void CodeGenFunction::EmitDoStmt ( const DoStmt S)
llvm::Value * CodeGenFunction::EmitDynamicCast ( llvm::Value V,
const CXXDynamicCastExpr DCE 
)
void CodeGenFunction::EmitEndEHSpec ( const Decl D)
void CodeGenFunction::EmitExprAsInit ( const Expr init,
const ValueDecl D,
LValue  lvalue,
bool  capturedByInit 
)

EmitExprAsInit - Emits the code necessary to initialize a location in memory with the given initializer.

Emit an expression as an initializer for a variable at the given location. The expression is not necessarily the normal initializer for the variable, and the address is not necessarily its normal location.

Parameters:
initthe initializing expression
varthe variable to act as if we're initializing
locthe address to initialize; its type is a pointer to the LLVM mapping of the variable's type
alignmentthe alignment of the address
capturedByInittrue if the variable is a __block variable whose address is potentially changed by the initializer

Definition at line 1086 of file CGDecl.cpp.

References clang::CodeGen::AggValueSlot::DoesNotNeedGCBarriers, drillIntoBlockVariable(), EmitAggExpr(), EmitComplexExpr(), EmitReferenceBindingToExpr(), EmitScalarInit(), EmitStoreThroughLValue(), clang::CodeGen::AggValueSlot::forLValue(), clang::CodeGen::LValue::getAddress(), clang::ValueDecl::getType(), hasAggregateLLVMType(), clang::CodeGen::AggValueSlot::IsDestructed, clang::CodeGen::AggValueSlot::IsNotAliased, clang::CodeGen::LValue::isVolatile(), MaybeEmitStdInitializerListCleanup(), and StoreComplexToAddr().

Referenced by EmitAutoVarInit(), and EmitInitializerForField().

void CodeGenFunction::EmitExtendGCLifetime ( llvm::Value object)

EmitExtendGCLifetime - Given a pointer to an Objective-C object, make sure it survives garbage collection until this point.

Definition at line 2738 of file CGObjC.cpp.

References clang::CodeGen::RequiredArgs::All, Builder, clang::CodeGen::CodeGenTypeCache::VoidPtrTy, and clang::CodeGen::CodeGenTypeCache::VoidTy.

LValue CodeGenFunction::EmitExtVectorElementExpr ( const ExtVectorElementExpr E)
llvm::Value * CodeGenFunction::EmitFieldAnnotations ( const FieldDecl D,
llvm::Value V 
)
void CodeGenFunction::EmitForStmt ( const ForStmt S)
void CodeGenFunction::EmitForwardingCallToLambda ( const CXXRecordDecl Lambda,
CallArgList CallArgs 
)
llvm::Value * CodeGenFunction::EmitFromMemory ( llvm::Value Value,
QualType  Ty 
)

EmitFromMemory - Change a scalar value from its memory representation to its value representation.

Definition at line 939 of file CGExpr.cpp.

References Builder, and hasBooleanRepresentation().

Referenced by EmitFromInt(), and EmitLoadOfScalar().

void CodeGenFunction::EmitFunctionBody ( FunctionArgList Args)
void CodeGenFunction::EmitFunctionEpilog ( const CGFunctionInfo FI)
void CodeGenFunction::EmitFunctionInstrumentation ( const char *  Fn)

EmitFunctionInstrumentation - Emit LLVM code to call the specified instrumentation function with the current function and the call site, if function instrumentation is enabled.

Definition at line 228 of file CodeGenFunction.cpp.

References Builder, CGM, clang::CodeGen::CodeGenModule::CreateRuntimeFunction(), CurFn, clang::CodeGen::CodeGenModule::getIntrinsic(), clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CodeGen::CodeGenTypeCache::Int8PtrTy, and clang::CodeGen::CodeGenTypeCache::VoidTy.

Referenced by FinishFunction(), and StartFunction().

void CodeGenFunction::EmitFunctionProlog ( const CGFunctionInfo FI,
llvm::Function *  Fn,
const FunctionArgList Args 
)
void clang::CodeGen::CodeGenFunction::EmitGCMemmoveCollectable ( llvm::Value DestPtr,
llvm::Value SrcPtr,
QualType  Ty 
)

EmitGCMemmoveCollectable - Emit special API for structs with object pointers.

void CodeGenFunction::EmitGotoStmt ( const GotoStmt S)
Value * CodeGenFunction::EmitHexagonBuiltinExpr ( unsigned  BuiltinID,
const CallExpr E 
)

Definition at line 2456 of file CGBuiltin.cpp.

References clang::CallExpr::getArg(), and clang::CallExpr::getNumArgs().

void CodeGenFunction::EmitIfStmt ( const IfStmt S)
void CodeGenFunction::EmitIgnoredExpr ( const Expr E)

EmitIgnoredExpr - Emit an expression in a context which ignores the result.

EmitIgnoredExpr - Emit code to compute the specified expression, ignoring the result.

Definition at line 99 of file CGExpr.cpp.

References EmitAnyExpr(), EmitLValue(), clang::CodeGen::AggValueSlot::ignored(), and clang::Expr::isRValue().

Referenced by EmitBinaryOperatorLValue(), emitPseudoObjectExpr(), EmitStmt(), EmitVariablyModifiedType(), and tryEmitARCRetainPseudoObject().

void CodeGenFunction::EmitIndirectGotoStmt ( const IndirectGotoStmt S)
void CodeGenFunction::EmitInitializerForField ( FieldDecl Field,
LValue  LHS,
Expr Init,
ArrayRef< VarDecl * >  ArrayIndexes 
)
LValue CodeGenFunction::EmitInitListLValue ( const InitListExpr E)
llvm::Value * CodeGenFunction::EmitIvarOffset ( const ObjCInterfaceDecl Interface,
const ObjCIvarDecl Ivar 
)
void CodeGenFunction::EmitLabel ( const LabelDecl D)
void CodeGenFunction::EmitLabelStmt ( const LabelStmt S)
void CodeGenFunction::EmitLambdaBlockInvokeBody ( )
void CodeGenFunction::EmitLambdaDelegatingInvokeBody ( const CXXMethodDecl MD)
void CodeGenFunction::EmitLambdaExpr ( const LambdaExpr E,
AggValueSlot  Dest 
)
LValue CodeGenFunction::EmitLambdaLValue ( const LambdaExpr E)
void CodeGenFunction::EmitLambdaStaticInvokeFunction ( const CXXMethodDecl MD)
void CodeGenFunction::EmitLambdaToBlockPointerBody ( FunctionArgList Args)
llvm::BasicBlock * CodeGenFunction::EmitLandingPad ( )
RValue CodeGenFunction::EmitLoadOfBitfieldLValue ( LValue  LV)
RValue CodeGenFunction::EmitLoadOfExtVectorElementLValue ( LValue  V)
RValue CodeGenFunction::EmitLoadOfLValue ( LValue  LV)
llvm::Value * CodeGenFunction::EmitLoadOfScalar ( llvm::Value Addr,
bool  Volatile,
unsigned  Alignment,
QualType  Ty,
llvm::MDNode *  TBAAInfo = 0 
)

EmitLoadOfScalar - Load a scalar value from an address, taking care to appropriately convert from the memory representation to the LLVM value representation.

Definition at line 905 of file CGExpr.cpp.

References Builder, CGM, clang::CodeGen::CodeGenModule::DecorateInstruction(), EmitFromMemory(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), and clang::CodeGenOptions::OptimizationLevel.

Referenced by ConvertTempToRValue(), EmitARCStoreStrong(), EmitCall(), EmitDelegateCallArg(), EmitFunctionProlog(), EmitLoadOfLValue(), EmitLoadOfScalar(), and EmitScalarInit().

llvm::Value * CodeGenFunction::EmitLoadOfScalar ( LValue  lvalue)

EmitLoadOfScalar - Load a scalar value from an address, taking care to appropriately convert from the memory representation to the LLVM value representation. The l-value must be a simple l-value.

Definition at line 849 of file CGExpr.cpp.

References EmitLoadOfScalar(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::LValue::getAlignment(), clang::CharUnits::getQuantity(), clang::CodeGen::LValue::getTBAAInfo(), clang::CodeGen::LValue::getType(), and clang::CodeGen::LValue::isVolatile().

LValue CodeGenFunction::EmitLValue ( const Expr E)

EmitLValue - Emit code to compute a designator that specifies the location of the expression.

This can return one of two things: a simple address or a bitfield reference. In either case, the LLVM Value* in the LValue structure is guaranteed to be an LLVM pointer type.

If this returns a bitfield reference, nothing about the pointee type of the LLVM value is known: For example, it may not be a pointer to an integer.

If this returns a normal address, and if the lvalue's C type is fixed size, this method guarantees that the returned pointer type will point to an LLVM type of the same size of the lvalue's type. If the lvalue has a variable length type, this is not possible.

Definition at line 634 of file CGExpr.cpp.

References EmitArraySubscriptExpr(), EmitBinaryOperatorLValue(), EmitCallExprLValue(), EmitCastLValue(), EmitComplexCompoundAssignmentLValue(), EmitCompoundAssignmentLValue(), EmitCompoundLiteralLValue(), EmitConditionalOperatorLValue(), EmitCXXBindTemporaryLValue(), EmitCXXConstructLValue(), EmitCXXTypeidLValue(), EmitDeclRefLValue(), EmitExtVectorElementExpr(), EmitInitListLValue(), EmitLambdaLValue(), EmitMaterializeTemporaryExpr(), EmitMemberExpr(), EmitNullInitializationLValue(), EmitObjCEncodeExprLValue(), EmitObjCIsaExpr(), EmitObjCIvarRefLValue(), EmitObjCMessageExprLValue(), EmitObjCSelectorLValue(), EmitOpaqueValueLValue(), EmitPredefinedLValue(), EmitPseudoObjectLValue(), EmitStmtExprLValue(), EmitStringLiteralLValue(), EmitUnaryOpLValue(), EmitUnsupportedLValue(), EmitVAArgExprLValue(), enterFullExpression(), getContext(), clang::Stmt::getStmtClass(), clang::ExprWithCleanups::getSubExpr(), and clang::Expr::getType().

Referenced by clang::CodeGen::CodeGenFunction::OpaqueValueMappingData::bind(), EmitARCStoreAutoreleasing(), EmitARCStoreStrong(), EmitArraySubscriptExpr(), EmitAsmStmt(), EmitBinaryOperatorLValue(), EmitCallArg(), EmitCallExpr(), EmitCastLValue(), EmitCheckedLValue(), EmitConditionalOperatorLValue(), emitCPPObjectAtomicSetterCall(), EmitCXXConstructorCall(), EmitCXXMemberCallExpr(), EmitCXXMemberPointerCallExpr(), EmitCXXOperatorMemberCallExpr(), EmitExprForReferenceBinding(), EmitExtVectorElementExpr(), EmitIgnoredExpr(), EmitInitListLValue(), EmitMemberExpr(), EmitObjCForCollectionStmt(), EmitObjCIsaExpr(), EmitObjCIvarRefLValue(), EmitPointerToDataMemberBinaryExpr(), emitPseudoObjectExpr(), emitStructSetterCall(), EmitTypeidFromVTable(), EmitUnaryOpLValue(), EmitVAListRef(), and tryEmitARCRetainLoadOfScalar().

LValue CodeGenFunction::EmitLValueForAnonRecordField ( llvm::Value BaseValue,
const IndirectFieldDecl Field,
unsigned  CVRQualifiers 
)

EmitLValueForAnonRecordField - Given that the field is a member of an anonymous struct or union buried inside a record, and given that the base value is a pointer to the enclosing record, derive an lvalue for the ultimate field.

Definition at line 1983 of file CGExpr.cpp.

References clang::IndirectFieldDecl::chain_begin(), clang::IndirectFieldDecl::chain_end(), EmitLValueForField(), clang::CodeGen::LValue::getAddress(), getContext(), clang::ASTContext::getTypeDeclType(), clang::CodeGen::LValue::getVRQualifiers(), clang::CodeGen::LValue::isSimple(), and MakeAddrLValue().

Referenced by EmitMemberInitializer().

LValue CodeGenFunction::EmitLValueForBitfield ( llvm::Value Base,
const FieldDecl Field,
unsigned  CVRQualifiers 
)
LValue CodeGenFunction::EmitLValueForField ( LValue  Base,
const FieldDecl Field 
)
LValue CodeGenFunction::EmitLValueForFieldInitialization ( LValue  Base,
const FieldDecl Field 
)
LValue CodeGenFunction::EmitLValueForIvar ( QualType  ObjectTy,
llvm::Value Base,
const ObjCIvarDecl Ivar,
unsigned  CVRQualifiers 
)
LValue CodeGenFunction::EmitMaterializeTemporaryExpr ( const MaterializeTemporaryExpr E)
void CodeGenFunction::EmitMCountInstrumentation ( )

EmitMCountInstrumentation - Emit call to .mcount.

Definition at line 246 of file CodeGenFunction.cpp.

References Builder, CGM, clang::CodeGen::CodeGenModule::CreateRuntimeFunction(), clang::TargetInfo::getMCountName(), Target, and clang::CodeGen::CodeGenTypeCache::VoidTy.

Referenced by StartFunction().

LValue CodeGenFunction::EmitMemberExpr ( const MemberExpr E)
Value * CodeGenFunction::EmitNeonCall ( llvm::Function *  F,
SmallVectorImpl< llvm::Value * > &  O,
const char *  name,
unsigned  shift = 0,
bool  rightshift = false 
)

Definition at line 1415 of file CGBuiltin.cpp.

Value * CodeGenFunction::EmitNeonShiftVector ( llvm::Value V,
llvm::Type *  Ty,
bool  negateForRightShift 
)

Definition at line 1429 of file CGBuiltin.cpp.

Value * CodeGenFunction::EmitNeonSplat ( llvm::Value V,
llvm::Constant *  Idx 
)

Definition at line 1409 of file CGBuiltin.cpp.

void CodeGenFunction::EmitNewArrayInitializer ( const CXXNewExpr E,
QualType  elementType,
llvm::Value NewPtr,
llvm::Value NumElements 
)
void CodeGenFunction::EmitNullInitialization ( llvm::Value DestPtr,
QualType  Ty 
)
LValue CodeGenFunction::EmitNullInitializationLValue ( const CXXScalarValueInitExpr E)
llvm::Value * CodeGenFunction::EmitObjCArrayLiteral ( const ObjCArrayLiteral E)
void CodeGenFunction::EmitObjCAtSynchronizedStmt ( const ObjCAtSynchronizedStmt S)
void CodeGenFunction::EmitObjCAtThrowStmt ( const ObjCAtThrowStmt S)
void CodeGenFunction::EmitObjCAtTryStmt ( const ObjCAtTryStmt S)
void CodeGenFunction::EmitObjCAutoreleasePoolCleanup ( llvm::Value Ptr)
void CodeGenFunction::EmitObjCAutoreleasePoolPop ( llvm::Value value)
llvm::Value * CodeGenFunction::EmitObjCAutoreleasePoolPush ( )
void CodeGenFunction::EmitObjCAutoreleasePoolStmt ( const ObjCAutoreleasePoolStmt S)
llvm::Value * CodeGenFunction::EmitObjCBoxedExpr ( const ObjCBoxedExpr E)
llvm::Value * CodeGenFunction::EmitObjCCollectionLiteral ( const Expr E,
const ObjCMethodDecl MethodWithObjects 
)
llvm::Value * CodeGenFunction::EmitObjCConsumeObject ( QualType  type,
llvm::Value object 
)

Produce the code for a CK_ARCConsumeObject. Does a primitive release at the end of the full-expression.

Definition at line 1669 of file CGObjC.cpp.

References getARCCleanupKind().

Referenced by EmitARCExtendBlockObject(), clang::CodeGen::CGObjCRuntime::EmitAtSynchronizedStmt(), and EmitObjCForCollectionStmt().

llvm::Value * CodeGenFunction::EmitObjCDictionaryLiteral ( const ObjCDictionaryLiteral E)
LValue CodeGenFunction::EmitObjCEncodeExprLValue ( const ObjCEncodeExpr E)
llvm::Value * CodeGenFunction::EmitObjCExtendObjectLifetime ( QualType  T,
llvm::Value Ptr 
)

Definition at line 1677 of file CGObjC.cpp.

References EmitARCRetainAutorelease().

Referenced by EmitStoreThroughLValue().

void CodeGenFunction::EmitObjCForCollectionStmt ( const ObjCForCollectionStmt S)

Definition at line 1360 of file CGObjC.cpp.

References clang::CodeGen::CallArgList::add(), clang::CodeGen::RequiredArgs::All, Args, clang::CodeGen::CodeGenTypes::arrangeFunctionCall(), Builder, ConvertType(), clang::LangAS::Count, createBasicBlock(), CreateMemTemp(), EmitARCRetainScalarExpr(), EmitAutoVarAlloca(), EmitAutoVarCleanups(), EmitAutoVarInit(), EmitBlock(), EmitCall(), clang::CodeGen::CGDebugInfo::EmitLexicalBlockEnd(), clang::CodeGen::CGDebugInfo::EmitLexicalBlockStart(), EmitLValue(), EmitNullInitialization(), EmitObjCConsumeObject(), EmitScalarExpr(), EmitScalarInit(), EmitStmt(), EmitStoreThroughLValue(), clang::CodeGen::CGObjCRuntime::EnumerationMutationFunction(), clang::CodeGen::CodeGenModule::ErrorUnsupported(), clang::CodeGen::CodeGenFunction::RunCleanupsScope::ForceCleanup(), clang::CodeGen::CGObjCRuntime::GenerateMessageSend(), clang::CodeGen::RValue::get(), clang::IdentifierTable::get(), clang::SourceRange::getBegin(), clang::CodeGen::CodeGenFunction::JumpDest::getBlock(), clang::ObjCForCollectionStmt::getBody(), clang::ObjCForCollectionStmt::getCollection(), clang::ASTContext::getConstantArrayType(), clang::CodeGen::CodeGenModule::getContext(), getContext(), getDebugInfo(), clang::ObjCForCollectionStmt::getElement(), clang::SourceRange::getEnd(), getJumpDestInCurrentScope(), getLangOpts(), clang::CodeGen::CodeGenModule::getObjCFastEnumerationStateType(), clang::CodeGen::CodeGenModule::getObjCRuntime(), clang::CodeGen::RValue::getScalarVal(), clang::SelectorTable::getSelector(), clang::ObjCForCollectionStmt::getSourceRange(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenModule::getTypes(), clang::ASTContext::Idents, clang::CodeGen::CodeGenFunction::AutoVarEmission::invalid(), clang::VarDecl::isARCPseudoStrong(), clang::ArrayType::Normal, clang::Qualifiers::OCL_ExplicitNone, PopCleanupBlock(), clang::ASTContext::Selectors, clang::VK_LValue, and clang::CodeGen::CodeGenTypeCache::VoidTy.

Referenced by EmitStmt().

LValue CodeGenFunction::EmitObjCIsaExpr ( const ObjCIsaExpr E)
LValue CodeGenFunction::EmitObjCIvarRefLValue ( const ObjCIvarRefExpr E)
RValue CodeGenFunction::EmitObjCMessageExpr ( const ObjCMessageExpr E,
ReturnValueSlot  Return = ReturnValueSlot() 
)
LValue CodeGenFunction::EmitObjCMessageExprLValue ( const ObjCMessageExpr E)
void CodeGenFunction::EmitObjCMRRAutoreleasePoolPop ( llvm::Value Arg)
llvm::Value * CodeGenFunction::EmitObjCMRRAutoreleasePoolPush ( )

Produce the code to do an MRR version objc_autoreleasepool_push. Which is: [[NSAutoreleasePool alloc] init]; Where alloc is declared as: + (id) alloc; in NSAutoreleasePool class. init is declared as: - (id) init; in its NSObject super class.

Definition at line 2172 of file CGObjC.cpp.

References Args, Builder, clang::CodeGen::CGObjCRuntime::EmitNSAutoreleasePoolClassRef(), clang::CodeGen::CGObjCRuntime::GenerateMessageSend(), clang::IdentifierTable::get(), clang::CodeGen::CodeGenModule::getContext(), getContext(), clang::CodeGen::CodeGenModule::getObjCRuntime(), clang::CodeGen::RValue::getScalarVal(), clang::SelectorTable::getSelector(), clang::ASTContext::Idents, and clang::ASTContext::Selectors.

Referenced by EmitObjCAutoreleasePoolStmt().

llvm::Value * CodeGenFunction::EmitObjCProduceObject ( QualType  type,
llvm::Value value 
)

Produce the code for a CK_ARCProduceObject. Just does a primitive retain.

Definition at line 1651 of file CGObjC.cpp.

References EmitARCRetain().

llvm::Value * CodeGenFunction::EmitObjCProtocolExpr ( const ObjCProtocolExpr E)
llvm::Value * CodeGenFunction::EmitObjCSelectorExpr ( const ObjCSelectorExpr E)
LValue CodeGenFunction::EmitObjCSelectorLValue ( const ObjCSelectorExpr E)
llvm::Value * CodeGenFunction::EmitObjCStringLiteral ( const ObjCStringLiteral E)
llvm::Value * CodeGenFunction::EmitObjCThrowOperand ( const Expr expr)
LValue CodeGenFunction::EmitOpaqueValueLValue ( const OpaqueValueExpr e)
void CodeGenFunction::EmitParmDecl ( const VarDecl D,
llvm::Value Arg,
unsigned  ArgNo 
)
LValue CodeGenFunction::EmitPointerToDataMemberBinaryExpr ( const BinaryOperator E)
Value * CodeGenFunction::EmitPPCBuiltinExpr ( unsigned  BuiltinID,
const CallExpr E 
)

Definition at line 5038 of file CGBuiltin.cpp.

References clang::CallExpr::getArg(), and clang::CallExpr::getNumArgs().

LValue CodeGenFunction::EmitPredefinedLValue ( const PredefinedExpr E)
LValue CodeGenFunction::EmitPseudoObjectLValue ( const PseudoObjectExpr e)

Definition at line 3234 of file CGExpr.cpp.

References emitPseudoObjectExpr(), and clang::CodeGen::AggValueSlot::ignored().

Referenced by EmitLValue().

RValue CodeGenFunction::EmitPseudoObjectRValue ( const PseudoObjectExpr e,
AggValueSlot  slot = AggValueSlot::ignored() 
)

Definition at line 3229 of file CGExpr.cpp.

References emitPseudoObjectExpr().

RValue CodeGenFunction::EmitReferenceBindingToExpr ( const Expr E,
const NamedDecl InitializedDecl 
)
void CodeGenFunction::EmitReturnBlock ( )

EmitReturnBlock - Emit the unified return block, trying to avoid its emission when possible.

Definition at line 106 of file CodeGenFunction.cpp.

References Builder, EmitBlock(), clang::CodeGen::CodeGenFunction::JumpDest::getBlock(), and ReturnBlock.

Referenced by FinishFunction().

void CodeGenFunction::EmitReturnStmt ( const ReturnStmt S)
RValue CodeGenFunction::EmitRValueForField ( LValue  LV,
const FieldDecl FD 
)
Value * CodeGenFunction::EmitScalarConversion ( llvm::Value Src,
QualType  SrcTy,
QualType  DstTy 
)

EmitScalarConversion - Emit a conversion from the specified type to the specified destination type, both of which are LLVM scalar types.

Definition at line 2757 of file CGExprScalar.cpp.

References hasAggregateLLVMType().

Referenced by EvaluateExprAsBool().

Value * CodeGenFunction::EmitScalarExpr ( const Expr E,
bool  IgnoreResultAssign = false 
)
void CodeGenFunction::EmitScalarInit ( const Expr init,
const ValueDecl D,
LValue  lvalue,
bool  capturedByInit 
)
void CodeGenFunction::EmitScalarInit ( llvm::Value init,
LValue  lvalue 
)
llvm::Value * CodeGenFunction::EmitScalarPrePostIncDec ( const UnaryOperator E,
LValue  LV,
bool  isInc,
bool  isPre 
)

Definition at line 2778 of file CGExprScalar.cpp.

Referenced by EmitUnaryOpLValue().

bool CodeGenFunction::EmitSimpleStmt ( const Stmt S)

EmitSimpleStmt - Try to emit a "simple" statement which does not necessarily require an insertion point or debug information; typically because the statement amounts to a jump or a container of other statements.

Returns:
True if the statement was handled.

Definition at line 170 of file CGStmt.cpp.

References EmitAttributedStmt(), EmitBreakStmt(), EmitCaseStmt(), EmitCompoundStmt(), EmitContinueStmt(), EmitDeclStmt(), EmitDefaultStmt(), EmitGotoStmt(), EmitLabelStmt(), and clang::Stmt::getStmtClass().

Referenced by EmitStmt().

void CodeGenFunction::EmitStartEHSpec ( const Decl D)
void CodeGenFunction::EmitStaticVarDecl ( const VarDecl D,
llvm::GlobalValue::LinkageTypes  Linkage 
)
void CodeGenFunction::EmitStdInitializerListCleanup ( llvm::Value loc,
const InitListExpr init 
)
void CodeGenFunction::EmitStmt ( const Stmt S)
LValue CodeGenFunction::EmitStmtExprLValue ( const StmtExpr E)
void CodeGenFunction::EmitStopPoint ( const Stmt S)

EmitStopPoint - Emit a debug stoppoint if we are emitting debug info.

Definition at line 32 of file CGStmt.cpp.

References Builder, getDebugInfo(), clang::Stmt::getLocEnd(), and clang::Stmt::getLocStart().

Referenced by EmitBreakStmt(), EmitContinueStmt(), EmitDeclStmt(), EmitGotoStmt(), and EmitStmt().

void CodeGenFunction::EmitStoreOfScalar ( llvm::Value Value,
llvm::Value Addr,
bool  Volatile,
unsigned  Alignment,
QualType  Ty,
llvm::MDNode *  TBAAInfo = 0,
bool  isInit = false 
)

EmitStoreOfScalar - Store a scalar value to an address, taking care to appropriately convert from the memory representation to the LLVM value representation.

Definition at line 949 of file CGExpr.cpp.

References Builder, CGM, clang::CodeGen::CodeGenModule::DecorateInstruction(), and EmitToMemory().

Referenced by EmitARCStoreAutoreleasing(), EmitARCStoreStrong(), EmitAtomicExpr(), EmitAtomicOp(), EmitCall(), EmitCXXGlobalVarDeclInit(), EmitExprForReferenceBinding(), EmitFunctionEpilog(), EmitParmDecl(), EmitScalarInit(), EmitStoreOfScalar(), EmitStoreThroughLValue(), InitCatchParam(), and tryEmitARCRetainLoadOfScalar().

void CodeGenFunction::EmitStoreOfScalar ( llvm::Value value,
LValue  lvalue,
bool  isInit = false 
)

EmitStoreOfScalar - Store a scalar value to an address, taking care to appropriately convert from the memory representation to the LLVM value representation. The l-value must be a simple l-value. The isInit flag indicates whether this is an initialization. If so, atomic qualifiers are ignored and the store is always non-atomic.

Definition at line 965 of file CGExpr.cpp.

References EmitStoreOfScalar(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::LValue::getAlignment(), clang::CharUnits::getQuantity(), clang::CodeGen::LValue::getTBAAInfo(), clang::CodeGen::LValue::getType(), and clang::CodeGen::LValue::isVolatile().

void CodeGenFunction::EmitStoreThroughBitfieldLValue ( RValue  Src,
LValue  Dst,
llvm::Value **  Result = 0 
)
void CodeGenFunction::EmitStoreThroughExtVectorComponentLValue ( RValue  Src,
LValue  Dst 
)
void CodeGenFunction::EmitStoreThroughLValue ( RValue  Src,
LValue  Dst,
bool  isInit = false 
)

EmitStoreThroughLValue - Store the specified rvalue into the specified lvalue, where both are guaranteed to the have the same type, and that type is 'Ty'.

Definition at line 1117 of file CGExpr.cpp.

References Builder, CGM, ConvertType(), EmitARCStoreStrong(), EmitARCStoreWeak(), EmitObjCExtendObjectLifetime(), clang::CodeGen::CGObjCRuntime::EmitObjCGlobalAssign(), clang::CodeGen::CGObjCRuntime::EmitObjCIvarAssign(), clang::CodeGen::CGObjCRuntime::EmitObjCStrongCastAssign(), clang::CodeGen::CGObjCRuntime::EmitObjCWeakAssign(), EmitScalarExpr(), EmitStoreOfScalar(), EmitStoreThroughBitfieldLValue(), EmitStoreThroughExtVectorComponentLValue(), clang::CodeGen::RValue::get(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::LValue::getAlignment(), clang::CodeGen::LValue::getBaseIvarExp(), getContext(), clang::Qualifiers::getObjCLifetime(), clang::CodeGen::CodeGenModule::getObjCRuntime(), clang::CodeGen::LValue::getQuals(), clang::CharUnits::getQuantity(), clang::CodeGen::RValue::getScalarVal(), clang::CodeGen::LValue::getType(), clang::CodeGen::LValue::getVectorAddr(), clang::CodeGen::LValue::getVectorIdx(), clang::CodeGen::LValue::isBitField(), clang::CodeGen::LValue::isExtVectorElt(), clang::CodeGen::LValue::isGlobalObjCRef(), clang::CodeGen::LValue::isNonGC(), clang::CodeGen::LValue::isObjCIvar(), clang::CodeGen::LValue::isObjCStrong(), clang::CodeGen::LValue::isObjCWeak(), clang::CodeGen::RValue::isScalar(), clang::CodeGen::LValue::isSimple(), clang::CodeGen::LValue::isThreadLocalRef(), clang::CodeGen::LValue::isVectorElt(), clang::CodeGen::LValue::isVolatileQualified(), clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, and clang::Qualifiers::OCL_Weak.

Referenced by EmitAnyExprToMem(), EmitAsmStmt(), EmitBinaryOperatorLValue(), EmitExprAsInit(), EmitExprForReferenceBinding(), EmitInitializerForField(), EmitObjCForCollectionStmt(), EmitScalarInit(), and emitWriteback().

LValue CodeGenFunction::EmitStringLiteralLValue ( const StringLiteral E)
void CodeGenFunction::EmitSwitchStmt ( const SwitchStmt S)
void CodeGenFunction::EmitSynthesizedCXXCopyCtor ( llvm::Value Dest,
llvm::Value Src,
const Expr Exp 
)
void CodeGenFunction::EmitSynthesizedCXXCopyCtorCall ( const CXXConstructorDecl D,
llvm::Value This,
llvm::Value Src,
CallExpr::const_arg_iterator  ArgBeg,
CallExpr::const_arg_iterator  ArgEnd 
)
Value * CodeGenFunction::EmitTargetBuiltinExpr ( unsigned  BuiltinID,
const CallExpr E 
)

EmitTargetBuiltinExpr - Emit the given builtin call. Returns 0 if the call is unhandled by the current target.

Definition at line 1369 of file CGBuiltin.cpp.

llvm::Value * CodeGenFunction::EmitToMemory ( llvm::Value Value,
QualType  Ty 
)

EmitToMemory - Change a scalar value from its value representation to its in-memory representation.

Definition at line 926 of file CGExpr.cpp.

References Builder, and hasBooleanRepresentation().

Referenced by EmitStoreOfScalar(), and EmitToInt().

LValue CodeGenFunction::EmitUnaryOpLValue ( const UnaryOperator E)
LValue CodeGenFunction::EmitUnsupportedLValue ( const Expr E,
const char *  Name 
)

EmitUnsupportedLValue - Emit a dummy l-value using the type of E and issue an ErrorUnsupported style diagnostic (using the provided Name).

Definition at line 604 of file CGExpr.cpp.

References ConvertType(), ErrorUnsupported(), clang::Expr::getType(), and MakeAddrLValue().

Referenced by EmitCastLValue(), EmitConditionalOperatorLValue(), EmitLValue(), and EmitPredefinedLValue().

RValue CodeGenFunction::EmitUnsupportedRValue ( const Expr E,
const char *  Name 
)

EmitUnsupportedRValue - Emit a dummy r-value using the type of E and issue an ErrorUnsupported style diagnostic (using the provided Name).

Definition at line 598 of file CGExpr.cpp.

References ErrorUnsupported(), clang::Expr::getType(), and GetUndefRValue().

Referenced by EmitAtomicExpr().

llvm::Value * CodeGenFunction::EmitVAArg ( llvm::Value VAListAddr,
QualType  Ty 
)
LValue CodeGenFunction::EmitVAArgExprLValue ( const VAArgExpr E)

Definition at line 2515 of file CGExpr.cpp.

References EmitAggExprToLValue().

Referenced by EmitLValue().

llvm::Value * CodeGenFunction::EmitVAListRef ( const Expr E)
void CodeGenFunction::EmitVarAnnotations ( const VarDecl D,
llvm::Value V 
)
void CodeGenFunction::EmitVarDecl ( const VarDecl D)

EmitVarDecl - Emit a local variable declaration.

This function can be called with a null (unreachable) insert point.

EmitVarDecl - This method handles emission of any variable declaration inside a function, including static vars etc.

Definition at line 109 of file CGDecl.cpp.

References CGM, clang::frontend::CPlusPlus, CurFn, EmitAutoVarDecl(), EmitStaticVarDecl(), clang::CodeGen::CGOpenCLRuntime::EmitWorkGroupLocalVarDecl(), getContext(), getLangOpts(), clang::CodeGen::CodeGenModule::getOpenCLRuntime(), clang::VarDecl::getStorageClass(), clang::InternalLinkage, clang::SC_Auto, clang::SC_Extern, clang::SC_None, clang::SC_OpenCLWorkGroupLocal, clang::SC_PrivateExtern, clang::SC_Register, and clang::SC_Static.

Referenced by EmitDecl().

void CodeGenFunction::EmitVariablyModifiedType ( QualType  Ty)

EmitVLASize - Capture all the sizes for the VLA expressions in the given variably-modified type and store them in the VLASizeMap.

This function can be called with a null (unreachable) insert point.

Definition at line 968 of file CodeGenFunction.cpp.

References Builder, EmitIgnoredExpr(), EmitScalarExpr(), EnsureInsertPoint(), getContext(), clang::ArrayType::getElementType(), getElementType(), clang::QualType::getSingleStepDesugaredType(), clang::VariableArrayType::getSizeExpr(), clang::QualType::getTypePtr(), and clang::CodeGen::CodeGenTypeCache::SizeTy.

Referenced by EmitAutoVarAlloca(), EmitDecl(), EmitStaticVarDecl(), and StartFunction().

void CodeGenFunction::EmitWhileStmt ( const WhileStmt S)
Value * CodeGenFunction::EmitX86BuiltinExpr ( unsigned  BuiltinID,
const CallExpr E 
)
void clang::CodeGen::CodeGenFunction::enableDebugInfo ( ) [inline]

Definition at line 1212 of file CodeGenFunction.h.

Referenced by EmitScalarExpr().

void clang::CodeGen::CodeGenFunction::EnsureInsertPoint ( ) [inline]

EnsureInsertPoint - Ensure that an insertion point is defined so that emitted IR has a place to go. Note that by definition, if this function creates a block then that block is unreachable; callers may do better to detect when no insertion point is defined and simply skip IR generation.

Definition at line 1549 of file CodeGenFunction.h.

References createBasicBlock(), EmitBlock(), and HaveInsertPoint().

Referenced by EmitAutoVarAlloca(), EmitAutoVarInit(), EmitBinaryOperatorLValue(), EmitCall(), EmitCompoundStmt(), EmitStmt(), EmitVariablyModifiedType(), and clang::CodeGen::CodeGenFunction::StmtExprEvaluation::~StmtExprEvaluation().

void CodeGenFunction::enterByrefCleanup ( const AutoVarEmission emission)

Enter a cleanup to destroy a __block variable. Note that this cleanup should be a no-op if the variable hasn't left the stack yet; if a cleanup is required for the variable itself, that needs to be done externally.

Definition at line 1989 of file CGBlocks.cpp.

References clang::LangOptions::GCOnly, and clang::CodeGen::NormalAndEHCleanup.

Referenced by EmitAutoVarCleanups().

void CodeGenFunction::EnterCXXTryStmt ( const CXXTryStmt S,
bool  IsFnTryBlock = false 
)
void CodeGenFunction::EnterDtorCleanups ( const CXXDestructorDecl DD,
CXXDtorType  DtorType 
)
void clang::CodeGen::CodeGenFunction::enterFullExpression ( const ExprWithCleanups E) [inline]
void CodeGenFunction::enterNonTrivialFullExpression ( const ExprWithCleanups E)

Enter a full-expression with a non-trivial number of objects to clean up. This is in this file because, at the moment, the only kind of cleanup object is a BlockDecl*.

Definition at line 573 of file CGBlocks.cpp.

References enterBlockScope(), clang::ExprWithCleanups::getNumObjects(), and clang::ExprWithCleanups::getObjects().

Referenced by enterFullExpression().

void CodeGenFunction::ErrorUnsupported ( const Stmt S,
const char *  Type,
bool  OmitOnError = false 
)

ErrorUnsupported - Print out an error that codegen doesn't support the specified stmt yet.

Definition at line 682 of file CodeGenFunction.cpp.

References CGM, and clang::CodeGen::CodeGenModule::ErrorUnsupported().

Referenced by EmitStdInitializerListCleanup(), EmitUnsupportedLValue(), and EmitUnsupportedRValue().

llvm::Value * CodeGenFunction::EvaluateExprAsBool ( const Expr E)

EvaluateExprAsBool - Perform the usual unary conversions on the specified expression and compare the result against zero, returning an Int1Ty value.

Definition at line 84 of file CGExpr.cpp.

References clang::ASTContext::BoolTy, CGM, EmitComplexExpr(), EmitComplexToScalarConversion(), clang::CodeGen::CGCXXABI::EmitMemberPointerIsNotNull(), EmitScalarConversion(), EmitScalarExpr(), getContext(), clang::CodeGen::CodeGenModule::getCXXABI(), and clang::Expr::getType().

Referenced by EmitBranchOnBoolExpr(), EmitCXXForRangeStmt(), EmitDoStmt(), EmitForStmt(), and EmitWhileStmt().

void CodeGenFunction::ExitCXXTryStmt ( const CXXTryStmt S,
bool  IsFnTryBlock = false 
)
void CodeGenFunction::FinishFunction ( SourceLocation  EndLoc = SourceLocation())
llvm::Function * CodeGenFunction::GenerateBlockFunction ( GlobalDecl  GD,
const CGBlockInfo Info,
const Decl OuterFuncDecl,
const DeclMapTy &  ldm,
bool  IsLambdaConversionToBlock 
)
void CodeGenFunction::GenerateCode ( GlobalDecl  GD,
llvm::Function *  Fn,
const CGFunctionInfo FnInfo 
)
llvm::Constant * CodeGenFunction::GenerateCopyHelperFunction ( const CGBlockInfo blockInfo)
void CodeGenFunction::GenerateCXXGlobalDtorsFunc ( llvm::Function *  Fn,
const std::vector< std::pair< llvm::WeakVH, llvm::Constant * > > &  DtorsAndObjects 
)

GenerateCXXGlobalDtorsFunc - Generates code for destroying global variables.

Definition at line 363 of file CGDeclCXX.cpp.

References Builder, FinishFunction(), getContext(), getTypes(), StartFunction(), and clang::CodeGen::CodeGenTypeCache::VoidTy.

void CodeGenFunction::GenerateCXXGlobalInitFunc ( llvm::Function *  Fn,
llvm::Constant **  Decls,
unsigned  NumDecls 
)
void CodeGenFunction::GenerateCXXGlobalVarDeclInitFunc ( llvm::Function *  Fn,
const VarDecl D,
llvm::GlobalVariable *  Addr,
bool  PerformInit 
)

Emit the code necessary to initialize the given global variable.

Definition at line 317 of file CGDeclCXX.cpp.

References EmitCXXGlobalVarDeclInit(), EmitCXXGuardedInit(), FinishFunction(), getContext(), getTypes(), StartFunction(), and clang::CodeGen::CodeGenTypeCache::VoidTy.

llvm::Function * CodeGenFunction::generateDestroyHelper ( llvm::Constant *  addr,
QualType  type,
Destroyer destroyer,
bool  useEHCleanupForArray 
)
llvm::Constant * CodeGenFunction::GenerateDestroyHelperFunction ( const CGBlockInfo blockInfo)
llvm::Constant * CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction ( const ObjCPropertyImplDecl PID)

Definition at line 2841 of file CGObjC.cpp.

References clang::QualType::addConst(), clang::CodeGen::RequiredArgs::All, clang::CodeGen::CodeGenTypes::arrangeFunctionDeclaration(), clang::frontend::CPlusPlus, clang::CXXConstructExpr::Create(), clang::FunctionDecl::Create(), clang::CodeGen::AggValueSlot::DoesNotNeedGCBarriers, EmitAggExpr(), EmitAnyExpr(), FinishFunction(), clang::CodeGen::AggValueSlot::forAddr(), clang::IdentifierTable::get(), clang::CodeGen::CodeGenModule::getAtomicGetterHelperFnMap(), clang::CodeGen::CodeGenModule::getContext(), getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::ObjCPropertyImplDecl::getGetterCXXConstructor(), getLangOpts(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenModule::getModuleDebugInfo(), clang::ASTContext::getPointerType(), clang::ObjCPropertyDecl::getPropertyAttributes(), clang::ObjCPropertyImplDecl::getPropertyDecl(), clang::CodeGen::RValue::getScalarVal(), clang::ASTContext::getTranslationUnitDecl(), clang::Expr::getType(), clang::ObjCPropertyDecl::getType(), clang::ASTContext::getTypeAlignInChars(), clang::CodeGen::CodeGenModule::getTypes(), hasTrivialGetExpr(), clang::ASTContext::Idents, clang::InternalLinkage, clang::CodeGen::AggValueSlot::IsDestructed, clang::CodeGen::AggValueSlot::IsNotAliased, clang::ObjCPropertyDecl::OBJC_PR_atomic, clang::OK_Ordinary, clang::SC_None, clang::SC_Static, clang::CodeGen::CodeGenModule::setAtomicGetterHelperFnMap(), StartFunction(), clang::UO_Deref, clang::VK_LValue, clang::VK_RValue, clang::CodeGen::CodeGenTypeCache::VoidPtrTy, and clang::ASTContext::VoidTy.

Referenced by GenerateObjCGetter().

llvm::Constant * CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction ( const ObjCPropertyImplDecl PID)

GenerateObjCAtomicSetterCopyHelperFunction - Given a c++ object type with non-trivial copy assignment function, produce following helper function. static void copyHelper(Ty *dest, const Ty *source) { *dest = *source; }

Definition at line 2757 of file CGObjC.cpp.

References clang::QualType::addConst(), clang::CodeGen::RequiredArgs::All, Args, clang::CodeGen::CodeGenTypes::arrangeFunctionDeclaration(), clang::frontend::CPlusPlus, clang::FunctionDecl::Create(), EmitStmt(), FinishFunction(), clang::IdentifierTable::get(), clang::CodeGen::CodeGenModule::getAtomicSetterHelperFnMap(), clang::CallExpr::getCallee(), clang::CodeGen::CodeGenModule::getContext(), getContext(), clang::CodeGen::CodeGenTypes::GetFunctionType(), getLangOpts(), clang::CodeGen::CodeGenModule::getModule(), clang::CodeGen::CodeGenModule::getModuleDebugInfo(), clang::ASTContext::getPointerType(), clang::ObjCPropertyDecl::getPropertyAttributes(), clang::ObjCPropertyImplDecl::getPropertyDecl(), clang::ObjCPropertyImplDecl::getPropertyIvarDecl(), clang::ObjCPropertyImplDecl::getSetterCXXAssignment(), clang::ASTContext::getTranslationUnitDecl(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenModule::getTypes(), hasTrivialSetExpr(), clang::ASTContext::Idents, clang::InternalLinkage, clang::ObjCPropertyDecl::OBJC_PR_atomic, clang::OK_Ordinary, clang::SC_None, clang::SC_Static, clang::CodeGen::CodeGenModule::setAtomicSetterHelperFnMap(), StartFunction(), clang::UO_Deref, clang::VK_LValue, clang::VK_RValue, clang::CodeGen::CodeGenTypeCache::VoidPtrTy, and clang::ASTContext::VoidTy.

Referenced by GenerateObjCSetter().

void CodeGenFunction::GenerateObjCCtorDtorMethod ( ObjCImplementationDecl IMP,
ObjCMethodDecl MD,
bool  ctor 
)
void CodeGenFunction::GenerateObjCGetter ( ObjCImplementationDecl IMP,
const ObjCPropertyImplDecl PID 
)

GenerateObjCGetter - Synthesize an Objective-C property getter function.

GenerateObjCGetter - Generate an Objective-C property getter function. The given Decl must be an ObjCImplementationDecl. is illegal within a category.

Definition at line 704 of file CGObjC.cpp.

References FinishFunction(), GenerateObjCAtomicGetterCopyHelperFunction(), generateObjCGetterBody(), clang::ObjCImplDecl::getClassInterface(), clang::ObjCPropertyDecl::getGetterMethodDecl(), clang::ObjCMethodDecl::getLocStart(), clang::ObjCPropertyImplDecl::getPropertyDecl(), and StartObjCMethod().

void CodeGenFunction::generateObjCGetterBody ( const ObjCImplementationDecl classImpl,
const ObjCPropertyImplDecl propImpl,
llvm::Constant *  AtomicHelperFn 
)

Definition at line 773 of file CGObjC.cpp.

References clang::CodeGen::CallArgList::add(), clang::CodeGen::RequiredArgs::All, AutoreleaseResult, clang::ASTContext::BoolTy, Builder, clang::CodeGen::CodeGenTypes::ConvertType(), ConvertType(), EmitAggregateCopy(), emitARCRetainLoadOfScalar(), EmitCall(), emitCPPObjectAtomicGetterCall(), EmitIvarOffset(), EmitLoadOfLValue(), EmitLValueForIvar(), EmitReturnStmt(), emitStructGetterCall(), clang::CodeGen::CodeGenModule::ErrorUnsupported(), clang::CodeGen::RValue::get(), clang::CodeGen::LValue::getAddress(), clang::ObjCImplDecl::getClassInterface(), clang::ObjCMethodDecl::getCmdDecl(), getContext(), clang::ObjCPropertyImplDecl::getGetterCXXConstructor(), clang::ObjCPropertyDecl::getGetterMethodDecl(), getLLVMContext(), clang::Qualifiers::getObjCLifetime(), clang::CodeGen::CodeGenModule::getObjCRuntime(), clang::ObjCPropertyImplDecl::getPropertyDecl(), clang::CodeGen::CGObjCRuntime::GetPropertyGetFunction(), clang::ObjCPropertyImplDecl::getPropertyIvarDecl(), clang::CodeGen::LValue::getQuals(), clang::ObjCMethodDecl::getResultType(), clang::CodeGen::RValue::getScalarVal(), clang::ValueDecl::getType(), clang::ObjCPropertyDecl::getType(), getTypes(), hasAggregateLLVMType(), hasTrivialGetExpr(), clang::CodeGen::LValue::isVolatileQualified(), LoadComplexFromAddr(), LoadObjCSelf(), clang::Qualifiers::OCL_Weak, ReturnValue, StoreComplexToAddr(), TypeOfSelfObject(), and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.

Referenced by GenerateObjCGetter().

void CodeGenFunction::GenerateObjCMethod ( const ObjCMethodDecl OMD)

Generate an Objective-C method. An Objective-C method is a C function with its pointer, name, and types registered in the class struture.

Definition at line 478 of file CGObjC.cpp.

References EmitStmt(), FinishFunction(), clang::ObjCMethodDecl::getBody(), clang::Decl::getBodyRBrace(), clang::ObjCMethodDecl::getClassInterface(), clang::ObjCMethodDecl::getLocStart(), and StartObjCMethod().

Referenced by clang::CodeGen::CodeGenModule::EmitTopLevelDecl().

void CodeGenFunction::GenerateObjCSetter ( ObjCImplementationDecl IMP,
const ObjCPropertyImplDecl PID 
)

GenerateObjCSetter - Synthesize an Objective-C property setter function for the given property.

GenerateObjCSetter - Generate an Objective-C property setter function. The given Decl must be an ObjCImplementationDecl. is illegal within a category.

Definition at line 1212 of file CGObjC.cpp.

References FinishFunction(), GenerateObjCAtomicSetterCopyHelperFunction(), generateObjCSetterBody(), clang::ObjCImplDecl::getClassInterface(), clang::ObjCMethodDecl::getLocStart(), clang::ObjCPropertyImplDecl::getPropertyDecl(), clang::ObjCPropertyDecl::getSetterMethodDecl(), and StartObjCMethod().

void CodeGenFunction::generateObjCSetterBody ( const ObjCImplementationDecl classImpl,
const ObjCPropertyImplDecl propImpl,
llvm::Constant *  AtomicHelperFn 
)

Definition at line 1037 of file CGObjC.cpp.

References clang::CodeGen::CallArgList::add(), clang::CodeGen::RequiredArgs::All, clang::BO_Assign, clang::ASTContext::BoolTy, Builder, clang::CK_AnyPointerToBlockPointerCast, clang::CK_BitCast, clang::CK_BlockPointerToObjCPointerCast, clang::CK_CPointerToObjCPointerCast, clang::CK_LValueToRValue, clang::CK_NoOp, EmitCall(), emitCPPObjectAtomicSetterCall(), EmitIvarOffset(), EmitLValueForIvar(), EmitStmt(), emitStructSetterCall(), clang::CodeGen::CodeGenModule::ErrorUnsupported(), clang::CodeGen::RValue::get(), clang::CodeGen::LValue::getAddress(), clang::ObjCImplDecl::getClassInterface(), clang::ObjCMethodDecl::getCmdDecl(), getContext(), getLLVMContext(), clang::QualType::getNonReferenceType(), clang::CodeGen::CodeGenModule::getObjCRuntime(), clang::CodeGen::CGObjCRuntime::GetOptimizedPropertySetFunction(), clang::ObjCPropertyImplDecl::getPropertyDecl(), clang::ObjCPropertyImplDecl::getPropertyIvarDecl(), clang::CodeGen::CGObjCRuntime::GetPropertySetFunction(), clang::ObjCMethodDecl::getSelfDecl(), clang::ObjCPropertyImplDecl::getSetterCXXAssignment(), clang::ObjCPropertyDecl::getSetterMethodDecl(), clang::Expr::getType(), clang::ValueDecl::getType(), getTypes(), clang::QualType::getUnqualifiedType(), clang::ASTContext::hasSameUnqualifiedType(), hasTrivialSetExpr(), LoadObjCSelf(), clang::OK_Ordinary, clang::ImplicitCastExpr::OnStack, clang::ObjCMethodDecl::param_begin(), TypeOfSelfObject(), UseOptimizedSetter(), clang::VK_LValue, clang::VK_RValue, clang::CodeGen::CodeGenTypeCache::VoidPtrTy, and clang::CodeGen::CodeGenTypeCache::VoidTy.

Referenced by GenerateObjCSetter().

void CodeGenFunction::GenerateThunk ( llvm::Function *  Fn,
const CGFunctionInfo FnInfo,
GlobalDecl  GD,
const ThunkInfo Thunk 
)

GenerateThunk - Generate a thunk for the given method.

Definition at line 303 of file CGVTables.cpp.

References clang::CodeGen::CallArgList::add(), clang::CodeGen::CGFunctionInfo::arg_begin(), clang::CodeGen::CGFunctionInfo::arg_size(), clang::CodeGen::CodeGenTypes::arrangeFunctionCall(), clang::CodeGen::CodeGenTypes::arrangeGlobalDeclaration(), clang::CodeGen::CGCXXABI::BuildInstanceFunctionParams(), CGM, CurFnInfo, CurGD, EmitCall(), EmitDelegateCallArg(), clang::CodeGen::CGCXXABI::EmitInstanceFunctionProlog(), clang::CodeGen::CGCXXABI::EmitReturnFromThunk(), FinishFunction(), clang::CodeGen::RequiredArgs::forPrototypePlus(), clang::CodeGen::RValue::get(), clang::CodeGen::CodeGenModule::GetAddrOfFunction(), clang::CodeGen::CGFunctionInfo::getCallingConvention(), getContext(), clang::CodeGen::CodeGenModule::getCXXABI(), clang::GlobalDecl::getDecl(), clang::CodeGen::CodeGenTypes::GetFunctionType(), clang::ABIArgInfo::getKind(), clang::CodeGen::CGFunctionInfo::getRegParm(), clang::CodeGen::CGFunctionInfo::getReturnInfo(), clang::CodeGen::CGFunctionInfo::getReturnType(), clang::CXXMethodDecl::getThisType(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenModule::getTypes(), hasAggregateLLVMType(), clang::ABIArgInfo::Indirect, clang::ReturnAdjustment::isEmpty(), clang::CodeGen::CGFunctionInfo::isNoReturn(), clang::CodeGen::ReturnValueSlot::isNull(), LoadCXXThis(), clang::ThisAdjustment::NonVirtual, Param, clang::FunctionDecl::param_begin(), clang::FunctionDecl::param_end(), PerformReturnAdjustment(), PerformTypeAdjustment(), clang::ThunkInfo::Return, ReturnValue, clang::CodeGen::CodeGenModule::setFunctionLinkage(), setThunkVisibility(), similar(), StartFunction(), clang::ThunkInfo::This, and clang::ThisAdjustment::VCallOffsetOffset.

void CodeGenFunction::GenerateVarArgsThunk ( llvm::Function *  Fn,
const CGFunctionInfo FnInfo,
GlobalDecl  GD,
const ThunkInfo Thunk 
)
unsigned CodeGenFunction::getAccessedFieldNo ( unsigned  Idx,
const llvm::Constant *  Elts 
) [static]

getAccessedFieldNo - Given an encoded value and a result number, return the input field number being accessed.

Definition at line 513 of file CGExpr.cpp.

Referenced by EmitLoadOfExtVectorElementLValue(), and EmitStoreThroughExtVectorComponentLValue().

llvm::Value * CodeGenFunction::GetAddressOfBaseClass ( llvm::Value Value,
const CXXRecordDecl Derived,
CastExpr::path_const_iterator  PathBegin,
CastExpr::path_const_iterator  PathEnd,
bool  NullCheckValue 
)

GetAddressOfBaseClass - This function will add the necessary delta to the load of 'this' and returns address of the base class.

Definition at line 135 of file CGClass.cpp.

References ApplyNonVirtualAndVirtualOffset(), Builder, ComputeNonVirtualBaseClassOffset(), ConvertType(), createBasicBlock(), EmitBlock(), clang::ASTContext::getASTRecordLayout(), getContext(), clang::ASTRecordLayout::getVBaseClassOffset(), GetVirtualBaseClassOffset(), and clang::CharUnits::isZero().

Referenced by EmitCastLValue(), and EmitExprForReferenceBinding().

llvm::Value * CodeGenFunction::GetAddressOfDerivedClass ( llvm::Value Value,
const CXXRecordDecl Derived,
CastExpr::path_const_iterator  PathBegin,
CastExpr::path_const_iterator  PathEnd,
bool  NullCheckValue 
)
llvm::Value * CodeGenFunction::GetAddressOfDirectBaseInCompleteClass ( llvm::Value This,
const CXXRecordDecl Derived,
const CXXRecordDecl Base,
bool  BaseIsVirtual 
)

GetAddressOfBaseOfCompleteClass - Convert the given pointer to a complete class to the given direct base.

Gets the address of a direct base class within a complete object. This should only be used for (1) non-virtual bases or (2) virtual bases when the type is known to be complete (e.g. in complete destructors).

The object pointed to by 'This' is assumed to be non-null.

Definition at line 78 of file CGClass.cpp.

References Builder, ConvertType(), clang::ASTContext::getASTRecordLayout(), clang::ASTRecordLayout::getBaseClassOffset(), getContext(), getElementType(), clang::ASTRecordLayout::getVBaseClassOffset(), and clang::CodeGen::CodeGenTypeCache::Int8PtrTy.

Referenced by EmitBaseInitializer().

llvm::Value * CodeGenFunction::GetAddrOfBlockDecl ( const VarDecl var,
bool  ByRef 
)
llvm::BlockAddress * CodeGenFunction::GetAddrOfLabel ( const LabelDecl L)
llvm::Value* clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar ( const VarDecl VD) [inline]
llvm::Constant* clang::CodeGen::CodeGenFunction::GetAddrOfStaticLocalVar ( const VarDecl BVD) [inline]

GetAddrOfStaticLocalVar - Return the address of a static local variable.

Definition at line 1658 of file CodeGenFunction.h.

References GetAddrOfLocalVar().

CleanupKind clang::CodeGen::CodeGenFunction::getARCCleanupKind ( ) [inline]
unsigned CodeGenFunction::getByRefValueLLVMField ( const ValueDecl VD) const

getByrefValueFieldNumber - Given a declaration, returns the LLVM field number that holds the value.

Definition at line 1807 of file CGBlocks.cpp.

Referenced by EmitScalarInit(), and clang::CodeGen::CodeGenFunction::AutoVarEmission::getObjectAddress().

CleanupKind clang::CodeGen::CodeGenFunction::getCleanupKind ( QualType::DestructionKind  kind) [inline]
ASTContext& clang::CodeGen::CodeGenFunction::getContext ( ) const [inline]

Definition at line 1205 of file CodeGenFunction.h.

References CGM, and clang::CodeGen::CodeGenModule::getContext().

Referenced by AddInitializerToStaticVarDecl(), AdjustRelatedResultType(), ApplyNonVirtualAndVirtualOffset(), CheckAggExprForMemSetUse(), CodeGenFunction(), ConstantFoldsToSimpleInteger(), ConvertType(), CreateAggTemp(), CreateIRTemp(), CreateMemTemp(), CreateStaticVarDecl(), EmitAggMemberInitializer(), EmitAggregateCopy(), EmitAnyExprToMem(), emitArrayLength(), EmitArraySubscriptExpr(), EmitAsmStmt(), EmitAtomicExpr(), EmitAutoVarAlloca(), EmitAutoVarInit(), EmitBaseInitializer(), EmitBinaryAtomic(), EmitBinaryAtomicPost(), EmitBlockCopyAndAutorelease(), EmitCall(), EmitCallArg(), EmitCallExpr(), EmitCaseStmt(), EmitCaseStmtRange(), EmitCastLValue(), EmitCheckedLValue(), EmitComplexPrePostIncDec(), EmitCompoundStmt(), emitCPPObjectAtomicGetterCall(), emitCPPObjectAtomicSetterCall(), EmitCXXAggrConstructorCall(), EmitCXXConstructExpr(), EmitCXXDeleteExpr(), EmitCXXDestructorCall(), EmitCXXGlobalVarDeclInit(), EmitCXXMemberCall(), EmitCXXMemberCallExpr(), EmitCXXMemberPointerCallExpr(), EmitCXXNewAllocSize(), EmitCXXNewExpr(), EmitCXXOperatorMemberCallee(), EmitCXXThrowExpr(), EmitDeclInit(), EmitDeclInvariant(), EmitDeclRefLValue(), EmitDelegateCallArg(), EmitDelegateCXXConstructorCall(), EmitDelegatingCXXConstructorCall(), EmitDeleteCall(), emitDestroy(), EmitDestructorBody(), EmitDynamicCastCall(), EmitEndEHSpec(), EmitExprForReferenceBinding(), EmitForwardingCallToLambda(), EmitFunctionDeclLValue(), EmitFunctionEpilog(), EmitFunctionProlog(), EmitGlobalVarDeclLValue(), EmitInitializerForField(), EmitLambdaBlockInvokeBody(), EmitLambdaDelegatingInvokeBody(), EmitLValue(), EmitLValueForAnonRecordField(), EmitLValueForField(), EmitLValueForFieldInitialization(), EmitMemberExpr(), EmitMemberInitializer(), emitNonZeroVLAInit(), EmitNullBaseClassInitialization(), EmitNullInitialization(), EmitObjCForCollectionStmt(), EmitObjCIvarRefLValue(), EmitObjCMRRAutoreleasePoolPop(), EmitObjCMRRAutoreleasePoolPush(), EmitParmDecl(), emitPartialArrayDestroy(), emitPointerArithmetic(), EmitPredefinedLValue(), EmitReturnStmt(), EmitStartEHSpec(), EmitStaticVarDecl(), EmitStdInitializerListCleanup(), EmitStoreThroughLValue(), emitStructGetterCall(), emitStructSetterCall(), EmitSwitchStmt(), EmitSynthesizedCXXCopyCtor(), EmitSynthesizedCXXCopyCtorCall(), EmitUnaryOpLValue(), EmitVAArgFromMemory(), EmitVAListRef(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), EmitVarDecl(), EmitVariablyModifiedType(), EmitZeroMemSet(), ErrorUnsupportedABI(), EvaluateExprAsBool(), generateByrefCopyHelper(), generateByrefDisposeHelper(), GenerateCode(), GenerateCXXGlobalDtorsFunc(), GenerateCXXGlobalInitFunc(), GenerateCXXGlobalVarDeclInitFunc(), generateDestroyHelper(), GenerateObjCAtomicGetterCopyHelperFunction(), GenerateObjCAtomicSetterCopyHelperFunction(), generateObjCGetterBody(), generateObjCSetterBody(), GenerateThunk(), GetAddressOfBaseClass(), GetAddressOfDerivedClass(), GetAddressOfDirectBaseInCompleteClass(), getDynamicCastFn(), GetNumNonZeroBytesInInit(), GetStaticDeclName(), GetVirtualBaseClassOffset(), getVLASize(), GetVTTParameter(), InitCatchParam(), InitializeVTablePointers(), isCheapEnoughToEvaluateUnconditionally(), MakeAddrLValue(), MakeNaturalAlignAddrLValue(), PerformTypeAdjustment(), StartFunction(), StoreAnyExprIntoOneUnit(), tryEmitAsConstant(), and TypeOfSelfObject().

CGDebugInfo* clang::CodeGen::CodeGenFunction::getDebugInfo ( ) [inline]
CodeGenFunction::Destroyer * CodeGenFunction::getDestroyer ( QualType::DestructionKind  destructionKind)
llvm::BasicBlock * CodeGenFunction::getEHDispatchBlock ( EHScopeStack::stable_iterator  scope)
llvm::BasicBlock * CodeGenFunction::getEHResumeBlock ( )
llvm::Value * CodeGenFunction::getEHSelectorSlot ( )
llvm::Value * CodeGenFunction::getExceptionFromSlot ( )

Returns the contents of the function's exception object and selector slots.

Definition at line 395 of file CGException.cpp.

References Builder, and getExceptionSlot().

Referenced by BeginCatch(), emitFilterDispatchBlock(), clang::CodeGen::CGObjCRuntime::EmitTryCatchStmt(), clang::CodeGen::CodeGenFunction::FinallyInfo::exit(), getEHResumeBlock(), and InitCatchParam().

llvm::Value * CodeGenFunction::getExceptionSlot ( )

Returns a pointer to the function's exception object and selector slot, which is assigned in every landing pad.

Definition at line 383 of file CGException.cpp.

References CreateTempAlloca(), ExceptionSlot, and clang::CodeGen::CodeGenTypeCache::Int8PtrTy.

Referenced by EmitLandingPad(), and getExceptionFromSlot().

llvm::BasicBlock * CodeGenFunction::GetIndirectGotoBlock ( )
llvm::BasicBlock* clang::CodeGen::CodeGenFunction::getInvokeDest ( ) [inline]
llvm::BasicBlock * CodeGenFunction::getInvokeDestImpl ( )
CodeGenFunction::JumpDest CodeGenFunction::getJumpDestForLabel ( const LabelDecl S)

getBasicBlockForLabel - Return the LLVM basicblock that the specified label maps to.

Definition at line 299 of file CGStmt.cpp.

References createBasicBlock(), clang::NamedDecl::getName(), clang::CodeGen::EHScopeStack::stable_iterator::invalid(), clang::CodeGen::CodeGenFunction::JumpDest::isValid(), and NextCleanupDestIndex.

Referenced by EmitGotoStmt(), EmitIndirectGotoStmt(), and GetAddrOfLabel().

JumpDest clang::CodeGen::CodeGenFunction::getJumpDestInCurrentScope ( llvm::BasicBlock *  Target) [inline]

The given basic block lies in the current EH scope, but may be a target of a potentially scope-crossing jump; get a stable handle to which we can perform this jump later.

Definition at line 883 of file CodeGenFunction.h.

References EHStack, clang::CodeGen::EHScopeStack::getInnermostNormalCleanup(), and NextCleanupDestIndex.

Referenced by EmitCXXForRangeStmt(), EmitDoStmt(), EmitForStmt(), EmitLabel(), EmitObjCForCollectionStmt(), EmitSwitchStmt(), clang::CodeGen::CGObjCRuntime::EmitTryCatchStmt(), EmitWhileStmt(), clang::CodeGen::CodeGenFunction::FinallyInfo::enter(), getJumpDestInCurrentScope(), and StartFunction().

JumpDest clang::CodeGen::CodeGenFunction::getJumpDestInCurrentScope ( StringRef  Name = StringRef()) [inline]

The given basic block lies in the current EH scope, but may be a target of a potentially scope-crossing jump; get a stable handle to which we can perform this jump later.

Definition at line 892 of file CodeGenFunction.h.

References createBasicBlock(), and getJumpDestInCurrentScope().

const LangOptions& clang::CodeGen::CodeGenFunction::getLangOpts ( ) const [inline]
llvm::LLVMContext& clang::CodeGen::CodeGenFunction::getLLVMContext ( ) [inline]
llvm::Value * CodeGenFunction::getNormalCleanupDestSlot ( )

Definition at line 1090 of file CGCleanup.cpp.

Referenced by ResolveAllBranchFixups(), and TransitionToCleanupSwitch().

const LValue& clang::CodeGen::CodeGenFunction::getOpaqueLValueMapping ( const OpaqueValueExpr e) [inline]

getOpaqueLValueMapping - Given an opaque value expression (which must be mapped to an l-value), return its mapping.

Definition at line 1671 of file CodeGenFunction.h.

References clang::CodeGen::CodeGenFunction::OpaqueValueMapping::shouldBindAsLValue().

Referenced by EmitOpaqueValueLValue().

const RValue& clang::CodeGen::CodeGenFunction::getOpaqueRValueMapping ( const OpaqueValueExpr e) [inline]

getOpaqueRValueMapping - Given an opaque value expression (which must be mapped to an r-value), return its mapping.

Definition at line 1682 of file CodeGenFunction.h.

References clang::CodeGen::CodeGenFunction::OpaqueValueMapping::shouldBindAsLValue().

llvm::Value * CodeGenFunction::getSelectorFromSlot ( )

Definition at line 399 of file CGException.cpp.

References Builder, and getEHSelectorSlot().

Referenced by emitCatchDispatchBlock(), emitFilterDispatchBlock(), and getEHResumeBlock().

llvm::BasicBlock * CodeGenFunction::getTerminateHandler ( )

getTerminateHandler - Return a handler (not a landing pad, just a catch handler) that just calls terminate. This is used when a terminate scope encloses a try.

Definition at line 1514 of file CGException.cpp.

References Builder, createBasicBlock(), and getTerminateFn().

Referenced by getEHDispatchBlock().

llvm::BasicBlock * CodeGenFunction::getTerminateLandingPad ( )
llvm::BasicBlock * CodeGenFunction::getTrapBB ( )

getTrapBB - Create a basic block that will call the trap intrinsic. We'll generate a branch around the created basic block as necessary.

Definition at line 1721 of file CGExpr.cpp.

References Builder, CGM, createBasicBlock(), EmitBlock(), EmitBranch(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenModule::getIntrinsic(), HaveInsertPoint(), and clang::CodeGenOptions::OptimizationLevel.

Referenced by EmitCheck().

CodeGenTypes& clang::CodeGen::CodeGenFunction::getTypes ( ) const [inline]
RValue CodeGenFunction::GetUndefRValue ( QualType  Ty)

GetUndefRValue - Get an appropriate 'undef' rvalue for the given type.

Definition at line 577 of file CGExpr.cpp.

References ConvertType(), CreateMemTemp(), clang::CodeGen::RValue::get(), clang::CodeGen::RValue::getAggregate(), clang::CodeGen::RValue::getComplex(), and hasAggregateLLVMType().

Referenced by EmitCall(), and EmitUnsupportedRValue().

llvm::BasicBlock* clang::CodeGen::CodeGenFunction::getUnreachableBlock ( ) [inline]
llvm::Constant * CodeGenFunction::getUnwindResumeFn ( )
llvm::Constant * CodeGenFunction::getUnwindResumeOrRethrowFn ( )
llvm::Value * CodeGenFunction::GetVirtualBaseClassOffset ( llvm::Value This,
const CXXRecordDecl ClassDecl,
const CXXRecordDecl BaseClassDecl 
)
std::pair< llvm::Value *, QualType > CodeGenFunction::getVLASize ( const VariableArrayType vla)

getVLASize - Returns an LLVM value that corresponds to the size, in non-variably-sized elements, of a variable length array type, plus that largest non-variably-sized element type. Assumes that the type has already been emitted with EmitVariablyModifiedType.

Definition at line 946 of file CodeGenFunction.cpp.

References Builder, getContext(), clang::ArrayType::getElementType(), clang::VariableArrayType::getSizeExpr(), and clang::CodeGen::CodeGenTypeCache::SizeTy.

Referenced by emitArrayLength(), EmitArraySubscriptExpr(), EmitAutoVarAlloca(), EmitNullInitialization(), emitPointerArithmetic(), and getVLASize().

std::pair< llvm::Value *, QualType > CodeGenFunction::getVLASize ( QualType  vla)
llvm::Value * CodeGenFunction::GetVTablePtr ( llvm::Value This,
llvm::Type *  Ty 
)

GetVTablePtr - Return the Value of the vtable pointer member pointed to by This.

Definition at line 1608 of file CGClass.cpp.

References Builder, CGM, clang::CodeGen::CodeGenModule::DecorateInstruction(), and clang::CodeGen::CodeGenModule::getTBAAInfoForVTablePtr().

Referenced by BuildVirtualCall(), EmitDynamicCastCall(), EmitTypeidFromVTable(), and GetVirtualBaseClassOffset().

bool CodeGenFunction::hasAggregateLLVMType ( QualType  T) [static]
bool clang::CodeGen::CodeGenFunction::HaveInsertPoint ( ) const [inline]

HaveInsertPoint - True if an insertion point is defined. If not, this indicates that the current code being emitted is unreachable.

Definition at line 1541 of file CodeGenFunction.h.

References Builder.

Referenced by EmitAutoVarAlloca(), EmitAutoVarCleanups(), EmitAutoVarInit(), EmitBreakStmt(), EmitCleanup(), EmitContinueStmt(), EmitDeclStmt(), EmitGotoStmt(), EmitStmt(), EnsureInsertPoint(), enterBlockScope(), ExitCXXTryStmt(), getTrapBB(), and protectFromPeepholes().

bool CodeGenFunction::IndirectObjCSetterArg ( const CGFunctionInfo FI)
void CodeGenFunction::initFullExprCleanup ( )
void CodeGenFunction::InitializeVTablePointer ( BaseSubobject  Base,
const CXXRecordDecl NearestVBase,
CharUnits  OffsetFromNearestVBase,
llvm::Constant *  VTable,
const CXXRecordDecl VTableClass 
)
void CodeGenFunction::InitializeVTablePointers ( BaseSubobject  Base,
const CXXRecordDecl NearestVBase,
CharUnits  OffsetFromNearestVBase,
bool  BaseIsNonVirtualPrimaryBase,
llvm::Constant *  VTable,
const CXXRecordDecl VTableClass,
VisitedVirtualBasesSetTy VBases 
)
void CodeGenFunction::InitializeVTablePointers ( const CXXRecordDecl ClassDecl)
void CodeGenFunction::InitTempAlloca ( llvm::AllocaInst *  Alloca,
llvm::Value Value 
)

InitTempAlloca - Provide an initial value for the given alloca.

Definition at line 57 of file CGExpr.cpp.

References AllocaInsertPt.

bool clang::CodeGen::CodeGenFunction::isInConditionalBranch ( ) const [inline]

isInConditionalBranch - Return true if we're currently emitting one branch or the other of a conditional expression.

Definition at line 943 of file CodeGenFunction.h.

Referenced by EnterNewDeleteCleanup(), pushFullExprCleanup(), setBeforeOutermostConditional(), and SetupCleanupBlockActivation().

bool CodeGenFunction::isObviouslyBranchWithoutCleanups ( JumpDest  Dest) const

isObviouslyBranchWithoutCleanups - Return true if a branch to the specified destination obviously has no cleanups to run. 'false' is always a conservatively correct answer for this method.

Definition at line 848 of file CGCleanup.cpp.

References clang::CodeGen::EHScopeStack::stable_iterator::encloses(), and clang::CodeGen::CodeGenFunction::JumpDest::getScopeDepth().

Referenced by EmitCaseStmt().

bool CodeGenFunction::IvarTypeWithAggrGCObjects ( QualType  Ty)
llvm::Value* clang::CodeGen::CodeGenFunction::LoadBlockStruct ( ) [inline]

Definition at line 1361 of file CodeGenFunction.h.

References BlockPointer.

ComplexPairTy CodeGenFunction::LoadComplexFromAddr ( llvm::Value SrcAddr,
bool  SrcIsVolatile 
)

LoadComplexFromAddr - Load a complex number from the specified address.

Definition at line 813 of file CGExprComplex.cpp.

Referenced by ConvertTempToRValue(), EmitCall(), EmitComplexPrePostIncDec(), EmitDelegateCallArg(), EmitFunctionEpilog(), EmitRValueForField(), generateObjCGetterBody(), and InitCatchParam().

llvm::Value* clang::CodeGen::CodeGenFunction::LoadCXXThis ( ) [inline]

LoadCXXThis - Load the value of 'this'. This function is only valid while generating code for an C++ member function.

Definition at line 1730 of file CodeGenFunction.h.

Referenced by EmitBaseInitializer(), EmitDelegateCXXConstructorCall(), EmitDelegatingCXXConstructorCall(), EmitDestructorBody(), EmitMemberInitializer(), GenerateThunk(), and InitializeVTablePointer().

llvm::Value* clang::CodeGen::CodeGenFunction::LoadCXXVTT ( ) [inline]

LoadCXXVTT - Load the VTT parameter to base constructors/destructors have virtual bases.

Definition at line 1737 of file CodeGenFunction.h.

Referenced by GetVTTParameter(), and InitializeVTablePointer().

llvm::Value * CodeGenFunction::LoadObjCSelf ( )

LoadObjCSelf - Load the value of self. This function is only valid while generating code for an Objective-C method.

Definition at line 1347 of file CGObjC.cpp.

References Builder, CurFuncDecl, and clang::ObjCMethodDecl::getSelfDecl().

Referenced by emitCPPObjectAtomicGetterCall(), emitCPPObjectAtomicSetterCall(), emitCXXDestructMethod(), EmitObjCMessageExpr(), emitStructGetterCall(), emitStructSetterCall(), GenerateObjCCtorDtorMethod(), generateObjCGetterBody(), and generateObjCSetterBody().

LValue clang::CodeGen::CodeGenFunction::MakeAddrLValue ( llvm::Value V,
QualType  T,
CharUnits  Alignment = CharUnits() 
) [inline]
LValue clang::CodeGen::CodeGenFunction::MakeNaturalAlignAddrLValue ( llvm::Value V,
QualType  T 
) [inline]
void CodeGenFunction::MaybeEmitStdInitializerListCleanup ( llvm::Value loc,
const Expr init 
)
bool clang::CodeGen::CodeGenFunction::needsEHCleanup ( QualType::DestructionKind  kind) [inline]
void CodeGenFunction::popCatchScope ( )

popCatchScope - Pops the catch scope at the top of the EHScope stack, emitting any required code (other than the catch handlers themselves).

Definition at line 1213 of file CGException.cpp.

References clang::CodeGen::EHScopeStack::begin(), EHStack, emitCatchDispatchBlock(), clang::CodeGen::EHScope::hasEHBranches(), and clang::CodeGen::EHScopeStack::popCatch().

Referenced by clang::CodeGen::CGObjCRuntime::EmitTryCatchStmt(), and clang::CodeGen::CodeGenFunction::FinallyInfo::exit().

void CodeGenFunction::PopCleanupBlock ( bool  FallthroughIsBranchThrough = false)

PopCleanupBlock - Will pop the cleanup entry on the stack and process all branch fixups.

Pops a cleanup block. If the block includes a normal cleanup, the current insertion point is threaded through the cleanup, as are any branch fixups on the cleanup.

Definition at line 529 of file CGCleanup.cpp.

References CreateNormalEntry(), clang::CodeGen::BranchFixup::Destination, clang::CodeGen::BranchFixup::DestinationIndex, destroyOptimisticNormalEntry(), EmitCleanup(), ForwardPrebranchedFallthrough(), clang::CodeGen::EHCleanupScope::getActiveFlag(), clang::CodeGen::EHCleanupScope::getBranchAfterBlock(), clang::CodeGen::EHCleanupScope::getBranchAfterIndex(), clang::CodeGen::EHScope::getCachedEHDispatchBlock(), clang::CodeGen::EHCleanupScope::getCleanupBuffer(), clang::CodeGen::EHCleanupScope::getCleanupSize(), clang::CodeGen::EHScope::getEnclosingEHScope(), clang::CodeGen::EHCleanupScope::getEnclosingNormalCleanup(), clang::CodeGen::EHCleanupScope::getFixupDepth(), clang::CodeGen::EHCleanupScope::getNormalBlock(), clang::CodeGen::EHCleanupScope::getNumBranchAfters(), clang::CodeGen::EHCleanupScope::hasBranches(), clang::CodeGen::EHCleanupScope::hasBranchThroughs(), clang::CodeGen::EHScope::hasEHBranches(), clang::CodeGen::BranchFixup::InitialBranch, clang::CodeGen::EHCleanupScope::isActive(), clang::CodeGen::EHCleanupScope::isEHCleanup(), clang::CodeGen::EHCleanupScope::isNormalCleanup(), clang::CodeGen::BranchFixup::OptimisticBranchBlock, ResolveAllBranchFixups(), S, clang::CodeGen::EHScopeStack::Cleanup::Flags::setIsEHCleanupKind(), clang::CodeGen::EHScopeStack::Cleanup::Flags::setIsForEHCleanup(), clang::CodeGen::EHScopeStack::Cleanup::Flags::setIsNormalCleanupKind(), clang::CodeGen::EHCleanupScope::shouldTestFlagInEHCleanup(), clang::CodeGen::EHCleanupScope::shouldTestFlagInNormalCleanup(), and SimplifyCleanupEntry().

Referenced by EmitArrayDelete(), emitArrayDestroy(), EmitDestructorBody(), EmitObjCForCollectionStmt(), EmitObjectDelete(), and clang::CodeGen::CodeGenFunction::FinallyInfo::exit().

void CodeGenFunction::PopCleanupBlocks ( EHScopeStack::stable_iterator  OldCleanupStackSize)
CodeGenFunction::PeepholeProtection CodeGenFunction::protectFromPeepholes ( RValue  rvalue)

protectFromPeepholes - Protect a value that we're intending to store to the side, but which will probably be used later, from aggressive peepholing optimizations that might delete it.

Pass the result to unprotectFromPeepholes to declare that protection is no longer required.

There's no particular reason why this shouldn't apply to l-values, it's just that no existing peepholes work on pointers.

Definition at line 1095 of file CodeGenFunction.cpp.

References Builder, clang::CodeGen::RValue::getScalarVal(), HaveInsertPoint(), and clang::CodeGen::RValue::isScalar().

Referenced by clang::CodeGen::CodeGenFunction::OpaqueValueMappingData::bind().

void CodeGenFunction::pushDestroy ( QualType::DestructionKind  dtorKind,
llvm::Value addr,
QualType  type 
)

pushDestroy - Push the standard destructor for the given type.

Definition at line 1226 of file CGDecl.cpp.

References clang::CodeGen::EHCleanup, getCleanupKind(), and getDestroyer().

Referenced by EmitAutoVarWithLifetime(), EmitExprForReferenceBinding(), EmitReferenceBindingToExpr(), EmitStdInitializerListCleanup(), and enterBlockScope().

void CodeGenFunction::pushDestroy ( CleanupKind  kind,
llvm::Value addr,
QualType  type,
Destroyer destroyer,
bool  useEHCleanupForArray 
)

Definition at line 1235 of file CGDecl.cpp.

void CodeGenFunction::PushDestructorCleanup ( QualType  T,
llvm::Value Addr 
)

PushDestructorCleanup - Push a cleanup to call the complete-object destructor of an object of the given type at the given address. Does nothing if T is not a C++ class type with a non-trivial destructor.

Definition at line 1436 of file CGClass.cpp.

References clang::CXXRecordDecl::getDestructor(), clang::CXXRecordDecl::hasTrivialDestructor(), and clang::Decl::isUsed().

Referenced by EmitReferenceBindingToExpr().

void CodeGenFunction::PushDestructorCleanup ( const CXXDestructorDecl Dtor,
llvm::Value Addr 
)

PushDestructorCleanup - Push a cleanup to call the complete-object variant of the given destructor on the object at the given address.

Definition at line 1431 of file CGClass.cpp.

References Addr, EHStack, and clang::CodeGen::NormalAndEHCleanup.

template<class T , class A0 >
void clang::CodeGen::CodeGenFunction::pushFullExprCleanup ( CleanupKind  kind,
A0  a0 
) [inline]

pushFullExprCleanup - Push a cleanup to be run at the end of the current full-expression. Safe against the possibility that we're currently inside a conditionally-evaluated expression.

Definition at line 677 of file CodeGenFunction.h.

References EHStack, initFullExprCleanup(), isInConditionalBranch(), and saveValueInCond().

Referenced by EmitAnyExprToExn().

template<class T , class A0 , class A1 >
void clang::CodeGen::CodeGenFunction::pushFullExprCleanup ( CleanupKind  kind,
A0  a0,
A1  a1 
) [inline]

pushFullExprCleanup - Push a cleanup to be run at the end of the current full-expression. Safe against the possibility that we're currently inside a conditionally-evaluated expression.

Definition at line 694 of file CodeGenFunction.h.

References EHStack, initFullExprCleanup(), isInConditionalBranch(), and saveValueInCond().

template<class T , class A0 , class A1 , class A2 >
void clang::CodeGen::CodeGenFunction::pushFullExprCleanup ( CleanupKind  kind,
A0  a0,
A1  a1,
A2  a2 
) [inline]

pushFullExprCleanup - Push a cleanup to be run at the end of the current full-expression. Safe against the possibility that we're currently inside a conditionally-evaluated expression.

Definition at line 712 of file CodeGenFunction.h.

References EHStack, initFullExprCleanup(), isInConditionalBranch(), and saveValueInCond().

template<class T , class A0 , class A1 , class A2 , class A3 >
void clang::CodeGen::CodeGenFunction::pushFullExprCleanup ( CleanupKind  kind,
A0  a0,
A1  a1,
A2  a2,
A3  a3 
) [inline]

pushFullExprCleanup - Push a cleanup to be run at the end of the current full-expression. Safe against the possibility that we're currently inside a conditionally-evaluated expression.

Definition at line 732 of file CodeGenFunction.h.

References EHStack, initFullExprCleanup(), isInConditionalBranch(), and saveValueInCond().

void CodeGenFunction::pushIrregularPartialArrayCleanup ( llvm::Value arrayBegin,
llvm::Value arrayEndPointer,
QualType  elementType,
Destroyer destroyer 
)

pushIrregularPartialArrayCleanup - Push an EH cleanup to destroy already-constructed elements of the given array. The cleanup may be popped with DeactivateCleanupBlock or PopCleanupBlock.

Parameters:
elementType- the immediate element type of the array; possibly still an array type
array- a value of type elementType*
destructionKind- the kind of destruction required
initializedElementCount- a value of type size_t* holding the number of successfully-constructed elements

Definition at line 1423 of file CGDecl.cpp.

References clang::CodeGen::EHCleanup.

Referenced by EmitNewArrayInitializer().

void CodeGenFunction::pushRegularPartialArrayCleanup ( llvm::Value arrayBegin,
llvm::Value arrayEnd,
QualType  elementType,
Destroyer destroyer 
)

pushRegularPartialArrayCleanup - Push an EH cleanup to destroy already-constructed elements of the given array. The cleanup may be popped with DeactivateCleanupBlock or PopCleanupBlock.

Parameters:
elementType- the immediate element type of the array; possibly still an array type
array- a value of type elementType*
destructionKind- the kind of destruction required
initializedElementCount- a value of type size_t* holding the number of successfully-constructed elements

Definition at line 1442 of file CGDecl.cpp.

References clang::CodeGen::EHCleanup.

Referenced by emitArrayDestroy(), EmitCXXAggrConstructorCall(), and EmitNewArrayInitializer().

void CodeGenFunction::registerGlobalDtorWithAtExit ( llvm::Constant *  fn,
llvm::Constant *  addr 
)

Register a global destructor using the C atexit runtime function.

Call atexit() with a function that passes the given argument to the given function.

Definition at line 183 of file CGDeclCXX.cpp.

References Builder, CGM, createAtExitStub(), clang::CodeGen::CodeGenModule::CreateRuntimeFunction(), and clang::CodeGen::CodeGenTypeCache::IntTy.

Referenced by clang::CodeGen::CGCXXABI::registerGlobalDtor().

void CodeGenFunction::ResolveBranchFixups ( llvm::BasicBlock *  Target)
template<class T >
DominatingValue<T>::saved_type clang::CodeGen::CodeGenFunction::saveValueInCond ( value) [inline]

Definition at line 641 of file CodeGenFunction.h.

Referenced by pushFullExprCleanup().

void clang::CodeGen::CodeGenFunction::setBeforeOutermostConditional ( llvm::Value value,
llvm::Value addr 
) [inline]
void CodeGenFunction::SetFPAccuracy ( llvm::Value Val,
float  Accuracy 
)

SetFPAccuracy - Set the minimum required accuracy of the given floating point operation, expressed as the maximum relative error in ulp.

Definition at line 3144 of file CGExpr.cpp.

References getLLVMContext().

bool CodeGenFunction::ShouldInstrumentFunction ( )

ShouldInstrumentFunction - Return true if the current function should be instrumented with __cyg_profile_func_* calls

Definition at line 217 of file CodeGenFunction.cpp.

References CGM, CurFuncDecl, clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::Decl::hasAttr(), and clang::CodeGenOptions::InstrumentFunctions.

Referenced by FinishFunction(), and StartFunction().

bool clang::CodeGen::CodeGenFunction::shouldUseFusedARCCalls ( ) [inline]
void CodeGenFunction::SimplifyForwardingBlocks ( llvm::BasicBlock *  BB)

SimplifyForwardingBlocks - If the given basic block is only a branch to another basic block, simplify it. This assumes that no other code could potentially reference the basic block.

Definition at line 226 of file CGStmt.cpp.

References EHStack, and clang::CodeGen::EHScopeStack::empty().

Referenced by EmitDoStmt(), and EmitWhileStmt().

void clang::CodeGen::CodeGenFunction::StartBlock ( const char *  N)

StartBlock - Start new block named N. If insert block is a dummy block then reuse it.

void CodeGenFunction::StartFunction ( GlobalDecl  GD,
QualType  RetTy,
llvm::Function *  Fn,
const CGFunctionInfo FnInfo,
const FunctionArgList Args,
SourceLocation  StartLoc 
)

Definition at line 254 of file CodeGenFunction.cpp.

References AllocaInsertPt, AutoreleaseResult, Builder, CGM, createBasicBlock(), CreateIRTemp(), CurCodeDecl, CurFn, CurFnInfo, CurFuncDecl, EHStack, EmitFunctionInstrumentation(), EmitFunctionProlog(), clang::CodeGen::CGCXXABI::EmitInstanceFunctionProlog(), EmitLoadOfLValue(), EmitLValueForField(), EmitMCountInstrumentation(), EmitStartEHSpec(), EmitVariablyModifiedType(), FnRetTy, clang::CXXRecordDecl::getCaptureFields(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), getContext(), clang::CodeGen::CodeGenModule::getCXXABI(), getDebugInfo(), clang::GlobalDecl::getDecl(), clang::ASTContext::getFunctionType(), getJumpDestInCurrentScope(), clang::ABIArgInfo::getKind(), getLangOpts(), getLLVMContext(), clang::CodeGen::CodeGenModule::getModule(), clang::FunctionDecl::getOverloadedOperator(), clang::CXXMethodDecl::getParent(), clang::FieldDecl::getParent(), clang::CodeGen::CGFunctionInfo::getReturnInfo(), clang::CodeGen::CGFunctionInfo::getReturnType(), clang::CodeGen::RValue::getScalarVal(), clang::ASTContext::getTagDeclType(), hasAggregateLLVMType(), clang::ABIArgInfo::Indirect, clang::CodeGenOptions::InstrumentForProfiling, clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::CXXRecordDecl::isLambda(), clang::CodeGen::CGFunctionInfo::isReturnsRetained(), LambdaCaptureFields, LambdaThisCaptureField, MakeNaturalAlignAddrLValue(), clang::CodeGenOptions::NoInline, NumArgs, PrologueCleanupDepth, ReturnBlock, ReturnValue, ShouldInstrumentFunction(), and clang::CodeGen::EHScopeStack::stable_begin().

Referenced by createAtExitStub(), generateByrefCopyHelper(), generateByrefDisposeHelper(), GenerateCode(), GenerateCXXGlobalDtorsFunc(), GenerateCXXGlobalInitFunc(), GenerateCXXGlobalVarDeclInitFunc(), generateDestroyHelper(), GenerateObjCAtomicGetterCopyHelperFunction(), GenerateObjCAtomicSetterCopyHelperFunction(), GenerateThunk(), and StartObjCMethod().

void CodeGenFunction::StartObjCMethod ( const ObjCMethodDecl OMD,
const ObjCContainerDecl CD,
SourceLocation  StartLoc 
)
void CodeGenFunction::StoreComplexToAddr ( ComplexPairTy  V,
llvm::Value DestAddr,
bool  DestIsVolatile 
)

StoreComplexToAddr - Store a complex number into the specified address.

Definition at line 806 of file CGExprComplex.cpp.

Referenced by EmitCall(), EmitComplexPrePostIncDec(), EmitExprAsInit(), EmitExprForReferenceBinding(), EmitFunctionEpilog(), generateObjCGetterBody(), and InitCatchParam().

CodeGenFunction::ConstantEmission CodeGenFunction::tryEmitAsConstant ( DeclRefExpr refExpr)

Try to emit a reference to the given value without producing it as an l-value. This is actually more than an optimization: we can't produce an l-value for variables that we never actually captured in a block or lambda, which means const int variables or constexpr literals or similar.

Definition at line 788 of file CGExpr.cpp.

References CEK_AsReferenceOnly, CEK_AsValueOnly, CEK_None, CGM, checkVarTypeForConstantEmission(), clang::CodeGen::CodeGenModule::EmitConstantValue(), EmitDeclRefExprDbgValue(), clang::Expr::EvaluateAsLValue(), clang::Expr::EvaluateAsRValue(), clang::CodeGen::CodeGenFunction::ConstantEmission::forReference(), clang::CodeGen::CodeGenFunction::ConstantEmission::forValue(), getContext(), clang::DeclRefExpr::getDecl(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::Expr::EvalStatus::HasSideEffects, and clang::Expr::EvalResult::Val.

QualType CodeGenFunction::TypeOfSelfObject ( )
void CodeGenFunction::unprotectFromPeepholes ( PeepholeProtection  protection)

Friends And Related Function Documentation

friend class CGCXXABI [friend]

Definition at line 539 of file CodeGenFunction.h.


Member Data Documentation

llvm::AssertingVH<llvm::Instruction> clang::CodeGen::CodeGenFunction::AllocaInsertPt

AllocaInsertPoint - This is an instruction in the entry block before which we prefer to insert allocas.

Definition at line 592 of file CodeGenFunction.h.

Referenced by CreateTempAlloca(), FinishFunction(), InitTempAlloca(), and StartFunction().

In ARC, whether we should autorelease the return value.

Definition at line 602 of file CodeGenFunction.h.

Referenced by EmitFunctionEpilog(), GenerateObjCCtorDtorMethod(), generateObjCGetterBody(), and StartFunction().

Definition at line 604 of file CodeGenFunction.h.

Referenced by EmitLambdaBlockInvokeBody(), and EmitParmDecl().

Definition at line 605 of file CodeGenFunction.h.

Referenced by LoadBlockStruct().

BoundsChecking - Emit run-time bounds checks. Higher values mean potentially higher performance penalties.

Definition at line 596 of file CodeGenFunction.h.

Definition at line 565 of file CodeGenFunction.h.

Referenced by AddInitializerToStaticVarDecl(), AdjustRelatedResultType(), ApplyNonVirtualAndVirtualOffset(), BuildAggStore(), BuildAppleKextVirtualCall(), BuildAppleKextVirtualDestructorCall(), BuildVirtualCall(), CallBeginCatch(), CheckAggExprForMemSetUse(), CoerceIntOrPtrToIntOrPtr(), createAtExitStub(), CreateCoercedLoad(), CreateCoercedStore(), CreateTempAlloca(), EmitAggMemberInitializer(), EmitAggregateCopy(), EmitAnnotationCall(), EmitAnyExprToExn(), emitARCCopyOperation(), EmitARCDestroyWeak(), EmitARCInitWeak(), emitARCLoadOperation(), EmitARCRelease(), emitARCRetainAfterCall(), EmitARCRetainAutorelease(), EmitARCRetainAutoreleasedReturnValue(), EmitARCRetainBlock(), emitARCStoreOperation(), EmitARCStoreStrongCall(), emitARCValueOperation(), emitArgumentDemotion(), EmitArrayDelete(), emitArrayDestroy(), emitArrayLength(), EmitArraySubscriptExpr(), EmitAsmStmt(), EmitAtomicExpr(), EmitAtomicOp(), clang::CodeGen::CGObjCRuntime::EmitAtSynchronizedStmt(), EmitAutoVarAlloca(), EmitAutoVarInit(), EmitBadCastCall(), EmitBadTypeidCall(), EmitBinaryAtomic(), EmitBinaryAtomicPost(), EmitBitCastOfLValueToProperType(), EmitBlock(), EmitBlockAfterUses(), EmitBranch(), EmitBranchOnBoolExpr(), EmitCall(), EmitCallExpr(), EmitCallOrInvoke(), EmitCaseStmt(), EmitCaseStmtRange(), EmitCastLValue(), EmitCastToVoidPtr(), emitCatchDispatchBlock(), EmitCheck(), EmitCleanup(), EmitComplexPrePostIncDec(), EmitConditionalOperatorLValue(), EmitConstructorBody(), emitCPPObjectAtomicGetterCall(), emitCPPObjectAtomicSetterCall(), EmitCXXAggrConstructorCall(), EmitCXXDeleteExpr(), EmitCXXForRangeStmt(), EmitCXXNewAllocSize(), EmitCXXNewExpr(), EmitCXXThrowExpr(), EmitCXXTypeidExpr(), EmitDeclInvariant(), EmitDeclRefLValue(), EmitDelegateCallArg(), EmitDeleteCall(), emitDestroy(), EmitDoStmt(), EmitDynamicCast(), EmitDynamicCastCall(), EmitExtendGCLifetime(), EmitExtVectorElementExpr(), EmitFAbs(), EmitFieldAnnotations(), emitFilterDispatchBlock(), EmitForStmt(), EmitFromInt(), EmitFromMemory(), EmitFunctionDeclLValue(), EmitFunctionEpilog(), EmitFunctionInstrumentation(), EmitFunctionProlog(), emitGlobalDtorWithCXAAtExit(), EmitGlobalVarDeclLValue(), EmitIfStmt(), EmitIndirectGotoStmt(), EmitInitializerForField(), EmitLandingPad(), EmitLoadOfBitfieldLValue(), EmitLoadOfExtVectorElementLValue(), EmitLoadOfLValue(), EmitLoadOfScalar(), EmitLValueForField(), EmitLValueForFieldInitialization(), EmitMCountInstrumentation(), EmitMemberInitializer(), clang::CodeGen::CGCXXABI::EmitMemberPointerComparison(), clang::CodeGen::CGCXXABI::EmitMemberPointerIsNotNull(), EmitNewArrayInitializer(), emitNonZeroVLAInit(), EmitNullBaseClassInitialization(), EmitNullInitialization(), EmitObjCAutoreleasePoolPop(), EmitObjCAutoreleasePoolPush(), EmitObjCAutoreleasePoolStmt(), EmitObjCBoxedExpr(), EmitObjCCollectionLiteral(), EmitObjCForCollectionStmt(), EmitObjCIsaExpr(), EmitObjCMessageExpr(), EmitObjCMRRAutoreleasePoolPush(), EmitObjCProtocolExpr(), EmitObjCSelectorExpr(), EmitObjCSelectorLValue(), EmitObjectDelete(), EmitParmDecl(), emitPartialArrayDestroy(), emitPointerArithmetic(), EmitRecursiveStdInitializerListCleanup(), EmitReturnBlock(), EmitReturnStmt(), EmitScalarInit(), EmitStdInitializerListCleanup(), EmitStmt(), EmitStopPoint(), EmitStoreOfScalar(), EmitStoreThroughBitfieldLValue(), EmitStoreThroughExtVectorComponentLValue(), EmitStoreThroughLValue(), emitStructGetterCall(), emitStructSetterCall(), EmitSwitchStmt(), EmitSynthesizedCXXCopyCtorCall(), clang::CodeGen::CGCXXABI::EmitThisParam(), EmitToInt(), EmitToMemory(), clang::CodeGen::CGObjCRuntime::EmitTryCatchStmt(), EmitTypeidFromVTable(), EmitUnaryOpLValue(), EmitVAArgFromMemory(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), EmitVarAnnotations(), EmitVariablyModifiedType(), EmitWhileStmt(), emitWriteback(), emitWritebackArg(), EmitZeroMemSet(), clang::CodeGen::CodeGenFunction::FinallyInfo::enter(), enterBlockScope(), EnterStructPointerForCoercedAccess(), clang::CodeGen::CodeGenFunction::FinallyInfo::exit(), ExitCXXTryStmt(), findDominatingStoreToReturnValue(), FinishFunction(), clang::CodeGen::CodeGenFunction::LexicalScope::ForceCleanup(), generateByrefCopyHelper(), generateByrefDisposeHelper(), GenerateCXXGlobalDtorsFunc(), GenerateCXXGlobalInitFunc(), GenerateObjCCtorDtorMethod(), generateObjCGetterBody(), generateObjCSetterBody(), GenerateVarArgsThunk(), GetAddressOfBaseClass(), GetAddressOfDerivedClass(), GetAddressOfDirectBaseInCompleteClass(), getEHResumeBlock(), getExceptionFromSlot(), clang::CodeGen::CodeGenFunction::AutoVarEmission::getObjectAddress(), getSelectorFromSlot(), getTerminateHandler(), getTerminateLandingPad(), getTrapBB(), GetVirtualBaseClassOffset(), getVLASize(), GetVTablePtr(), GetVTTParameter(), HaveInsertPoint(), InitCatchParam(), initFullExprCleanup(), InitializeVTablePointer(), clang::CodeGen::CodeGenFunction::LexicalScope::LexicalScope(), LoadObjCSelf(), PerformReturnAdjustment(), PerformTypeAdjustment(), protectFromPeepholes(), clang::CodeGen::CGCXXABI::ReadArrayCookie(), registerGlobalDtorWithAtExit(), ResolveAllBranchFixups(), clang::CodeGen::DominatingLLVMValue::restore(), clang::CodeGen::DominatingLLVMValue::save(), SetupCleanupBlockActivation(), SimplifyCleanupEntry(), StartFunction(), tryEmitARCRetainScalarExpr(), tryEmitFusedAutoreleaseOfResult(), tryRemoveRetainOfSelf(), and clang::CodeGen::CodeGenFunction::LexicalScope::~LexicalScope().

CatchUndefined - Emit run-time checks to catch undefined behaviors.

Definition at line 599 of file CodeGenFunction.h.

Referenced by CodeGenFunction(), and EmitCheck().

Definition at line 561 of file CodeGenFunction.h.

Referenced by AddInitializerToStaticVarDecl(), BuildAppleKextVirtualCall(), BuildAppleKextVirtualDestructorCall(), BuildVirtualCall(), CalculateCookiePadding(), CodeGenFunction(), ConvertType(), ConvertTypeForMem(), CreateCoercedLoad(), CreateCoercedStore(), CreateReferenceTemporary(), CreateStaticVarDecl(), EmitAggregateCopy(), EmitAnnotationCall(), emitARCCopyOperation(), emitARCLoadOperation(), emitARCStoreOperation(), emitARCValueOperation(), EmitArrayDelete(), EmitAsmStmt(), EmitAtomicExpr(), EmitAutoVarAlloca(), EmitAutoVarCleanups(), EmitAutoVarInit(), EmitBaseInitializer(), EmitCall(), EmitCallOrInvoke(), EmitCaseStmt(), emitCatchDispatchBlock(), EmitCheck(), EmitCompoundLiteralLValue(), EmitConstructorBody(), emitCPPObjectAtomicGetterCall(), emitCPPObjectAtomicSetterCall(), EmitCUDAKernelCallExpr(), EmitCXXConstructorCall(), EmitCXXDestructorCall(), EmitCXXGlobalVarDeclInit(), EmitCXXGuardedInit(), EmitCXXMemberCall(), EmitCXXMemberCallExpr(), EmitCXXMemberPointerCallExpr(), EmitCXXNewAllocSize(), EmitCXXNewExpr(), EmitCXXOperatorMemberCallee(), EmitCXXThrowExpr(), EmitCXXTypeidExpr(), EmitDeclDestroy(), EmitDeclInit(), EmitDeclInvariant(), EmitDeclRefExprDbgValue(), EmitDeclRefLValue(), EmitDelegateCXXConstructorCall(), EmitDelegatingCXXConstructorCall(), EmitDeleteCall(), EmitDestructorBody(), EmitDynamicCastCall(), EmitEndEHSpec(), EmitFAbs(), EmitFieldAnnotations(), EmitForwardingCallToLambda(), EmitFunctionDeclLValue(), EmitFunctionInstrumentation(), EmitFunctionProlog(), emitGlobalDtorWithCXAAtExit(), EmitGlobalVarDeclLValue(), EmitInitializerForField(), EmitIvarOffset(), EmitLambdaStaticInvokeFunction(), EmitLambdaToBlockPointerBody(), EmitLandingPad(), EmitLoadOfBitfieldLValue(), EmitLoadOfLValue(), EmitLoadOfScalar(), EmitLValueForBitfield(), EmitLValueForField(), EmitLValueForFieldInitialization(), EmitLValueForIvar(), EmitMCountInstrumentation(), EmitNewInitializer(), EmitNullBaseClassInitialization(), EmitNullInitialization(), EmitObjCBoxedExpr(), EmitObjCCollectionLiteral(), EmitObjCEncodeExprLValue(), EmitObjCMessageExpr(), EmitObjCProtocolExpr(), EmitObjCSelectorExpr(), EmitObjCSelectorLValue(), EmitObjCStringLiteral(), EmitParmDecl(), emitPointerArithmetic(), EmitPointerToDataMemberBinaryExpr(), EmitPredefinedLValue(), EmitReferenceBindingToExpr(), EmitStartEHSpec(), EmitStaticVarDecl(), EmitStoreOfScalar(), EmitStoreThroughBitfieldLValue(), EmitStoreThroughLValue(), EmitStringLiteralLValue(), emitStructGetterCall(), emitStructSetterCall(), EmitSynthesizedCXXCopyCtorCall(), EmitVAArg(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), EmitVarAnnotations(), EmitVarDecl(), enterBlockScope(), EnterCXXTryStmt(), EnterStructPointerForCoercedAccess(), ErrorUnsupported(), ErrorUnsupportedABI(), EvaluateExprAsBool(), FinishFunction(), generateByrefCopyHelper(), generateByrefDisposeHelper(), GenerateCode(), generateDestroyHelper(), GenerateThunk(), GenerateVarArgsThunk(), GetAddressOfDerivedClass(), getAllocateExceptionFn(), getARCCleanupKind(), getAsmSrcLocInfo(), getBadCastFn(), getBadTypeidFn(), getBeginCatchFn(), getCatchallRethrowFn(), getContext(), getDynamicCastFn(), getEHResumeBlock(), getEndCatchFn(), getFreeExceptionFn(), getGetExceptionPtrFn(), getInvokeDestImpl(), getLangOpts(), getLLVMContext(), getReThrowFn(), GetStaticDeclName(), getTerminateFn(), getTerminateLandingPad(), getThrowFn(), getTrapBB(), getTypes(), getUnexpectedFn(), getUnwindResumeFn(), getUnwindResumeOrRethrowFn(), GetVirtualBaseClassOffset(), GetVTablePtr(), GetVTTParameter(), InitCatchParam(), InitializeVTablePointer(), InitializeVTablePointers(), MakeAddrLValue(), MakeNaturalAlignAddrLValue(), needsEHCleanup(), registerGlobalDtorWithAtExit(), ShouldInstrumentFunction(), shouldUseFusedARCCalls(), StartFunction(), StartObjCMethod(), tryEmitAsConstant(), tryEmitFusedAutoreleaseOfResult(), and tryRemoveRetainOfSelf().

CurCodeDecl - This is the inner-most code context, which includes blocks.

Definition at line 571 of file CodeGenFunction.h.

Referenced by EmitDeclRefLValue(), EmitObjCMessageExpr(), EmitParmDecl(), EmitPredefinedLValue(), ErrorUnsupportedABI(), ExitCXXTryStmt(), FinishFunction(), StartFunction(), and tryRemoveRetainOfSelf().

CurFuncDecl - Holds the Decl for the current function or ObjC method. This excludes BlockDecls.

Definition at line 569 of file CodeGenFunction.h.

Referenced by EmitFunctionProlog(), EmitLambdaToBlockPointerBody(), EmitObjCMessageExpr(), GetStaticDeclName(), GetVTTParameter(), LoadObjCSelf(), ShouldInstrumentFunction(), StartFunction(), and TypeOfSelfObject().

Definition at line 1801 of file CodeGenFunction.h.

Referenced by EmitCXXAggrConstructorCall(), and getDestroyer().

EHResumeBlock - Unified block containing a call to llvm.eh.resume.

Definition at line 625 of file CodeGenFunction.h.

Referenced by FinishFunction(), and getEHResumeBlock().

The selector slot. Under the MandatoryCleanup model, all landing pads write the current selector value into this alloca.

Definition at line 633 of file CodeGenFunction.h.

Referenced by getEHSelectorSlot().

The exception slot. All landing pads write the current exception pointer into this alloca.

Definition at line 629 of file CodeGenFunction.h.

Referenced by getExceptionSlot().

FirstBlockInfo - The head of a singly-linked-list of block layouts.

Definition at line 622 of file CodeGenFunction.h.

Referenced by enterBlockScope(), and ~CodeGenFunction().

Definition at line 573 of file CodeGenFunction.h.

Referenced by EmitReturnStmt(), and StartFunction().

Definition at line 607 of file CodeGenFunction.h.

Referenced by EmitDeclRefLValue(), and StartFunction().

Definition at line 608 of file CodeGenFunction.h.

Referenced by StartFunction().

Definition at line 619 of file CodeGenFunction.h.

Referenced by getJumpDestForLabel(), and getJumpDestInCurrentScope().

i32s containing the indexes of the cleanup destinations.

Definition at line 617 of file CodeGenFunction.h.

Referenced by destroyOptimisticNormalEntry().

A mapping from NRVO variables to the flags used to indicate when the NRVO has been applied to this variable.

Definition at line 612 of file CodeGenFunction.h.

Referenced by EmitAutoVarAlloca(), and EmitReturnStmt().

ObjCEHValueStack - Stack of Objective-C exception values, used for rethrows.

Definition at line 648 of file CodeGenFunction.h.

Referenced by clang::CodeGen::CGObjCRuntime::EmitTryCatchStmt().

PrologueCleanupDepth - The cleanup depth enclosing all the cleanups associated with the parameters.

Definition at line 581 of file CodeGenFunction.h.

Referenced by FinishFunction(), and StartFunction().

ReturnBlock - Unified return block.

Definition at line 584 of file CodeGenFunction.h.

Referenced by EmitReturnBlock(), EmitReturnStmt(), and StartFunction().


The documentation for this class was generated from the following files: