Lines Matching defs:CGM
26 CodeGenModule &CGM; // Per-module state.
65 RTTIBuilder(CodeGenModule &CGM) : CGM(CGM),
66 VMContext(CGM.getModule().getContext()) { }
117 CGM.getCXXABI().getMangleContext().mangleCXXRTTIName(Ty, Out);
128 CGM.CreateOrReplaceCXXRuntimeVariable(Name, Init->getType(), Linkage);
139 CGM.getCXXABI().getMangleContext().mangleCXXRTTI(Ty, Out);
144 llvm::GlobalVariable *GV = CGM.getModule().getNamedGlobal(Name);
148 GV = new llvm::GlobalVariable(CGM.getModule(), CGM.Int8PtrTy,
153 return llvm::ConstantExpr::getBitCast(GV, CGM.Int8PtrTy);
255 static bool ShouldUseExternalRTTIDescriptor(CodeGenModule &CGM,
257 ASTContext &Context = CGM.getContext();
273 return CGM.getVTables().isVTableExternal(RD);
320 getTypeInfoLinkage(CodeGenModule &CGM, QualType Ty) {
340 if (!CGM.getLangOpts().RTTI) {
351 return CGM.getVTableLinkage(RD);
494 CGM.getModule().getOrInsertGlobal(VTableName, CGM.Int8PtrTy);
497 CGM.getTypes().ConvertType(CGM.getContext().getPointerDiffType());
502 VTable = llvm::ConstantExpr::getBitCast(VTable, CGM.Int8PtrTy);
528 maybeUpdateRTTILinkage(CodeGenModule &CGM, llvm::GlobalVariable *GV,
535 llvm::GlobalVariable::LinkageTypes Linkage = getTypeInfoLinkage(CGM, Ty);
548 CGM.getCXXABI().getMangleContext().mangleCXXRTTIName(Ty, Out);
552 llvm::GlobalVariable *TypeNameGV = CGM.getModule().getNamedGlobal(Name);
563 Ty = CGM.getContext().getCanonicalType(Ty);
568 CGM.getCXXABI().getMangleContext().mangleCXXRTTI(Ty, Out);
572 llvm::GlobalVariable *OldGV = CGM.getModule().getNamedGlobal(Name);
574 maybeUpdateRTTILinkage(CGM, OldGV, Ty);
576 return llvm::ConstantExpr::getBitCast(OldGV, CGM.Int8PtrTy);
581 if (!Force && (IsStdLib || ShouldUseExternalRTTIDescriptor(CGM, Ty)))
589 Linkage = getTypeInfoLinkage(CGM, Ty);
597 Fields.push_back(llvm::ConstantExpr::getBitCast(TypeName, CGM.Int8PtrTy));
681 new llvm::GlobalVariable(CGM.getModule(), Init->getType(),
700 CGM.setTypeVisibility(GV, RD, CodeGenModule::TVK_ForRTTI);
701 CGM.setTypeVisibility(TypeName, RD, CodeGenModule::TVK_ForRTTIName);
704 if (CGM.getCodeGenOpts().HiddenWeakVTables &&
719 return llvm::ConstantExpr::getBitCast(GV, CGM.Int8PtrTy);
754 QualType SuperTy = CGM.getContext().getObjCInterfaceType(Super);
757 llvm::Constant *BaseTypeInfo = RTTIBuilder(CGM).BuildTypeInfo(SuperTy);
768 RTTIBuilder(CGM).BuildTypeInfo(RD->bases_begin()->getType());
839 CGM.getTypes().ConvertType(CGM.getContext().UnsignedIntTy);
857 CGM.getTypes().ConvertType(CGM.getContext().LongTy);
881 Fields.push_back(RTTIBuilder(CGM).BuildTypeInfo(Base->getType()));
895 CGM.getVTableContext().getVirtualBaseOffsetOffset(RD, BaseDecl);
897 const ASTRecordLayout &Layout = CGM.getContext().getASTRecordLayout(RD);
919 CGM.getContext().getUnqualifiedArrayType(PointeeTy, Quals);
933 CGM.getTypes().ConvertType(CGM.getContext().UnsignedIntTy);
940 RTTIBuilder(CGM).BuildTypeInfo(UnqualifiedPointeeTy);
951 CGM.getContext().getUnqualifiedArrayType(PointeeTy, Quals);
970 CGM.getTypes().ConvertType(CGM.getContext().UnsignedIntTy);
977 RTTIBuilder(CGM).BuildTypeInfo(UnqualifiedPointeeTy);
984 Fields.push_back(RTTIBuilder(CGM).BuildTypeInfo(QualType(ClassType, 0)));