Lines Matching defs:CGM
37 CodeGenModule &CGM;
45 static llvm::Constant *BuildStruct(CodeGenModule &CGM, CodeGenFunction *CGF,
47 static llvm::Constant *BuildStruct(CodeGenModule &CGM, CodeGenFunction *CGF,
51 ConstStructBuilder(CodeGenModule &CGM, CodeGenFunction *CGF)
52 : CGM(CGM), CGF(CGF), Packed(false),
82 CGM.getDataLayout().getABITypeAlignment(C->getType()));
87 CGM.getDataLayout().getTypeAllocSize(C->getType()));
96 CGM.getVTableContext().getVTableLayout(VTableClass).getAddressPoint(Base);
98 llvm::ConstantInt::get(CGM.Int64Ty, 0),
99 llvm::ConstantInt::get(CGM.Int64Ty, AddressPoint)
111 const ASTContext &Context = CGM.getContext();
164 const ASTContext &Context = CGM.getContext();
207 if (CGM.getDataLayout().isBigEndian()) {
223 if (CGM.getDataLayout().isBigEndian()) {
263 Elements.back() = llvm::ConstantInt::get(CGM.getLLVMContext(), Tmp);
272 if (CGM.getDataLayout().isBigEndian()) {
283 Elements.push_back(llvm::ConstantInt::get(CGM.getLLVMContext(), Tmp));
295 if (CGM.getDataLayout().isBigEndian()) {
304 Elements.push_back(llvm::ConstantInt::get(CGM.getLLVMContext(),
313 llvm::Type *Ty = CGM.Int8Ty;
340 CGM.getDataLayout().getABITypeAlignment(C->getType()));
349 llvm::Type *Ty = CGM.Int8Ty;
372 //CGM.ErrorUnsupported(ILE, "global std::initializer_list");
377 const ASTRecordLayout &Layout = CGM.getContext().getASTRecordLayout(RD);
382 bool IsMsStruct = RD->isMsStruct(CGM.getContext());
389 if (CGM.getContext().ZeroBitfieldFollowsNonBitfield(*Field, LastFD)) {
410 EltInit = CGM.EmitConstantExpr(ILE->getInit(ElementNo++),
413 EltInit = CGM.EmitNullConstant(Field->getType());
449 const ASTRecordLayout &Layout = CGM.getContext().getASTRecordLayout(RD);
481 bool IsMsStruct = RD->isMsStruct(CGM.getContext());
482 uint64_t OffsetBits = CGM.getContext().toBits(Offset);
489 if (CGM.getContext().ZeroBitfieldFollowsNonBitfield(*Field, LastFD)) {
510 CGM.EmitConstantValueForMemory(FieldValue, Field->getType(), CGF);
526 const ASTRecordLayout &Layout = CGM.getContext().getASTRecordLayout(RD);
561 llvm::ConstantStruct::getTypeForElements(CGM.getLLVMContext(),
563 llvm::Type *ValTy = CGM.getTypes().ConvertType(Ty);
577 llvm::Constant *ConstStructBuilder::BuildStruct(CodeGenModule &CGM,
580 ConstStructBuilder Builder(CGM, CGF);
588 llvm::Constant *ConstStructBuilder::BuildStruct(CodeGenModule &CGM,
592 ConstStructBuilder Builder(CGM, CGF);
598 VTable = CGM.getVTables().GetAddrOfVTable(CD);
616 CodeGenModule &CGM;
620 ConstExprEmitter(CodeGenModule &cgm, CodeGenFunction *cgf)
621 : CGM(cgm), CGF(cgf), VMContext(cgm.getLLVMContext()) {
651 llvm::Constant *C = CGM.EmitConstantExpr(subExpr, subExpr->getType(), CGF);
668 unsigned CurSize = CGM.getDataLayout().getTypeAllocSize(C->getType());
669 unsigned TotalSize = CGM.getDataLayout().getTypeAllocSize(destType);
673 llvm::Type *Ty = CGM.Int8Ty;
700 return CGM.getCXXABI().EmitMemberPointerConversion(E, C);
785 llvm::Constant *C = CGM.EmitConstantExpr(Init, Init->getType(), CGF);
796 fillC = CGM.EmitConstantExpr(filler, filler->getType(), CGF);
819 return ConstStructBuilder::BuildStruct(CGM, CGF, ILE);
823 return CGM.EmitNullConstant(E->getType());
844 CGM.getContext().getBaseElementType(Ty)->getAs<RecordType>();
861 assert(CGM.getContext().hasSameUnqualifiedType(Ty, Arg->getType()) &&
867 return CGM.EmitNullConstant(Ty);
871 return CGM.GetConstantArrayFromStringLiteral(E);
879 CGM.getContext().getObjCEncodingForType(E->getEncodedType(), Str);
894 return CGM.getTypes().ConvertType(T);
901 return CGM.GetWeakRefReference(Decl);
903 return CGM.GetAddrOfFunction(FD);
908 return CGM.GetAddrOfGlobalVar(VD);
910 return CGM.getStaticLocalDeclAddress(VD);
923 llvm::Constant* C = CGM.EmitConstantExpr(CLE->getInitializer(),
927 C = new llvm::GlobalVariable(CGM.getModule(), C->getType(),
928 E->getType().isConstant(CGM.getContext()),
932 CGM.getContext().getTargetAddressSpace(E->getType()));
936 return CGM
938 return CGM.GetAddrOfConstantStringFromObjCEncode(cast<ObjCEncodeExpr>(E));
942 CGM.getObjCRuntime().GenerateConstantString(SL->getString());
951 return CGM.GetAddrOfConstantCString("top level", ".tmp");
954 return CGM.GetAddrOfConstantCString("", ".tmp");
974 return CGM.getObjCRuntime().GenerateConstantString(Literal);
977 return CGM.GetAddrOfConstantCFString(Literal);
986 return CGM.GetAddrOfGlobalBlock(cast<BlockExpr>(E), FunctionName.c_str());
995 return CGM.GetAddrOfRTTIDescriptor(T);
998 return CGM.GetAddrOfUuidDescriptor(cast<CXXUuidofExpr>(E));
1281 FillInNullDataMemberPointers(CodeGenModule &CGM, QualType T,
1284 assert(StartOffset % CGM.getContext().getCharWidth() == 0 &&
1287 if (CGM.getTypes().isZeroInitializable(T))
1291 CGM.getContext().getAsConstantArrayType(T)) {
1293 uint64_t ElementSize = CGM.getContext().getTypeSize(ElementTy);
1296 FillInNullDataMemberPointers(CGM, ElementTy, Elements,
1301 const ASTRecordLayout &Layout = CGM.getContext().getASTRecordLayout(RD);
1319 if (CGM.getTypes().isZeroInitializable(BaseDecl))
1323 CGM.getContext().toBits(Layout.getBaseClassOffset(BaseDecl));
1324 FillInNullDataMemberPointers(CGM, I->getType(),
1334 if (CGM.getTypes().isZeroInitializable(FieldType))
1338 FillInNullDataMemberPointers(CGM, FieldType, Elements, FieldOffset);
1345 CharUnits StartIndex = CGM.getContext().toCharUnitsFromBits(StartOffset);
1346 CharUnits EndIndex = StartIndex + CGM.getContext().getTypeSizeInChars(T);
1350 llvm::ConstantInt::get(CGM.Int8Ty, -1ULL, /*isSigned*/true);
1358 static llvm::Constant *EmitNullConstantForBase(CodeGenModule &CGM,
1362 static llvm::Constant *EmitNullConstant(CodeGenModule &CGM,
1365 const CGRecordLayout &layout = CGM.getTypes().getCGRecordLayout(record);
1391 elements[fieldIndex] = EmitNullConstantForBase(CGM, baseType, base);
1403 elements[fieldIndex] = CGM.EmitNullConstant(field->getType());
1428 elements[fieldIndex] = EmitNullConstantForBase(CGM, baseType, base);
1442 static llvm::Constant *EmitNullConstantForBase(CodeGenModule &CGM,
1445 const CGRecordLayout &baseLayout = CGM.getTypes().getCGRecordLayout(base);
1453 return EmitNullConstant(CGM, base, /*complete*/ false);
1464 FillInNullDataMemberPointers(CGM, CGM.getContext().getTypeDeclType(base),
1469 llvm::Constant *i8_zero = llvm::Constant::getNullValue(CGM.Int8Ty);