#include "CGCUDARuntime.h"
#include "CGCXXABI.h"
#include "CGDebugInfo.h"
#include "CGObjCRuntime.h"
#include "CodeGenFunction.h"
#include "ConstantEmitter.h"
#include "TargetInfo.h"
#include "clang/Basic/CodeGenOptions.h"
#include "clang/CodeGen/CGFunctionInfo.h"
#include "llvm/IR/Intrinsics.h"
usingnamespaceclang;
usingnamespaceCodeGen;
namespace {
struct MemberCallInfo { … };
}
static MemberCallInfo
commonEmitCXXMemberOrOperatorCall(CodeGenFunction &CGF, GlobalDecl GD,
llvm::Value *This, llvm::Value *ImplicitParam,
QualType ImplicitParamTy, const CallExpr *CE,
CallArgList &Args, CallArgList *RtlArgs) { … }
RValue CodeGenFunction::EmitCXXMemberOrOperatorCall(
const CXXMethodDecl *MD, const CGCallee &Callee,
ReturnValueSlot ReturnValue, llvm::Value *This, llvm::Value *ImplicitParam,
QualType ImplicitParamTy, const CallExpr *CE, CallArgList *RtlArgs,
llvm::CallBase **CallOrInvoke) { … }
RValue CodeGenFunction::EmitCXXDestructorCall(
GlobalDecl Dtor, const CGCallee &Callee, llvm::Value *This, QualType ThisTy,
llvm::Value *ImplicitParam, QualType ImplicitParamTy, const CallExpr *CE,
llvm::CallBase **CallOrInvoke) { … }
RValue CodeGenFunction::EmitCXXPseudoDestructorExpr(
const CXXPseudoDestructorExpr *E) { … }
static CXXRecordDecl *getCXXRecord(const Expr *E) { … }
RValue CodeGenFunction::EmitCXXMemberCallExpr(const CXXMemberCallExpr *CE,
ReturnValueSlot ReturnValue,
llvm::CallBase **CallOrInvoke) { … }
RValue CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(
const CallExpr *CE, const CXXMethodDecl *MD, ReturnValueSlot ReturnValue,
bool HasQualifier, NestedNameSpecifier *Qualifier, bool IsArrow,
const Expr *Base, llvm::CallBase **CallOrInvoke) { … }
RValue
CodeGenFunction::EmitCXXMemberPointerCallExpr(const CXXMemberCallExpr *E,
ReturnValueSlot ReturnValue,
llvm::CallBase **CallOrInvoke) { … }
RValue CodeGenFunction::EmitCXXOperatorMemberCallExpr(
const CXXOperatorCallExpr *E, const CXXMethodDecl *MD,
ReturnValueSlot ReturnValue, llvm::CallBase **CallOrInvoke) { … }
RValue CodeGenFunction::EmitCUDAKernelCallExpr(const CUDAKernelCallExpr *E,
ReturnValueSlot ReturnValue,
llvm::CallBase **CallOrInvoke) { … }
static void EmitNullBaseClassInitialization(CodeGenFunction &CGF,
Address DestPtr,
const CXXRecordDecl *Base) { … }
void
CodeGenFunction::EmitCXXConstructExpr(const CXXConstructExpr *E,
AggValueSlot Dest) { … }
void CodeGenFunction::EmitSynthesizedCXXCopyCtor(Address Dest, Address Src,
const Expr *Exp) { … }
static CharUnits CalculateCookiePadding(CodeGenFunction &CGF,
const CXXNewExpr *E) { … }
static llvm::Value *EmitCXXNewAllocSize(CodeGenFunction &CGF,
const CXXNewExpr *e,
unsigned minElements,
llvm::Value *&numElements,
llvm::Value *&sizeWithoutCookie) { … }
static void StoreAnyExprIntoOneUnit(CodeGenFunction &CGF, const Expr *Init,
QualType AllocType, Address NewPtr,
AggValueSlot::Overlap_t MayOverlap) { … }
void CodeGenFunction::EmitNewArrayInitializer(
const CXXNewExpr *E, QualType ElementType, llvm::Type *ElementTy,
Address BeginPtr, llvm::Value *NumElements,
llvm::Value *AllocSizeWithoutCookie) { … }
static void EmitNewInitializer(CodeGenFunction &CGF, const CXXNewExpr *E,
QualType ElementType, llvm::Type *ElementTy,
Address NewPtr, llvm::Value *NumElements,
llvm::Value *AllocSizeWithoutCookie) { … }
static RValue EmitNewDeleteCall(CodeGenFunction &CGF,
const FunctionDecl *CalleeDecl,
const FunctionProtoType *CalleeType,
const CallArgList &Args) { … }
RValue CodeGenFunction::EmitBuiltinNewDeleteCall(const FunctionProtoType *Type,
const CallExpr *TheCall,
bool IsDelete) { … }
namespace {
struct UsualDeleteParams { … };
}
static UsualDeleteParams getUsualDeleteParams(const FunctionDecl *FD) { … }
namespace {
template<typename Traits>
class CallDeleteDuringNew final : public EHScopeStack::Cleanup { … };
}
static void EnterNewDeleteCleanup(CodeGenFunction &CGF,
const CXXNewExpr *E,
Address NewPtr,
llvm::Value *AllocSize,
CharUnits AllocAlign,
const CallArgList &NewArgs) { … }
llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) { … }
void CodeGenFunction::EmitDeleteCall(const FunctionDecl *DeleteFD,
llvm::Value *Ptr, QualType DeleteTy,
llvm::Value *NumElements,
CharUnits CookieSize) { … }
namespace {
struct CallObjectDelete final : EHScopeStack::Cleanup { … };
}
void
CodeGenFunction::pushCallObjectDeleteCleanup(const FunctionDecl *OperatorDelete,
llvm::Value *CompletePtr,
QualType ElementType) { … }
static void EmitDestroyingObjectDelete(CodeGenFunction &CGF,
const CXXDeleteExpr *DE, Address Ptr,
QualType ElementType) { … }
static bool EmitObjectDelete(CodeGenFunction &CGF,
const CXXDeleteExpr *DE,
Address Ptr,
QualType ElementType,
llvm::BasicBlock *UnconditionalDeleteBlock) { … }
namespace {
struct CallArrayDelete final : EHScopeStack::Cleanup { … };
}
static void EmitArrayDelete(CodeGenFunction &CGF,
const CXXDeleteExpr *E,
Address deletedPtr,
QualType elementType) { … }
void CodeGenFunction::EmitCXXDeleteExpr(const CXXDeleteExpr *E) { … }
static llvm::Value *EmitTypeidFromVTable(CodeGenFunction &CGF, const Expr *E,
llvm::Type *StdTypeInfoPtrTy,
bool HasNullCheck) { … }
llvm::Value *CodeGenFunction::EmitCXXTypeidExpr(const CXXTypeidExpr *E) { … }
static llvm::Value *EmitDynamicCastToNull(CodeGenFunction &CGF,
QualType DestTy) { … }
llvm::Value *CodeGenFunction::EmitDynamicCast(Address ThisAddr,
const CXXDynamicCastExpr *DCE) { … }