|
reference, declaration → definition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
|
References
tools/clang/include/clang/Sema/Sema.h 1313 ASTContext &getASTContext() const { return Context; }
2441 return getPrintingPolicy(Context, PP);
7670 return MarkDeducedTemplateParameters(Context, FunctionTemplate, Deduced);
10608 !!Condition.get()->EvaluateKnownConstInt(S.Context)) {}
tools/clang/include/clang/Sema/SemaInternal.h 25 return PartialDiagnostic(DiagID, Context.getDiagAllocator());
103 Namespaces(SemaRef.Context, SemaRef.CurContext, SS),
196 ASTContext &getContext() const { return SemaRef.Context; }
tools/clang/lib/Frontend/ASTUnit.cpp 426 if (TheSema->Context.getLangOpts().CPlusPlus && IsNestedNameSpecifier &&
2070 CalculateHiddenNames(Context, Results, NumResults, S.Context,
2092 = S.Context.getCanonicalType(
tools/clang/lib/Parse/ParseDecl.cpp 294 IdentifierLoc *IL = IdentifierLoc::create(Actions.Context,
4127 PrettyDeclStackTraceEntry CrashInfo(Actions.Context, TagDecl, RecordLoc,
tools/clang/lib/Parse/ParseDeclCXX.cpp 219 PrettyDeclStackTraceEntry CrashInfo(Actions.Context, NamespcDecl,
3175 PrettyDeclStackTraceEntry CrashInfo(Actions.Context, TagDecl, RecordLoc,
tools/clang/lib/Parse/ParseObjc.cpp 2686 PrettyDeclStackTraceEntry CrashInfo(Actions.Context, MDecl, Tok.getLocation(),
tools/clang/lib/Parse/ParsePragma.cpp 1025 Actions.Context, Info->PragmaName.getLocation(), PragmaNameInfo);
1033 Actions.Context, Info->Option.getLocation(), OptionInfo);
1113 Hint.StateLoc = IdentifierLoc::create(Actions.Context, StateLoc, StateInfo);
tools/clang/lib/Parse/ParseStmt.cpp 2080 PrettyDeclStackTraceEntry CrashInfo(Actions.Context, Decl, LBraceLoc,
2113 PrettyDeclStackTraceEntry CrashInfo(Actions.Context, Decl, TryLoc,
tools/clang/lib/Parse/ParseStmtAsm.cpp 549 const llvm::Triple &TheTriple = Actions.Context.getTargetInfo().getTriple();
580 const TargetOptions &TO = Actions.Context.getTargetInfo().getTargetOpts();
tools/clang/lib/Parse/ParseTemplate.cpp 1456 Actions, Actions.Context.getTranslationUnitDecl());
tools/clang/lib/Sema/AnalysisBasedWarnings.cpp 1001 ContainsReference CR(S.Context, DRE);
tools/clang/lib/Sema/DeclSpec.cpp 1127 (!S.Context.getTargetInfo().hasFeature("vsx")) &&
1128 (!S.Context.getTargetInfo().hasFeature("power8-vector")) &&
1142 else if (!S.Context.getTargetInfo().hasFeature("vsx") &&
1149 !S.Context.getTargetInfo().hasFeature("arch12"))
tools/clang/lib/Sema/JumpDiagnostics.cpp 173 if (S.Context.getLangOpts().CPlusPlus && VD->hasLocalStorage() && Init) {
tools/clang/lib/Sema/Sema.cpp 74 PushDeclContext(S, Context.getTranslationUnitDecl());
170 NSAPIObj.reset(new NSAPI(Context));
176 Diags.SetArgToStringFn(&FormatASTNodeDiagnosticArgument, &Context);
193 DeclarationName DN = &Context.Idents.get(Name);
195 PushOnScopeChains(Context.buildImplicitTypedef(T, Name), TUScope);
204 = dyn_cast_or_null<ExternalSemaSource>(Context.getExternalSource()))
215 if (Context.getTargetInfo().hasInt128Type()) {
218 DeclarationName Int128 = &Context.Idents.get("__int128_t");
220 PushOnScopeChains(Context.getInt128Decl(), TUScope);
222 DeclarationName UInt128 = &Context.Idents.get("__uint128_t");
224 PushOnScopeChains(Context.getUInt128Decl(), TUScope);
232 DeclarationName SEL = &Context.Idents.get("SEL");
234 PushOnScopeChains(Context.getObjCSelDecl(), TUScope);
238 DeclarationName Id = &Context.Idents.get("id");
240 PushOnScopeChains(Context.getObjCIdDecl(), TUScope);
243 DeclarationName Class = &Context.Idents.get("Class");
245 PushOnScopeChains(Context.getObjCClassDecl(), TUScope);
248 DeclarationName Protocol = &Context.Idents.get("Protocol");
250 PushOnScopeChains(Context.getObjCProtocolDecl(), TUScope);
254 DeclarationName ConstantString = &Context.Idents.get("__NSConstantString");
256 PushOnScopeChains(Context.getCFConstantStringDecl(), TUScope);
261 IdResolver.begin(&Context.Idents.get("type_info")) == IdResolver.end())
262 PushOnScopeChains(Context.buildImplicitRecord("type_info", TTK_Class),
265 addImplicitTypedef("size_t", Context.getSizeType());
272 Context.getTargetInfo().getSupportedOpenCLOpts());
274 addImplicitTypedef("sampler_t", Context.OCLSamplerTy);
275 addImplicitTypedef("event_t", Context.OCLEventTy);
277 addImplicitTypedef("clk_event_t", Context.OCLClkEventTy);
278 addImplicitTypedef("queue_t", Context.OCLQueueTy);
279 addImplicitTypedef("reserve_id_t", Context.OCLReserveIDTy);
280 addImplicitTypedef("atomic_int", Context.getAtomicType(Context.IntTy));
280 addImplicitTypedef("atomic_int", Context.getAtomicType(Context.IntTy));
282 Context.getAtomicType(Context.UnsignedIntTy));
282 Context.getAtomicType(Context.UnsignedIntTy));
283 auto AtomicLongT = Context.getAtomicType(Context.LongTy);
283 auto AtomicLongT = Context.getAtomicType(Context.LongTy);
285 auto AtomicULongT = Context.getAtomicType(Context.UnsignedLongTy);
285 auto AtomicULongT = Context.getAtomicType(Context.UnsignedLongTy);
288 Context.getAtomicType(Context.FloatTy));
288 Context.getAtomicType(Context.FloatTy));
289 auto AtomicDoubleT = Context.getAtomicType(Context.DoubleTy);
289 auto AtomicDoubleT = Context.getAtomicType(Context.DoubleTy);
293 addImplicitTypedef("atomic_flag", Context.getAtomicType(Context.IntTy));
293 addImplicitTypedef("atomic_flag", Context.getAtomicType(Context.IntTy));
294 auto AtomicIntPtrT = Context.getAtomicType(Context.getIntPtrType());
294 auto AtomicIntPtrT = Context.getAtomicType(Context.getIntPtrType());
296 auto AtomicUIntPtrT = Context.getAtomicType(Context.getUIntPtrType());
296 auto AtomicUIntPtrT = Context.getAtomicType(Context.getUIntPtrType());
298 auto AtomicSizeT = Context.getAtomicType(Context.getSizeType());
298 auto AtomicSizeT = Context.getAtomicType(Context.getSizeType());
300 auto AtomicPtrDiffT = Context.getAtomicType(Context.getPointerDiffType());
300 auto AtomicPtrDiffT = Context.getAtomicType(Context.getPointerDiffType());
318 if (Context.getTypeSize(AtomicSizeT) == 64) {
331 setOpenCLExtensionForType(Context.DoubleTy, "cl_khr_fp64");
342 if (Context.getTargetInfo().hasAArch64SVETypes()) {
348 if (Context.getTargetInfo().hasBuiltinMSVaList()) {
349 DeclarationName MSVaList = &Context.Idents.get("__builtin_ms_va_list");
351 PushOnScopeChains(Context.getBuiltinMSVaListDecl(), TUScope);
354 DeclarationName BuiltinVaList = &Context.Idents.get("__builtin_va_list");
356 PushOnScopeChains(Context.getBuiltinVaListDecl(), TUScope);
372 = dyn_cast_or_null<ExternalSemaSource>(Context.getExternalSource()))
417 if (!Context.getSourceManager().isInSystemHeader(loc))
423 fn->addAttr(UnavailableAttr::CreateImplicit(Context, "", reason, loc));
464 Optional<NullabilityKind> ExprNullability = SrcType->getNullability(Context);
468 Optional<NullabilityKind> TypeNullability = DstType->getNullability(Context);
529 QualType ExprTy = Context.getCanonicalType(E->getType());
530 QualType TypeTy = Context.getCanonicalType(Ty);
555 return ImplicitCastExpr::Create(Context, Ty, Kind, E, BasePath, VK);
612 VD->mightBeUsableInConstantExpressions(SemaRef->Context))
1118 = Context.getAsIncompleteArrayType(VD->getType())) {
1121 llvm::APInt One(Context.getTypeSize(Context.getSizeType()), true);
1121 llvm::APInt One(Context.getTypeSize(Context.getSizeType()), true);
1122 QualType T = Context.getConstantArrayType(ArrayT->getElementType(), One,
1315 PartialDiagnostic(DiagInfo, Context.getDiagAllocator()));
1340 PartialDiagnostic(DiagInfo, Context.getDiagAllocator()));
1362 PartialDiagnostic(DiagInfo, Context.getDiagAllocator()));
1374 Context.setPrintingPolicy(getPrintingPolicy());
1672 new (S.Context) DeclRefExpr(S.Context, VD, false, T, VK_LValue, Loc);
1672 new (S.Context) DeclRefExpr(S.Context, VD, false, T, VK_LValue, Loc);
1679 S.Context.setBlockVarCopyInit(VD, Init, S.canThrow(Init));
1900 Context.addComment(RC);
1937 if (E.getType() == Context.OverloadTy) {
1945 } else if (E.getType() == Context.BoundMemberTy) {
2153 Ident_super = &Context.Idents.get("super");
2159 Ident___float128 = &Context.Idents.get("__float128");
2170 CSI->ReturnType = Context.VoidTy;
tools/clang/lib/Sema/SemaAccess.cpp 372 = S.Context.getCanonicalType(Friend->getType())
375 = S.Context.getCanonicalType(Context->getType())
1055 << S.Context.getTypeDeclType(ECRecord);
1084 << S.Context.getTypeDeclType(ECRecord);
1268 << S.Context.getTypeDeclType(NamingClass)
1269 << S.Context.getTypeDeclType(DeclaringClass);
1398 DependentDiagnostic::Create(S.Context, DC, DependentDiagnostic::Access,
1512 AccessTarget Entity(Context,
1520 AccessTarget Entity(Context,
1537 AccessTarget Entity(Context, AccessTarget::Member, E->getNamingClass(),
1556 AccessTarget Entity(Context, AccessTarget::Member, E->getNamingClass(),
1571 AccessTarget entity(Context, AccessTarget::Member, decl->getParent(),
1599 if (ObjectTy.isNull()) ObjectTy = Context.getTypeDeclType(NamingClass);
1601 AccessTarget Entity(Context, AccessTarget::Member, NamingClass,
1686 Context, AccessTarget::Member, NamingClass,
1688 Context.getTypeDeclType(ObjectClass));
1705 AccessTarget Entity(Context, AccessTarget::Member, NamingClass, Found,
1723 AccessTarget Entity(Context, AccessTarget::Member, NamingClass,
1738 AccessTarget Entity(Context, AccessTarget::Member, DecomposedClass, Field,
1739 Context.getRecordType(DecomposedClass));
1758 AccessTarget Entity(Context, AccessTarget::Member, NamingClass, Found,
1780 AccessTarget entity(Context, AccessTarget::Member,
1809 AccessTarget Entity(Context, AccessTarget::Member, NamingClass, Found,
1840 AccessTarget Entity(Context, AccessTarget::Base, BaseD, DerivedD,
1865 AccessTarget Entity(Context, AccessedEntity::Member,
1901 AccessTarget Entity(Context, AccessedEntity::Member, NamingClass,
tools/clang/lib/Sema/SemaAttr.cpp 58 RD->addAttr(AlignMac68kAttr::CreateImplicit(Context));
60 RD->addAttr(MaxFieldAlignmentAttr::CreateImplicit(Context,
78 RD->addAttr(MSStructAttr::CreateImplicit(Context));
85 MSVtorDispAttr::CreateImplicit(Context, VtorDispStack.CurrentValue));
133 addGslOwnerPointerAttributeIfNotExisting<PointerAttr>(Context,
194 addGslOwnerPointerAttributeIfNotExisting<OwnerAttr>(Context, Record);
196 addGslOwnerPointerAttributeIfNotExisting<PointerAttr>(Context, Record);
229 if (!this->Context.getTargetInfo().hasAlignMac68kSupport()) {
302 !Alignment->isIntegerConstantExpr(Val, Context) ||
397 Context, Context.getTranslationUnitDecl(), CommentLoc, Kind, Arg);
397 Context, Context.getTranslationUnitDecl(), CommentLoc, Kind, Arg);
398 Context.getTranslationUnitDecl()->addDecl(PCD);
405 Context, Context.getTranslationUnitDecl(), Loc, Name, Value);
405 Context, Context.getTranslationUnitDecl(), Loc, Name, Value);
406 Context.getTranslationUnitDecl()->addDecl(PDMD);
467 auto Section = Context.SectionInfos.find(SectionName);
468 if (Section == Context.SectionInfos.end()) {
469 Context.SectionInfos[SectionName] =
494 auto Section = Context.SectionInfos.find(SectionName);
495 if (Section != Context.SectionInfos.end()) {
506 Context.SectionInfos[SectionName] =
531 Context.getTargetInfo().getCXXABI().isMicrosoft())
577 VD->addAttr(UnusedAttr::CreateImplicit(Context, IdTok.getLocation(),
595 D->addAttr(CFAuditedTransferAttr::CreateImplicit(Context, Info));
872 FD->addAttr(OptimizeNoneAttr::CreateImplicit(Context, Loc));
874 FD->addAttr(NoInlineAttr::CreateImplicit(Context, Loc));
896 D->addAttr(VisibilityAttr::CreateImplicit(Context, type, loc));
tools/clang/lib/Sema/SemaCUDA.cpp 43 FunctionDecl *ConfigDecl = Context.getcudaConfigureCallDecl();
49 DeclRefExpr *ConfigDR = new (Context)
50 DeclRefExpr(Context, ConfigDecl, false, ConfigQTy, VK_LValue, LLLLoc);
335 MemberDecl->addAttr(CUDAInvalidTargetAttr::CreateImplicit(Context));
348 Context.getBaseElementType(F->getType())->getAs<RecordType>();
380 MemberDecl->addAttr(CUDAInvalidTargetAttr::CreateImplicit(Context));
400 MemberDecl->addAttr(CUDADeviceAttr::CreateImplicit(Context));
402 MemberDecl->addAttr(CUDAHostAttr::CreateImplicit(Context));
508 Context, VD->getType()->isReferenceType());
562 NewD->addAttr(CUDAHostAttr::CreateImplicit(Context));
564 NewD->addAttr(CUDADeviceAttr::CreateImplicit(Context));
601 NewD->addAttr(CUDAHostAttr::CreateImplicit(Context));
602 NewD->addAttr(CUDADeviceAttr::CreateImplicit(Context));
741 Method->addAttr(CUDADeviceAttr::CreateImplicit(Context));
743 Method->addAttr(CUDADeviceAttr::CreateImplicit(Context));
744 Method->addAttr(CUDAHostAttr::CreateImplicit(Context));
781 AttrTy *Clone = Attribute->clone(S.Context);
801 if (CudaFeatureEnabled(Context.getTargetInfo().getSDKVersion(),
tools/clang/lib/Sema/SemaCXXScopeSpec.cpp 93 NNSType = Context.getCanonicalType(NNSType);
103 = Context.getCanonicalType(QualType(SpecType, 0));
110 if (Context.hasSameType(Injected, ContextType))
158 return Context.getTranslationUnitDecl();
212 QualType type = Context.getTypeDeclType(tag);
274 SS.MakeGlobal(Context, CCLoc);
305 SS.MakeSuper(Context, RD, SuperLoc, ColonColonLoc);
330 QualType T = Context.getTypeDeclType(cast<TypeDecl>(SD));
337 if (Context.getLangOpts().CPlusPlus11)
345 if (Context.getLangOpts().CPlusPlus11)
579 SS.Extend(Context, IdInfo.Identifier, IdInfo.IdentifierLoc, IdInfo.CCLoc);
640 SS.MakeTrivial(Context, Corrected.getCorrectionSpecifier(),
684 !Context.hasSameType(
685 Context.getTypeDeclType(cast<TypeDecl>(OuterDecl)),
686 Context.getTypeDeclType(cast<TypeDecl>(SD))))) {
714 SS.Extend(Context, Namespace, IdInfo.IdentifierLoc, IdInfo.CCLoc);
719 SS.Extend(Context, Alias, IdInfo.IdentifierLoc, IdInfo.CCLoc);
724 Context.getTypeDeclType(cast<TypeDecl>(SD->getUnderlyingDecl()));
762 SS.Extend(Context, SourceLocation(), TLB.getTypeLocInContext(Context, T),
762 SS.Extend(Context, SourceLocation(), TLB.getTypeLocInContext(Context, T),
805 SS.Extend(Context, IdInfo.Identifier, IdInfo.IdentifierLoc,
815 << Context.getTypeDeclType(TD) << getLangOpts().CPlusPlus;
867 SS.Extend(Context, SourceLocation(), TLB.getTypeLocInContext(Context, T),
867 SS.Extend(Context, SourceLocation(), TLB.getTypeLocInContext(Context, T),
912 QualType T = Context.getDependentTemplateSpecializationType(ETK_None,
922 SpecTL.setQualifierLoc(SS.getWithLocInContext(Context));
930 SS.Extend(Context, TemplateKWLoc, Builder.getTypeLocInContext(Context, T),
930 SS.Extend(Context, TemplateKWLoc, Builder.getTypeLocInContext(Context, T),
980 SS.Extend(Context, TemplateKWLoc, Builder.getTypeLocInContext(Context, T),
980 SS.Extend(Context, TemplateKWLoc, Builder.getTypeLocInContext(Context, T),
997 void *Mem = Context.Allocate(
tools/clang/lib/Sema/SemaCast.cpp 58 ResultType(destType.getNonLValueExprType(S.Context)),
106 castExpr = ImplicitCastExpr::Create(Self.Context,
107 Self.Context.ARCUnbridgedCastTy,
282 return Op.complete(CXXConstCastExpr::Create(Context, Op.ResultType,
299 return Op.complete(CXXDynamicCastExpr::Create(Context, Op.ResultType,
312 return Op.complete(CXXReinterpretCastExpr::Create(Context, Op.ResultType,
326 return Op.complete(CXXStaticCastExpr::Create(Context, Op.ResultType,
362 new (Context) BuiltinBitCastExpr(Op.ResultType, Op.ValueKind, Op.Kind,
599 if (!CheckCVR && CheckObjCLifetime && !Self.Context.getLangOpts().ObjC)
611 QualType UnwrappedSrcType = Self.Context.getCanonicalType(SrcType),
612 UnwrappedDestType = Self.Context.getCanonicalType(DestType);
622 Self.Context, UnwrappedSrcType, UnwrappedDestType)) {
630 Self.Context.getUnqualifiedArrayType(UnwrappedSrcType, SrcQuals);
631 Self.Context.getUnqualifiedArrayType(UnwrappedDestType, DestQuals);
719 QualType DestType = Self.Context.getCanonicalType(this->DestType);
759 QualType SrcType = Self.Context.getCanonicalType(OrigSrcType);
942 Self.Context.getASTRecordLayout(Class);
994 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) {
1060 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) {
1156 QualType SrcType = Self.Context.getCanonicalType(SrcExpr.get()->getType());
1166 } else if (DestType->isIntegralType(Self.Context)) {
1376 Self.Context.getCanonicalType(SrcExpr->getType()),
1377 Self.Context.getCanonicalType(DestPointee), CStyle,
1408 Self.Context.getCanonicalType(SrcPointer->getPointeeType()),
1409 Self.Context.getCanonicalType(DestPointer->getPointeeType()),
1541 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) {
1546 SrcType = Self.Context.getMemberPointerType(Fn->getType(),
1547 Self.Context.getTypeDeclType(M->getParent()).getTypePtr());
1560 if (Self.Context.getTargetInfo().getCXXABI().isMicrosoft()) {
1566 if (!Self.Context.hasSameUnqualifiedType(SrcMemPtr->getPointeeType(),
1579 if (Paths.isAmbiguous(Self.Context.getCanonicalType(DestClass))) {
1706 DestType = Self.Context.getCanonicalType(DestType);
1753 DestType = Self.Context.getPointerType(DestTypeTmp->getPointeeType());
1754 SrcType = Self.Context.getPointerType(SrcType);
1788 if (!Self.Context.hasCvrSimilarType(SrcType, DestType))
1832 if (Context.hasSameUnqualifiedType(DestTy, SrcTy)) {
1848 if (Context.getTypeSize(DestTy) == Context.getTypeSize(SrcTy)) {
1848 if (Context.getTypeSize(DestTy) == Context.getTypeSize(SrcTy)) {
1859 if (Self.Context.hasSameType(SrcType, DestType))
1880 if (Self.Context.hasSameType(SrcType, DstType) ||
1971 if (CStyle && SrcType->isIntegralType(Self.Context)
1974 && !SrcExpr->isIntegerConstantExpr(Self.Context)
1975 && Self.Context.getTypeSize(DestType) >
1976 Self.Context.getTypeSize(SrcType)) {
2023 DestType = Self.Context.getCanonicalType(DestType);
2028 if (SrcType == Self.Context.OverloadTy) {
2077 DestType = Self.Context.getPointerType(DestTypeTmp->getPointeeType());
2078 SrcType = Self.Context.getPointerType(SrcType);
2084 SrcType = Self.Context.getCanonicalType(SrcType);
2097 if (Self.Context.getTargetInfo().getCXXABI().isMicrosoft()) {
2105 if (Self.Context.getTypeSize(DestMemPtr) !=
2106 Self.Context.getTypeSize(SrcMemPtr)) {
2127 if (SrcType->isNullPtrType() && DestType->isIntegralType(Self.Context)) {
2132 if (Self.Context.getTypeSize(SrcType) >
2133 Self.Context.getTypeSize(DestType)) {
2149 if ((!destIsVector && !DestType->isIntegralType(Self.Context)) ||
2150 (!srcIsVector && !SrcType->isIntegralType(Self.Context)))
2201 if (DestType->isIntegralType(Self.Context)) {
2208 if ((Self.Context.getTypeSize(SrcType) >
2209 Self.Context.getTypeSize(DestType)) &&
2347 Self.Context.removeAddrSpaceQualType(SrcPointeeType.getCanonicalType());
2349 Self.Context.removeAddrSpaceQualType(DestPointeeType.getCanonicalType());
2350 return Self.Context.hasSameType(SrcPointeeTypeWithoutAS,
2513 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) {
2605 if (SrcExpr.get()->getType() == Self.Context.OverloadTy) {
2634 if (DestRecordTy && Self.Context.hasSameUnqualifiedType(DestType, SrcType)){
2661 if (SrcExpr.get()->EvaluateAsInt(Result, Self.Context)) {
2729 if (!SrcType->isIntegralType(Self.Context) && SrcType->isArithmeticType()) {
2739 if (!DestType->isIntegralType(Self.Context) &&
2816 CharUnits DestSize = Self.Context.getTypeSizeInChars(DestType);
2817 CharUnits SourceSize = Self.Context.getTypeSizeInChars(SrcType);
2825 if (!DestType.isTriviallyCopyableType(Self.Context)) {
2832 if (!SrcType.isTriviallyCopyableType(Self.Context)) {
2901 return Op.complete(CStyleCastExpr::Create(Context, Op.ResultType,
2926 return Op.complete(CXXFunctionalCastExpr::Create(Context, Op.ResultType,
tools/clang/lib/Sema/SemaChecking.cpp 105 Context.getTargetInfo());
294 QualType ReturnTy = CE->getCallReturnType(S.Context);
296 QualType BuiltinTy = S.Context.getFunctionType(
298 QualType BuiltinPtrTy = S.Context.getPointerType(BuiltinTy);
574 S.Context.getSizeType());
647 << TheCall->getDirectCallee() << S.Context.OCLQueueTy;
714 if (!Arg4->isNullPointerConstant(S.Context,
720 << S.Context.getPointerType(S.Context.OCLClkEventTy);
720 << S.Context.getPointerType(S.Context.OCLClkEventTy);
725 if (!Arg5->isNullPointerConstant(S.Context,
732 << S.Context.getPointerType(S.Context.OCLClkEventTy);
732 << S.Context.getPointerType(S.Context.OCLClkEventTy);
813 !S.Context.hasSameType(
816 << Call->getDirectCallee() << S.Context.getPointerType(EltTy)
849 << Call->getDirectCallee() << S.Context.OCLReserveIDTy
859 << Call->getDirectCallee() << S.Context.UnsignedIntTy
893 << Call->getDirectCallee() << S.Context.UnsignedIntTy
901 Call->setType(S.Context.OCLReserveIDTy);
921 << Call->getDirectCallee() << S.Context.OCLReserveIDTy
991 Call->setType(S.Context.getPointerType(S.Context.getQualifiedType(
991 Call->setType(S.Context.getPointerType(S.Context.getQualifiedType(
1009 return S.Context.getPointerType(Ty->getElementType());
1011 return S.Context.getPointerType(ArgTy);
1047 InitializedEntity::InitializeParameter(S.Context, ParamTy, false);
1079 Context.GetBuiltinType(BuiltinID, Error, &ICEArguments);
1108 switch (Context.getTargetInfo().getTriple().getArch()) {
1218 TheCall->setType(Context.IntTy);
1225 TheCall->setType(Context.IntTy);
1415 if (!FT->isVariadic() || FT->getReturnType() != Context.IntTy ||
1425 TheCall->setType(Context.IntTy);
1454 Context.getExceptionObjectType(FDecl->getParamDecl(0)->getType()),
1458 TheCall->setType(Context.VoidPtrTy);
1529 if (Context.BuiltinInfo.isTSBuiltin(BuiltinID)) {
1530 switch (Context.getTargetInfo().getTriple().getArch()) {
1686 llvm::Triple::ArchType Arch = Context.getTargetInfo().getTriple().getArch();
1690 Context.getTargetInfo().getInt64Type() == TargetInfo::SignedLong;
1692 getNeonEltType(NeonTypeFlags(TV), Context, IsPolyUnsigned, IsInt64Long);
1695 QualType LHSTy = Context.getPointerType(EltTy);
1780 << PointerArg->getType() << Context.getPointerType(AddrType)
1785 AddrType = Context.getPointerType(AddrType);
1802 if (Context.getTypeSize(ValType) > MaxWidth) {
1831 Context, ValType, /*consume*/ false);
1839 TheCall->setType(Context.IntTy);
1982 if (!TheCall->getArg(1)->isIntegerConstantExpr(Value, Context)) {
1988 TheCall->setType(Context.UnsignedIntTy);
2771 const TargetInfo &TI = Context.getTargetInfo();
3240 bool IsTarget64Bit = Context.getTargetInfo()
3241 .getTypeWidth(Context
3253 if ((IsBltinExtDiv && !Context.getTargetInfo().hasFeature("extdiv")) ||
3255 !Context.getTargetInfo().hasFeature("bpermd")))
3260 if (!Context.getTargetInfo().hasFeature("vsx"))
3305 if (Arg->isIntegerConstantExpr(AbortCode, Context) &&
3379 if (!S.Context.getTargetInfo().validateCpuSupports(Feature))
3399 if (!S.Context.getTargetInfo().validateCpuIs(Feature))
3732 const llvm::Triple &TT = Context.getTargetInfo().getTriple();
4113 = Expr->IgnoreImplicit()->getType()->getNullability(S.Context)) {
4131 Expr->EvaluateAsBooleanCondition(Result, S.Context) &&
4252 isNonNullType(S.Context, PVD->getType())) {
4281 if (isNonNullType(S.Context, paramType)) {
4760 if (!IsC11 && !AtomTy.isTriviallyCopyableType(Context) &&
4794 ResultType = Context.VoidTy;
4796 ResultType = Context.BoolTy;
4875 Ty = Context.getPointerDiffType();
4886 Ty = Context.getPointerType(
4887 Context.getAddrSpaceQualType(ValType.getUnqualifiedType(), AS));
4899 Ty = Context.BoolTy;
4904 Ty = Context.IntTy;
4908 InitializedEntity::InitializeParameter(Context, Ty, false);
4957 if (SubExprs[1]->isIntegerConstantExpr(Result, Context) &&
4967 if (Scope->isIntegerConstantExpr(Result, Context) &&
4975 AtomicExpr *AE = new (Context)
4982 Context.AtomicUsesUnsupportedLibcall(AE))
5005 InitializedEntity::InitializeParameter(S.Context, Param);
5123 switch (Context.getTypeSizeInChars(ValType).getQuantity()) {
5272 ResultType = Context.BoolTy;
5292 ResultType = Context.VoidTy;
5325 const char *NewBuiltinName = Context.BuiltinInfo.getName(NewBuiltinID);
5331 DeclarationName DN(&Context.Idents.get(NewBuiltinName));
5349 InitializedEntity Entity = InitializedEntity::InitializeParameter(Context,
5366 Context, DRE->getQualifierLoc(), SourceLocation(), NewBuiltinDecl,
5367 /*enclosing*/ false, DRE->getLocation(), Context.BuiltinFnTy,
5372 QualType CalleePtrTy = Context.getPointerType(NewBuiltinDecl->getType());
5447 Context, ValType, /*consume*/ false);
5453 TheCall->setType(Context.VoidTy);
5507 QualType ResultTy = Context.getPointerType(Context.CharTy.withConst());
5507 QualType ResultTy = Context.getPointerType(Context.CharTy.withConst());
5509 InitializedEntity::InitializeParameter(Context, ResultTy, false);
5517 const llvm::Triple &TT = S.Context.getTargetInfo().getTriple();
5657 Context.typesAreCompatible(ED->getPromotionType(), Type));
5666 TheCall->setType(Context.VoidTy);
5698 Context.getPointerType(Context.CharTy.withConst());
5698 Context.getPointerType(Context.CharTy.withConst());
5700 Arg1Ty->getPointeeType().withoutLocalFastQualifiers() != Context.CharTy)
5707 const QualType SizeTy = Context.getSizeType();
5832 if(!TheCall->getArg(2)->isIntegerConstantExpr(Value, Context))
5853 if (!Context.hasSameUnqualifiedType(Arg1Ty, Arg2Ty)) {
5909 } else if (!Context.hasSameUnqualifiedType(LHSType, RHSType)) {
5917 resType = Context.getVectorType(eltType, numResElements,
5928 if (!TheCall->getArg(i)->isIntegerConstantExpr(Result, Context))
5950 return new (Context) ShuffleVectorExpr(Context, exprs, resType,
5950 return new (Context) ShuffleVectorExpr(Context, exprs, resType,
5981 return new (Context)
6012 if (Arg->HasSideEffects(Context))
6036 llvm::APSInt Result = Arg->EvaluateKnownConstInt(Context);
6042 if (Result < Context.getCharWidth())
6044 << (unsigned)Context.getCharWidth() << Arg->getSourceRange();
6086 InitializedEntity Entity = InitializedEntity::InitializeParameter(Context,
6087 Context.getSizeType(), false);
6120 Context, Context.VoidPtrTy, false);
6120 Context, Context.VoidPtrTy, false);
6145 CharUnits ArgSize = Context.getTypeSizeInChars(Arg.get()->getType());
6169 TheCall->setType(Context.getSizeType());
6171 TheCall->setType(Context.VoidPtrTy);
6186 if (!Arg->isIntegerConstantExpr(Result, Context))
6412 TheCall->setType(Context.IntTy);
6452 Context, Expr::NPC_ValueDependentIsNotNull); };
6468 if (!Context.typesAreCompatible(
6469 Context.getCanonicalType(pointeeA).getUnqualifiedType(),
6470 Context.getCanonicalType(pointeeB).getUnqualifiedType())) {
6490 TheCall->setType(Context.LongLongTy);
6601 if (!Context.getTargetInfo().hasSjLjLowering())
6622 if (!Context.getTargetInfo().hasSjLjLowering())
6812 if (E->isNullPointerConstant(S.Context, Expr::NPC_ValueDependentIsNotNull))
6893 if (const ArrayType *AT = S.Context.getAsArrayType(T)) {
6894 isConstant = AT->getElementType().isConstant(S.Context);
6896 isConstant = T.isConstant(S.Context) &&
6897 PT->getPointeeType().isConstant(S.Context);
6901 isConstant = T.isConstant(S.Context);
7055 LResult, S.Context, Expr::SE_NoSideEffects, S.isConstantEvaluated());
7057 RResult, S.Context, Expr::SE_NoSideEffects, S.isConstantEvaluated());
7083 if (ASE->getRHS()->EvaluateAsInt(IndexResult, S.Context,
7339 S.getLangOpts(), S.Context.getTargetInfo());
7790 const analyze_printf::ArgType &AT = Amt.getArgType(S.Context);
7793 if (!AT.matchesType(S.Context, T)) {
7795 << k << AT.getRepresentativeTypeName(S.Context)
7910 LookupResult R(S, &S.Context.Idents.get(Name), SourceLocation(),
7955 AT.matchesType(S.Context, Method->getReturnType())) {
8030 ArgType(S.Context.IntTy) : ArgType::CPointerTy;
8031 if (AT.isValid() && !AT.matchesType(S.Context, Ex->getType()))
8034 << AT.getRepresentativeTypeName(S.Context) << Ex->getType()
8042 if (AT2.isValid() && !AT2.matchesType(S.Context, Ex->getType()))
8045 << AT2.getRepresentativeTypeName(S.Context) << Ex->getType()
8277 S.Context.getPromotedIntegerType(From) == To)
8287 S.Context.getFloatingTypeOrder(From, To) < 0;
8300 const analyze_printf::ArgType &AT = FS.getArgType(S.Context, isObjCContext());
8325 analyze_printf::ArgType::MatchKind Match = AT.matchesType(S.Context, ExprTy);
8342 if (ICE->getType() == S.Context.IntTy ||
8343 ICE->getType() == S.Context.UnsignedIntTy) {
8346 AT.matchesType(S.Context, ExprTy);
8358 if (ExprTy == S.Context.IntTy)
8359 if (llvm::isUIntN(S.Context.getCharWidth(), CL->getValue()))
8360 ExprTy = S.Context.CharTy;
8380 IntendedTy = S.Context.UnsignedShortTy;
8386 if (V.getActiveBits() <= S.Context.getTypeSize(IntendedTy))
8390 LookupResult Result(S, &S.Context.Idents.get("unichar"), E->getBeginLoc(),
8396 IntendedTy = S.Context.getTypedefType(TD);
8404 if (S.Context.getTargetInfo().getTriple().isOSDarwin()) {
8406 std::tie(CastTy, CastTyName) = shouldNotPrintDirectly(S.Context, IntendedTy, E);
8412 AT.matchesType(S.Context, CastTy))
8422 fixedFS.fixType(IntendedTy, S.getLangOpts(), S.Context, isObjCContext());
8450 << AT.getRepresentativeTypeName(S.Context)
8466 IntendedTy.print(CastFix, S.Context.getPrintingPolicy());
8470 if (!AT.matchesType(S.Context, IntendedTy) || ShouldNotPrintDirectly)
8515 << AT.getRepresentativeTypeName(S.Context) << ExprTy << IsEnum
8544 S.PDiag(Diag) << AT.getRepresentativeTypeName(S.Context) << ExprTy
8554 << AT.getRepresentativeTypeName(S.Context) << CSR
8565 << AT.getRepresentativeTypeName(S.Context) << CSR
8573 << AT.getRepresentativeTypeName(S.Context) << E->getSourceRange();
8715 const analyze_format_string::ArgType &AT = FS.getArgType(S.Context);
8722 AT.matchesType(S.Context, Ex->getType());
8729 S.getLangOpts(), S.Context);
8742 S.PDiag(Diag) << AT.getRepresentativeTypeName(S.Context)
8751 << AT.getRepresentativeTypeName(S.Context)
8786 S.Context.getAsConstantArrayType(FExpr->getType());
8794 Str, Str + StrLen, S.getLangOpts(), S.Context.getTargetInfo()))
8829 S.Context.getTargetInfo(),
8839 S.Context.getTargetInfo()))
8849 const ConstantArrayType *T = Context.getAsConstantArrayType(FExpr->getType());
8855 Context.getTargetInfo());
9086 LookupResult R(S, &S.Context.Idents.get("abs"), Loc, Sema::LookupAnyName);
9107 S.Context.getTypeSize(ArgType) <=
9108 S.Context.getTypeSize(ParamType)) {
9116 FunctionName = S.Context.BuiltinInfo.getName(AbsKind);
9117 HeaderName = S.Context.BuiltinInfo.getHeaderName(AbsKind);
9120 DeclarationName DN(&S.Context.Idents.get(FunctionName));
9182 IsStdAbs ? "std::abs" : Context.BuiltinInfo.getName(AbsKind);
9214 if (Context.getTypeSize(ArgType) <= Context.getTypeSize(ParamType))
9214 if (Context.getTypeSize(ArgType) <= Context.getTypeSize(ParamType))
9217 unsigned NewAbsKind = getBestAbsFunction(Context, ArgType, AbsKind);
9233 NewAbsKind = getBestAbsFunction(Context, ArgType, NewAbsKind);
9638 SizeOfArg->Profile(SizeOfArgID, Context, true);
9640 Dest->Profile(DestID, Context, true);
9651 (Context.getTypeSize(PointeeTy) == Context.getCharWidth()))
9651 (Context.getTypeSize(PointeeTy) == Context.getCharWidth()))
9692 Context.typesAreCompatible(SizeOfArgTy, DestTy)) {
9813 const Expr *SrcArg = ignoreLiteralAdditions(Call->getArg(1), Context);
9814 const Expr *SizeArg = ignoreLiteralAdditions(Call->getArg(2), Context);
9829 CompareWithSrc = ignoreLiteralAdditions(SizeCall->getArg(0), Context);
9858 if (!isConstantSizeArrayWithMoreThanOneElement(DstArg->getType(), Context))
9948 Context);
9983 (!isObjCMethod && isNonNullType(Context, lhsType))) &&
10677 S.Context.hasSameUnqualifiedType(Constant->getType(), Other->getType()))
10685 IntRange OtherRange = IntRange::forValueOfType(S.Context, OtherT);
10787 if (!S.Context.hasSameUnqualifiedType(T, E->getRHS()->getType()))
10797 if (T->isIntegralType(S.Context)) {
10801 bool IsRHSIntegralLiteral = RHS->isIntegerConstantExpr(RHSValue, S.Context);
10802 bool IsLHSIntegralLiteral = LHS->isIntegerConstantExpr(LHSValue, S.Context);
10860 GetExprRange(S.Context, signedOperand, S.isConstantEvaluated());
10876 unsigned comparisonWidth = S.Context.getIntWidth(T);
10878 GetExprRange(S.Context, unsignedOperand, S.isConstantEvaluated());
10933 unsigned FieldWidth = Bitfield->getBitWidthValue(S.Context);
10936 if (!OriginalInit->EvaluateAsInt(Result, S.Context,
11111 E->EvaluateAsFloat(Value, S.Context, Expr::SE_AllowSideEffects);
11126 llvm::APSInt IntegerValue(S.Context.getIntWidth(T),
11263 const Type *Target = S.Context.getCanonicalType(Ex->getType()).getTypePtr();
11265 S.Context.getCanonicalType(InnerE->getType()).getTypePtr();
11310 E->isNullPointerConstant(S.Context, Expr::NPC_ValueDependentIsNotNull);
11497 if (S.Context.hasSameUnqualifiedType(LHSStrippedType, RHSStrippedType))
11520 E->EvaluateAsInt(Result, S.Context, Expr::SE_AllowSideEffects))
11548 const Type *Source = S.Context.getCanonicalType(E->getType()).getTypePtr();
11549 const Type *Target = S.Context.getCanonicalType(T).getTypePtr();
11589 if (isObjCSignedCharBool(S, T) && Source->isIntegralType(S.Context)) {
11620 if (S.Context.getTypeSize(Source) == S.Context.getTypeSize(Target))
11620 if (S.Context.getTypeSize(Source) == S.Context.getTypeSize(Target))
11660 if (E->EvaluateAsRValue(result, S.Context)) {
11663 S.Context.getFloatTypeSemantics(QualType(TargetBT, 0)),
11664 S.Context.getFloatTypeSemantics(QualType(SourceBT, 0))))
11722 if (E->EvaluateAsFixedPoint(Result, S.Context, Expr::SE_AllowSideEffects,
11725 APFixedPoint MaxVal = S.Context.getFixedPointMax(T);
11726 APFixedPoint MinVal = S.Context.getFixedPointMin(T);
11739 E->EvaluateAsFixedPoint(Result, S.Context,
11745 S.Context.getIntWidth(T),
11762 E->EvaluateAsInt(Result, S.Context, Expr::SE_AllowSideEffects)) {
11767 Value, S.Context.getFixedPointSemantics(T), &Overflowed);
11787 IntRange SourceRange = GetExprRange(S.Context, E, S.isConstantEvaluated());
11793 S.Context.getFloatTypeSemantics(QualType(TargetBT, 0)));
11799 if (E->isIntegerConstantExpr(SourceInt, S.Context)) {
11804 S.Context.getFloatTypeSemantics(QualType(TargetBT, 0)));
11852 IntRange SourceRange = GetExprRange(S.Context, E, S.isConstantEvaluated());
11853 IntRange TargetRange = IntRange::forTargetOfCanonicalType(S.Context, Target);
11859 if (E->EvaluateAsInt(Result, S.Context, Expr::SE_AllowSideEffects,
11882 if (TargetRange.Width == 32 && S.Context.getIntWidth(E->getType()) == 64)
11908 if (E->EvaluateAsInt(Result, S.Context, Expr::SE_AllowSideEffects) &&
11956 SourceType = S.Context.getTypeDeclType(Enum);
11957 Source = S.Context.getCanonicalType(SourceType).getTypePtr();
12029 CheckImplicitConversion(S, E->IgnoreParenImpCasts(), S.Context.BoolTy, CC);
12183 if (!Call->getCallReturnType(SemaRef.Context)->isReferenceType())
12449 E->EvaluateForOverflow(Context);
12456 E->EvaluateForOverflow(Context);
12641 Result, Self.SemaRef.Context, Self.SemaRef.isConstantEvaluated());
12734 : Base(S.Context), SemaRef(S), Region(Tree.root()), WorkList(WorkList) {
13027 const ArrayType *AT = S.Context.getAsArrayType(PType);
13151 CharUnits DestAlign = Context.getTypeAlignInChars(DestPointee);
13165 CharUnits SrcAlign = Context.getTypeAlignInChars(SrcPointee);
13169 SrcAlign = getDeclAlign(CE->getSubExpr(), SrcAlign, Context);
13172 SrcAlign = getDeclAlign(UO->getSubExpr(), SrcAlign, Context);
13246 Context.getAsConstantArrayType(BaseExpr->getType());
13256 if (!IndexExpr->EvaluateAsInt(Result, Context, Expr::SE_AllowSideEffects))
13285 uint64_t ptrarith_typesize = Context.getTypeSize(EffectiveType);
13286 uint64_t array_typesize = Context.getTypeSize(BaseType);
13629 FindCaptureVisitor visitor(S.Context, owner.Variable);
14551 if (!GetMatchingCType(ArgumentKind, TypeTagExpr, Context,
14584 if (!ArgumentExpr->isNullPointerConstant(Context,
14597 RequiredType = Context.getPointerType(RequiredType);
14601 mismatch = !Context.hasSameType(ArgumentType, RequiredType);
14615 mismatch = !isLayoutCompatible(Context,
14619 mismatch = !isLayoutCompatible(Context, ArgumentType, RequiredType);
14659 Context.getTypeAlignInChars(
14719 CharUnits ExpectedAlignment = Context.getTypeAlignInChars(E->getType());
14729 Offset += Context.toCharUnitsFromBits(Context.getFieldOffset(*I));
14729 Offset += Context.toCharUnitsFromBits(Context.getFieldOffset(*I));
14733 CharUnits CompleteObjectAlignment = Context.getTypeAlignInChars(
14742 std::max(CompleteObjectAlignment, Context.getDeclAlign(VD));
14765 Context.getTypeAlignInChars(FD->getType()),
14766 Context.getTypeAlignInChars(FD->getParent()->getTypeForDecl()));
tools/clang/lib/Sema/SemaCodeComplete.cpp 241 PreferredType = SemaRef.Context.getCanonicalType(T);
804 R.Qualifier = getRequiredQualification(SemaRef.Context, CurContext,
996 QualType T = getDeclUsageType(SemaRef.Context, R.Declaration);
998 CanQualType TC = SemaRef.Context.getCanonicalType(T);
1000 if (SemaRef.Context.hasSameUnqualifiedType(PreferredType, TC))
1042 for (NamedDecl *Ctor : getConstructors(SemaRef.Context, Record)) {
1156 NestedNameSpecifier::Create(SemaRef.Context, nullptr, Namespace);
1159 SemaRef.Context, nullptr, false,
1160 SemaRef.Context.getTypeDeclType(Tag).getTypePtr());
1279 NestedNameSpecifier::Create(SemaRef.Context, nullptr, Namespace);
1282 SemaRef.Context, nullptr, false,
1283 SemaRef.Context.getTypeDeclType(Tag).getTypePtr());
1534 QualType T = getDeclUsageType(SemaRef.Context, ND);
1538 T = SemaRef.Context.getBaseElementType(T);
1539 return isObjCReceiverType(SemaRef.Context, T);
1559 QualType T = getDeclUsageType(SemaRef.Context, ND);
1563 T = SemaRef.Context.getBaseElementType(T);
1864 return getCompletionPrintingPolicy(S.Context, S.PP);
1915 GetCompletionTypeString(ThisTy, S.Context, Policy, Allocator));
3199 return CreateCodeCompletionString(S.Context, S.PP, CCContext, Allocator,
3680 AddResultTypeChunk(S.Context, Policy, FDecl, QualType(), Result);
3977 S.Context, CurContext, Overridden->getDeclContext());
4379 AddEnumerators(Results, Context, Enum, CurContext, CoveredEnumerators());
5026 AddEnumerators(Results, Context, Enum, CurContext, Enumerators);
5082 else if (!SemaRef.Context.hasSameUnqualifiedType(
5166 Context.DeclarationNames.getCXXOperatorName(OO_Call);
5467 Ctx = Context.getTranslationUnitDecl();
5580 InitializedBases.insert(Context.getCanonicalType(
5633 auto Ctors = getConstructors(Context, RD);
5660 if (!InitializedBases.insert(Context.getCanonicalType(Base.getType()))
5664 Context.hasSameUnqualifiedType(
5675 if (!InitializedBases.insert(Context.getCanonicalType(Base.getType()))
5679 Context.hasSameUnqualifiedType(
6537 if (!S.Context.hasSameUnqualifiedType((*CurP)->getType(),
6551 AddResultTypeChunk(S.Context, getCompletionPrintingPolicy(S), SuperMethod,
6666 Context.getTypeDeclType(TD)->getAs<ObjCObjectType>())
6688 Receiver = ParsedType::make(Context.getObjCInterfaceType(CDecl));
6699 ASTContext &Context = Results.getSema().Context;
6856 : Super ? Context.getObjCObjectPointerType(
6857 Context.getObjCInterfaceType(Super))
6858 : Context.getObjCIdType();
6867 S, ParsedType::make(Context.getObjCInterfaceType(IFace)), SelIdents,
6871 Context.getObjCObjectPointerType(Context.getObjCInterfaceType(IFace));
6871 Context.getObjCObjectPointerType(Context.getObjCInterfaceType(IFace));
7103 AddProtocolResults(Context.getTranslationUnitDecl(), CurContext, false,
7122 AddProtocolResults(Context.getTranslationUnitDecl(), CurContext, true,
7159 AddInterfaceResults(Context.getTranslationUnitDecl(), CurContext, false,
7184 AddInterfaceResults(Context.getTranslationUnitDecl(), CurContext, false,
7202 AddInterfaceResults(Context.getTranslationUnitDecl(), CurContext, false,
7234 TranslationUnitDecl *TU = Context.getTranslationUnitDecl();
7350 QualType PropertyType = Context.getObjCIdType();
7405 GetCompletionTypeString(PropertyType, Context, Policy, Allocator));
8191 FindImplementableMethods(Context, SearchDecl, IsInstanceMethod, ReturnType,
8217 QualType ResTy = Method->getSendResultType().stripObjCKindOfType(Context);
8219 AddObjCPassingTypeChunk(ResTy, Method->getObjCDeclQualifier(), Context,
8251 Context, {}, ObjCSubstitutionContext::Parameter);
8253 AddObjCPassingTypeChunk(ParamType, (*P)->getObjCDeclQualifier(), Context,
8293 if (Context.getLangOpts().ObjC) {
8315 AddObjCKeyValueCompletions(P, *IsInstanceMethod, ReturnType, Context,
8797 Context.getTranslationUnitDecl());
8798 LookupVisibleDecls(Context.getTranslationUnitDecl(), LookupAnyName,
tools/clang/lib/Sema/SemaConcept.cpp 40 if (!Context.hasSameUnqualifiedType(Type, Context.BoolTy)) {
40 if (!Context.hasSameUnqualifiedType(Type, Context.BoolTy)) {
111 if (!E.get()->EvaluateAsRValue(EvalResult, Context)) {
tools/clang/lib/Sema/SemaCoroutine.cpp 72 TemplateArgument(T), S.Context.getTrivialTypeSourceInfo(T, KwLoc)));
88 ? S.Context.getRValueReferenceType(T)
89 : S.Context.getLValueReferenceType(T, /*SpelledAsLValue*/ true);
120 QualType PromiseType = S.Context.getTypeDeclType(Promise);
123 auto *NNS = NestedNameSpecifier::Create(S.Context, nullptr, StdExp);
124 NNS = NestedNameSpecifier::Create(S.Context, NNS, false,
126 return S.Context.getElaboratedType(ETK_None, NNS, PromiseType);
172 S.Context.getTrivialTypeSourceInfo(PromiseType, Loc)));
255 SemaRef.Context.DeclarationNames.getCXXOperatorName(OO_Coawait);
266 SemaRef.Context, /*NamingClass*/ nullptr, NestedNameSpecifierLoc(),
294 StringRef Name = S.Context.BuiltinInfo.getName(Id);
295 LookupResult R(S, &S.Context.Idents.get(Name), Loc, Sema::LookupOrdinaryName);
401 OpaqueValueExpr *Operand = new (S.Context)
445 QualType RetType = AwaitSuspend->getCallReturnType(S.Context);
491 ? Context.DependentTy
496 auto *VD = VarDecl::Create(Context, FD, FD->getLocation(), FD->getLocation(),
498 Context.getTrivialTypeSourceInfo(T, Loc), SC_None);
544 Expr *PLE = ParenListExpr::Create(Context, FD->getLocation(),
728 new (Context) DependentCoawaitExpr(Loc, Context.DependentTy, E, Lookup);
728 new (Context) DependentCoawaitExpr(Loc, Context.DependentTy, E, Lookup);
763 Expr *Res = new (Context)
764 CoawaitExpr(Loc, Context.DependentTy, E, IsImplicit);
785 new (Context) CoawaitExpr(Loc, E, RSS.Results[0], RSS.Results[1],
824 Expr *Res = new (Context) CoyieldExpr(Loc, Context.DependentTy, E);
824 Expr *Res = new (Context) CoyieldExpr(Loc, Context.DependentTy, E);
840 new (Context) CoyieldExpr(Loc, E, RSS.Results[0], RSS.Results[1],
896 Stmt *Res = new (Context) CoreturnStmt(Loc, E, PCE, IsImplicit);
937 S.Context.DeclarationNames.getCXXOperatorName(OO_Delete);
989 Body = CoroutineBodyStmt::Create(Context, Builder);
1448 S.Context, &FD, FD.getLocation(), FD.getLocation(),
1450 S.Context.getTrivialTypeSourceInfo(GroType, Loc), SC_None);
1504 S.Context.getTrivialTypeSourceInfo(TargetType, ExprLoc);
1515 TypeSourceInfo *TInfo = S.Context.getTrivialTypeSourceInfo(Type, Loc);
1516 VarDecl *Decl = VarDecl::Create(S.Context, S.CurContext, Loc, Loc, II, Type,
1563 CoroutineBodyStmt *Res = CoroutineBodyStmt::Create(Context, Args);
tools/clang/lib/Sema/SemaDecl.cpp 57 return DeclGroupPtrTy::make(DeclGroupRef::Create(Context, Group, 2));
257 ASTContext &Context = S.Context;
322 NestedNameSpecifierLoc QualifierLoc = SS->getWithLocInContext(Context);
387 NewSS.MakeTrivial(Context, NNS, SourceRange(NameLoc));
407 SS->MakeTrivial(Context, NNS, SourceRange(NameLoc));
482 T = Context.getTypeDeclType(TD);
487 T = Context.getObjCInterfaceType(IDecl);
490 T = Context.getDeducedTemplateSpecializationType(TemplateName(TD),
513 ElabTL.setQualifierLoc(SS->getWithLocInContext(Context));
514 return CreateParsedType(T, Builder.getTypeSourceInfo(Context, T));
569 NNS = synthesizeCurrentNestedNameSpecifier(Context, CurContext);
575 NNS = NestedNameSpecifier::Create(Context, nullptr, RD->isTemplateDecl(),
587 QualType T = Context.getDependentNameType(ETK_None, NNS, &II);
592 NNSLocBuilder.MakeTrivial(Context, NNS, SourceRange(NameLoc));
593 NestedNameSpecifierLoc QualifierLoc = NNSLocBuilder.getWithLocInContext(Context);
600 return CreateParsedType(T, Builder.getTypeSourceInfo(Context, T));
650 if (Ty && Context.hasSameUnqualifiedType(QualType(Ty, 1), Base.getType()))
712 tmpSS.MakeTrivial(Context, Corrected.getCorrectionSpecifier(),
836 ASTContext &Context = S.Context;
930 Context.getAssumedTemplateName(NameInfo.getName());
1086 Template = Context.getOverloadedTemplateName(Result.begin(),
1097 Context.getQualifiedTemplateName(SS.getScopeRep(),
1105 Template = Context.getAssumedTemplateName(NameInfo.getName());
1125 QualType T = Context.getTypeDeclType(Type);
1149 QualType T = Context.getObjCInterfaceType(Class);
1168 QualType T = Context.getTypeDeclType(Type);
1514 if (ConsiderLinkage && isOutOfScopePreviousDeclaration(D, Ctx, Context))
1666 Context.DeclMustBeEmitted(FD))
1675 if (Context.DeclMustBeEmitted(VD))
1854 GenerateFixForUnusedDecl(D, Context, Hint);
2000 ASTContext &Context = ThisSema.Context;
2037 QualType R = Context.GetBuiltinType(ID, Error);
2051 << Context.BuiltinInfo.getName(ID);
2058 << getHeaderName(Context.BuiltinInfo, ID, Error)
2059 << Context.BuiltinInfo.getName(ID);
2064 (Context.BuiltinInfo.isPredefinedLibFunction(ID) ||
2065 Context.BuiltinInfo.isHeaderDependentFunction(ID))) {
2067 << Context.BuiltinInfo.getName(ID) << R;
2068 if (Context.BuiltinInfo.getHeaderName(ID) &&
2071 << Context.BuiltinInfo.getHeaderName(ID)
2072 << Context.BuiltinInfo.getName(ID);
2078 DeclContext *Parent = Context.getTranslationUnitDecl();
2081 LinkageSpecDecl::Create(Context, Parent, Loc, Loc,
2088 FunctionDecl *New = FunctionDecl::Create(Context,
2102 ParmVarDecl::Create(Context, New, SourceLocation(), SourceLocation(),
2151 if (S.Context.hasSameType(OldTD->getUnderlyingType(),
2173 OldType = Context.getTypeDeclType(Old);
2190 !Context.hasSameType(OldType, NewType)) {
2231 Context.setObjCIdRedefinitionType(T);
2233 New->setTypeForDecl(Context.getObjCIdType().getTypePtr());
2239 Context.setObjCClassRedefinitionType(New->getUnderlyingType());
2241 New->setTypeForDecl(Context.getObjCClassType().getTypePtr());
2246 Context.setObjCSelRedefinitionType(New->getUnderlyingType());
2248 New->setTypeForDecl(Context.getObjCSelType().getTypePtr());
2369 Context.getSourceManager().isInSystemHeader(Old->getLocation()) ||
2370 Context.getSourceManager().isInSystemHeader(New->getLocation())))
2430 unsigned Align = I->getAlignment(S.Context);
2447 unsigned Align = I->getAlignment(S.Context);
2465 Ty = S.Context.getTagDeclType(cast<TagDecl>(New));
2468 OldAlign = S.Context.getTypeAlign(Ty);
2470 NewAlign = S.Context.getTypeAlign(Ty);
2475 << (unsigned)S.Context.toCharUnitsFromBits(OldAlign).getQuantity()
2476 << (unsigned)S.Context.toCharUnitsFromBits(NewAlign).getQuantity();
2500 AlignedAttr *Clone = OldStrictestAlignAttr->clone(S.Context);
2509 AlignedAttr *Clone = OldAlignasAttr->clone(S.Context);
2555 &S.Context.Idents.get(AA->getSpelling()));
2585 NewAttr = cast<InheritableAttr>(Attr->clone(S.Context));
2773 UsedAttr *NewAttr = OldAttr->clone(Context);
2947 cast<InheritableParamAttr>(I->clone(S.Context));
2960 if (auto Oldnullability = OldParam->getType()->getNullability(S.Context)) {
2961 if (auto Newnullability = NewParam->getType()->getNullability(S.Context)) {
2976 NewT = S.Context.getAttributedType(
3260 New->addAttr(OverloadableAttr::CreateImplicit(Context));
3279 QualType OldQType = Context.getCanonicalType(Old->getType());
3280 QualType NewQType = Context.getCanonicalType(New->getType());
3372 AdjustedType = Context.adjustFunctionType(AdjustedType, NewTypeInfo);
3374 NewQType = Context.getCanonicalType(New->getType());
3417 OldQType = Context.getCanonicalType(Old->getType());
3418 NewQType = Context.getCanonicalType(New->getType());
3427 if (!Context.hasSameType(OldDeclaredReturnType, NewDeclaredReturnType) &&
3434 ResQT = Context.mergeObjCGCQualifiers(NewQType, OldQType);
3459 OldAT->isDependentType() ? Context.DependentTy
3461 NewQType = Context.getCanonicalType(
3463 OldAT->isDependentType() ? Context.DependentTy
3571 = Context.adjustFunctionType(OldType, OldTypeInfo.withNoReturn(true));
3599 if (Context.hasSameFunctionTypeIgnoringExceptionSpec(OldQTypeForComparison,
3615 Context.typesAreCompatible(OldQType, NewQType)) {
3626 Context.getFunctionType(NewFuncType->getReturnType(), ParamTypes,
3634 ParmVarDecl *Param = ParmVarDecl::Create(Context, New, SourceLocation(),
3672 QualType MergedReturn = Context.mergeTypes(OldProto->getReturnType(),
3679 if (Context.typesAreCompatible(OldParm->getType(),
3682 } else if (Context.typesAreCompatible(OldParm->getType(),
3705 New->setType(Context.getFunctionType(MergedReturn, ArgTypes,
3722 if (Context.BuiltinInfo.isPredefinedLibFunction(BuiltinID)) {
3787 QualType Merged = Context.mergeTypes(Old->getType(), New->getType());
3817 assert(!S.Context.hasSameType(New->getType(), Old->getType()));
3849 } else if (Context.hasSameType(New->getType(), Old->getType())) {
3859 const ArrayType *OldArray = Context.getAsArrayType(Old->getType());
3860 const ArrayType *NewArray = Context.getAsArrayType(New->getType());
3868 const ArrayType *PrevVDTy = Context.getAsArrayType(PrevVD->getType());
3872 if (!Context.hasSameType(NewArray, PrevVDTy))
3878 if (Context.hasSameType(OldArray->getElementType(),
3886 if (Context.hasSameType(OldArray->getElementType(),
3893 MergedT = Context.mergeObjCGCQualifiers(New->getType(),
3900 MergedT = Context.mergeTypes(New->getType(), Old->getType());
3914 New->setType(Context.DependentTy);
4300 if (!Context.getLangOpts().CPlusPlus)
4309 Context.getManglingNumberContext(Tag->getParent());
4310 Context.setManglingNumber(
4322 Context.setManglingNumber(
4341 if (!Context.hasSameType(NewTD->getUnderlyingType(),
4342 Context.getTagDeclType(TagFromDeclSpec))) {
4344 Context.addTypedefNameForUnnamedTagDecl(TagFromDeclSpec, NewTD);
4502 Context.getPrintingPolicy());
4725 new (SemaRef.Context)NamedDecl*[Chaining.size()];
4730 SemaRef.Context, Owner, VD->getLocation(), VD->getIdentifier(),
4734 IndirectField->addAttr(Attr->clone(SemaRef.Context));
4860 PrevSpec, DiagID, Context.getPrintingPolicy());
5008 Context, OwningClass, DS.getBeginLoc(), Record->getLocation(),
5009 /*IdentifierInfo=*/nullptr, Context.getTypeDeclType(Record), TInfo,
5026 Anon = VarDecl::Create(Context, Owner, DS.getBeginLoc(),
5028 Context.getTypeDeclType(Record), TInfo, SC);
5062 Context.setManglingNumber(
5065 Context.setStaticLocalNumber(NewVD, MCtx->getStaticLocalNumber(NewVD));
5099 QualType RecTy = Context.getTypeDeclType(Record);
5103 FieldDecl::Create(Context, ParentDecl, DS.getBeginLoc(), DS.getBeginLoc(),
5172 Context.DeclarationNames.getCXXDeductionGuideName(Template));
5177 NameInfo.setName(Context.DeclarationNames.getCXXOperatorName(
5186 NameInfo.setName(Context.DeclarationNames.getCXXLiteralOperatorName(
5196 NameInfo.setName(Context.DeclarationNames.getCXXConversionFunctionName(
5197 Context.getCanonicalType(Ty)));
5207 NameInfo.setName(Context.DeclarationNames.getCXXConstructorName(
5208 Context.getCanonicalType(Ty)));
5222 QualType CurClassType = Context.getTypeDeclType(CurClass);
5228 NameInfo.setName(Context.DeclarationNames.getCXXConstructorName(
5229 Context.getCanonicalType(CurClassType)));
5240 NameInfo.setName(Context.DeclarationNames.getCXXDestructorName(
5241 Context.getCanonicalType(Ty)));
5249 return Context.getNameForTemplate(TName, TNameLoc);
5334 TSI = S.Context.getTrivialTypeSourceInfo(T, DS.getTypeSpecTypeLoc());
5493 !Context.hasSameType(Name.getCXXNameType(),
5494 Context.getTypeDeclType(cast<CXXRecordDecl>(Cur))))
5859 Context.getExternCContextDecl()->makeDeclVisibleInContext(ND);
5864 auto Result = Context.getExternCContextDecl()->lookup(Name);
5948 TryToFixInvalidVariablyModifiedTypeSourceInfo(TInfo, Context,
6000 Context.setFILEDecl(NewTD);
6002 Context.setjmp_bufDecl(NewTD);
6004 Context.setsigjmp_bufDecl(NewTD);
6006 Context.setucontext_tDecl(NewTD);
6073 DD->setQualifierInfo(SS.getWithLocInContext(S.Context));
6103 type = Context.getLifetimeQualifiedType(type, lifetime);
6164 bool IsMicrosoft = S.Context.getTargetInfo().getCXXABI().isMicrosoft();
6297 bool IsMicrosoft = S.Context.getTargetInfo().getCXXABI().isMicrosoft();
6302 IsDefinition = VD->isThisDeclarationADefinition(S.Context) !=
6320 DLLExportAttr::CreateImplicit(S.Context, NewImportAttr->getRange()));
6349 DLLExportAttr *NewAttr = ParentExportAttr->clone(S.Context);
6371 return S.Context.GetGVALinkageForFunction(FD) == GVA_AvailableExternally;
6539 if (Context.getBaseElementType(R)->isHalfType()) {
6644 NewVD = VarDecl::Create(Context, DC, D.getBeginLoc(), D.getIdentifierLoc(),
6771 NewVD = DecompositionDecl::Create(Context, DC, D.getBeginLoc(),
6775 NewVD = VarDecl::Create(Context, DC, D.getBeginLoc(),
6781 VarTemplateDecl::Create(Context, DC, D.getIdentifierLoc(), Name,
6804 Context, TemplateParamLists.drop_back(VDTemplateParamLists));
6853 else if (!Context.getTargetInfo().isTLSSupported()) {
6887 Context.getTargetInfo().getCXXABI().isMicrosoft()))
6897 Context, D.getDeclSpec().getConstexprSpecLoc(),
6989 if (!Context.getTargetInfo().isValidGCCRegisterName(Label) &&
7001 const auto &TI = Context.getTargetInfo();
7007 Context.getTypeSize(R),
7014 if (!R->isIntegralType(Context) && !R->isPointerType()) {
7020 NewVD->addAttr(::new (Context) AsmLabelAttr(
7021 Context, SE->getStrTokenLoc(0), Label, /*IsLiteralLabel=*/true));
7132 Context.setManglingNumber(
7135 Context.setStaticLocalNumber(NewVD, MCtx->getStaticLocalNumber(NewVD));
7460 S.Context.getTranslationUnitDecl()->lookup(ND->getDeclName());
7551 T = Context.getObjCObjectPointerType(T);
7690 NewVD->getTypeSourceInfo(), Context, SizeIsNegative, Oversized);
7697 FixedT = TryToFixInvalidVariablyModifiedType(T, Context, SizeIsNegative,
7701 const VariableArrayType *VAT = Context.getAsVariableArrayType(T);
7813 QualType T = S->Context.getTypeDeclType(BaseRecord);
7814 CanQualType CT = S->Context.getCanonicalType(T);
7816 Name = S->Context.DeclarationNames.getCXXDestructorName(CT);
7990 DifferentNameValidatorCCC CCC(SemaRef.Context, NewFD,
7997 hasSimilarParameters(SemaRef.Context, FD, NewFD, MismatchedParams)) {
8020 hasSimilarParameters(SemaRef.Context, FD, NewFD, MismatchedParams)) {
8166 NewFD = FunctionDecl::Create(SemaRef.Context, DC, D.getBeginLoc(), NameInfo,
8202 SemaRef.Context, cast<CXXRecordDecl>(DC), D.getBeginLoc(), NameInfo, R,
8212 SemaRef.Context, Record, D.getBeginLoc(), NameInfo, R, TInfo,
8231 return FunctionDecl::Create(SemaRef.Context, DC, D.getBeginLoc(),
8250 SemaRef.Context, cast<CXXRecordDecl>(DC), D.getBeginLoc(), NameInfo, R,
8256 return CXXDeductionGuideDecl::Create(SemaRef.Context, DC, D.getBeginLoc(),
8274 SemaRef.Context, cast<CXXRecordDecl>(DC), D.getBeginLoc(), NameInfo, R,
8287 return FunctionDecl::Create(SemaRef.Context, DC, D.getBeginLoc(), NameInfo,
8681 FunctionTemplate = FunctionTemplateDecl::Create(Context, DC,
8690 NewFD->setTemplateParameterListsInfo(Context,
8698 NewFD->setTemplateParameterListsInfo(Context, TemplateParamLists);
8727 NewFD->setTemplateParameterListsInfo(Context, TemplateParamLists);
8779 SubstAutoType(FPT->getReturnType(), Context.DependentTy);
8780 NewFD->setType(Context.getFunctionType(Result, FPT->getParamTypes(),
8909 NewFD->setType(Context.getFunctionType(
8924 NewFD->addAttr(::new (Context)
8925 AsmLabelAttr(Context, SE->getStrTokenLoc(0),
9024 NewFD->addAttr(C11NoReturnAttr::Create(Context,
9040 Context, PragmaClangTextSection.SectionName,
9047 Context, CodeSegStack.CurrentValue->getString(),
9378 Context.getDefaultCallingConvention(true, false));
9382 QualType R = Context.getFunctionType(FT->getReturnType(), None, EPI);
9425 Context.setcudaConfigureCallDecl(NewFD);
9510 Context, CurContext, NewFD->getLocation(),
9669 const TargetInfo &TargetInfo = S.Context.getTargetInfo();
9785 QualType NewQType = Context.getCanonicalType(NewFD->getType());
9795 QualType OldQType = Context.getCanonicalType(OldFD->getType());
10258 if (!AllowOverloadingOfFunction(Previous, Context, NewFD)) {
10330 MD->setType(Context.getFunctionType(FPT->getReturnType(),
10424 NewFD->addAttr(OverloadableAttr::CreateImplicit(Context));
10437 QualType ClassType = Context.getTypeDeclType(Record);
10443 = Context.DeclarationNames.getCXXDestructorName(
10444 Context.getCanonicalType(ClassType));
10507 QualType T = Context.GetBuiltinType(BuiltinID, Error);
10513 !Context.hasSameFunctionTypeIgnoringExceptionSpec(T,
10517 Context.BuiltinInfo.forgetBuiltin(BuiltinID, Context.Idents);
10517 Context.BuiltinInfo.forgetBuiltin(BuiltinID, Context.Idents);
10529 else if (!R.isPODType(Context) && !R->isVoidType() &&
10618 FT = Context.adjustFunctionType(FT, FT->getExtInfo().withCallingConv(CC_C));
10620 T = Context.getCanonicalType(FD->getType());
10629 if (Context.hasSameUnqualifiedType(FT->getReturnType(), Context.IntTy))
10629 if (Context.hasSameUnqualifiedType(FT->getReturnType(), Context.IntTy))
10644 if (Context.hasSameType(FT->getReturnType(), Context.IntTy))
10644 if (Context.hasSameType(FT->getReturnType(), Context.IntTy))
10674 if (nparams == 4 && Context.getTargetInfo().getTriple().isOSDarwin())
10687 Context.getPointerType(Context.getPointerType(Context.CharTy));
10687 Context.getPointerType(Context.getPointerType(Context.CharTy));
10687 Context.getPointerType(Context.getPointerType(Context.CharTy));
10688 QualType Expected[] = { Context.IntTy, CharPP, CharPP, CharPP };
10695 if (Context.hasSameUnqualifiedType(AT, Expected[i]))
10707 Context.hasSameType(QualType(qs.strip(PT->getPointeeType()), 0),
10708 Context.CharTy)) {
10761 if (Init->isConstantInitializer(Context, false, &Culprit))
10785 SelfReferenceChecker(Sema &S, Decl *OrigDecl) : Inherited(S.Context),
10792 isPODType = VD->getType().isPODType(S.Context);
11194 Init->getType() == Context.UnknownAnyTy && !IsInitCapture) {
11195 ExprResult Result = forceUnknownAnyToType(Init, Context.getObjCIdType());
11207 Context.hasSameUnqualifiedType(Type, Context.getAutoDeductType()) &&
11207 Context.hasSameUnqualifiedType(Type, Context.getAutoDeductType()) &&
11209 return Context.getQualifiedType(DeduceInit->getType(),
11334 if (const auto *AT = S.Context.getAsArrayType(QT))
11335 return this->asDerived().visit(S.Context.getBaseElementType(AT), FD,
11399 if (const auto *AT = S.Context.getAsArrayType(QT))
11400 return this->asDerived().visit(S.Context.getBaseElementType(AT), FD,
11465 if (const auto *AT = S.Context.getAsArrayType(QT))
11466 return this->asDerived().visit(S.Context.getBaseElementType(AT), FD,
11607 if (const ArrayType *Array = Context.getAsIncompleteArrayType(BaseDeclType))
11678 Init->getType() == Context.UnknownAnyTy) {
11679 ExprResult Result = forceUnknownAnyToType(Init, Context.getObjCIdType());
11760 VDecl->getType().isNonWeakInMRRWithObjCWeak(Context)) &&
11815 if (!Init->isConstantInitializer(Context, false, &Culprit)) {
11873 else if (Init->isIntegerConstantExpr(Context, &Loc))
11876 Init->isCXX11ConstantExpr(Context))
11878 else if (Init->isEvaluatable(Context)) {
11906 if (!Init->isValueDependent() && !Init->isEvaluatable(Context)) {
11914 } else if (getLangOpts().CPlusPlus11 && DclT->isLiteralType(Context)) {
11935 !Context.getBaseElementType(VDecl->getType()).isConstQualified()) &&
11943 if (Context.getTargetInfo().getCXXABI().isMicrosoft() &&
12011 Context.getBaseElementType(Ty),
12060 !Context.getTargetInfo().getCXXABI().isMicrosoft()) {
12136 = Context.getAsIncompleteArrayType(Type)) {
12192 Context.getBaseElementType(Type),
12221 = Context.getBaseElementType(Type)->getAs<RecordType>()) {
12405 Context, var->getType()->isReferenceType(), &CacheCulprit);
12448 Context, Stack->CurrentValue->getString(),
12459 var->addAttr(InitSegAttr::CreateImplicit(Context, CurInitSeg->getString(),
12468 if (Context.DeclMustBeEmitted(var) && !ModuleScopes.empty())
12469 Context.addModuleInitializer(ModuleScopes.back().Module, var);
12484 QualType baseType = Context.getBaseElementType(type);
12503 } else if (var->mightBeUsableInConstantExpressions(Context)) {
12557 if (Context.DeclMustBeEmitted(var) && !ModuleScopes.empty())
12558 Context.addModuleInitializer(ModuleScopes.back().Module, var);
12625 Context, PragmaClangBSSSection.SectionName,
12630 Context, PragmaClangDataSection.SectionName,
12635 Context, PragmaClangRodataSection.SectionName,
12640 Context, PragmaClangRelroSection.SectionName,
12656 if (unsigned MaxAlign = Context.getTargetInfo().getMaxTLSAlign()) {
12661 CharUnits MaxAlignChars = Context.toCharUnitsFromBits(MaxAlign);
12662 if (Context.getDeclAlign(VD) > MaxAlignChars) {
12664 << (unsigned)Context.getDeclAlign(VD).getQuantity() << VD
12774 if (!MagicValueExpr->isIntegerConstantExpr(MagicValueInt, Context)) {
12861 Context.addDeclaratorForUnnamedTagDecl(Tag, FirstDeclaratorInGroup);
12888 } else if (!Context.hasSameType(DT->getDeducedType(), Deduced)) {
12906 DeclGroupRef::Create(Context, Group.data(), Group.size()));
12941 Context.attachCommentsToJustParsedDecls(Group, &getPreprocessor());
13057 CheckParameter(Context.getTranslationUnitDecl(), D.getBeginLoc(),
13095 ParmVarDecl *Param = ParmVarDecl::Create(Context, DC, Loc, Loc, nullptr,
13096 T, Context.getTrivialTypeSourceInfo(T, Loc),
13124 if (!ReturnTy->isDependentType() && ReturnTy.isPODType(Context)) {
13125 unsigned Size = Context.getTypeSizeInChars(ReturnTy).getQuantity();
13135 if (T->isDependentType() || !T.isPODType(Context))
13137 unsigned Size = Context.getTypeSizeInChars(T).getQuantity();
13172 T = Context.getLifetimeQualifiedType(T, lifetime);
13175 ParmVarDecl *New = ParmVarDecl::Create(Context, DC, StartLoc, NameLoc, Name,
13176 Context.getAdjustedParameterType(T),
13207 T = Context.getObjCObjectPointerType(T);
13251 DiagID, Context.getPrintingPolicy());
13553 if (!Context.BuiltinInfo.isPredefinedLibFunction(BuiltinID) &&
13554 !Context.BuiltinInfo.isPredefinedRuntimeFunction(BuiltinID)) {
13789 Context.adjustDeducedFunctionResultType(
13790 FD, SubstAutoType(ResultType.getType(), Context.VoidTy));
13804 LSI->ReturnType.isNull() ? Context.VoidTy : LSI->ReturnType;
13809 FD->setType(Context.getFunctionType(RetType, Proto->getParamTypes(),
13903 (KeyFunction = Context.getCurrentKeyFunction(MD->getParent())) &&
13907 !Context.getTargetInfo().getCXXABI().canKeyFunctionBeInline()) {
13908 Context.setNonKeyFunction(MD);
13912 KeyFunction = Context.getCurrentKeyFunction(MD->getParent());
14123 !Context.typesAreCompatible(
14125 Context.getFunctionNoProtoType(Context.IntTy))) {
14125 Context.getFunctionNoProtoType(Context.IntTy))) {
14170 Context.getPrintingPolicy());
14224 if (Context.BuiltinInfo.isPrintfLike(BuiltinID, FormatIdx, HasVAListArg)) {
14231 FD->addAttr(FormatAttr::CreateImplicit(Context,
14232 &Context.Idents.get(fmt),
14238 if (Context.BuiltinInfo.isScanfLike(BuiltinID, FormatIdx,
14241 FD->addAttr(FormatAttr::CreateImplicit(Context,
14242 &Context.Idents.get("scanf"),
14251 Context.BuiltinInfo.performsCallback(BuiltinID, Encoding))
14253 Context, Encoding.data(), Encoding.size(), FD->getLocation()));
14259 Context.BuiltinInfo.isConstWithoutErrno(BuiltinID))
14260 FD->addAttr(ConstAttr::CreateImplicit(Context, FD->getLocation()));
14265 const llvm::Triple &Trip = Context.getTargetInfo().getTriple();
14275 FD->addAttr(ConstAttr::CreateImplicit(Context, FD->getLocation()));
14282 if (Context.BuiltinInfo.isReturnsTwice(BuiltinID) &&
14284 FD->addAttr(ReturnsTwiceAttr::CreateImplicit(Context,
14286 if (Context.BuiltinInfo.isNoThrow(BuiltinID) && !FD->hasAttr<NoThrowAttr>())
14287 FD->addAttr(NoThrowAttr::CreateImplicit(Context, FD->getLocation()));
14288 if (Context.BuiltinInfo.isPure(BuiltinID) && !FD->hasAttr<PureAttr>())
14289 FD->addAttr(PureAttr::CreateImplicit(Context, FD->getLocation()));
14290 if (Context.BuiltinInfo.isConst(BuiltinID) && !FD->hasAttr<ConstAttr>())
14291 FD->addAttr(ConstAttr::CreateImplicit(Context, FD->getLocation()));
14292 if (getLangOpts().CUDA && Context.BuiltinInfo.isTSBuiltin(BuiltinID) &&
14298 Context.BuiltinInfo.isAuxBuiltinID(BuiltinID))
14299 FD->addAttr(CUDADeviceAttr::CreateImplicit(Context, FD->getLocation()));
14301 FD->addAttr(CUDAHostAttr::CreateImplicit(Context, FD->getLocation()));
14312 FD->addAttr(NoThrowAttr::CreateImplicit(Context, FD->getLocation()));
14332 FD->addAttr(FormatAttr::CreateImplicit(Context,
14333 &Context.Idents.get("printf"), 2,
14342 FD->addAttr(FormatArgAttr::CreateImplicit(Context, ParamIdx(1, FD),
14354 TInfo = Context.getTrivialTypeSourceInfo(T);
14359 TypedefDecl::Create(Context, CurContext, D.getBeginLoc(),
14433 !Context.hasSameUnqualifiedType(EnumUnderlyingTy,
14769 EnumUnderlying = Context.IntTy.getTypePtr();
14779 EnumUnderlying = Context.IntTy.getTypePtr();
14783 EnumUnderlying = Context.IntTy.getTypePtr();
14785 } else if (Context.getTargetInfo().getTriple().isWindowsMSVCEnvironment()) {
14791 EnumUnderlying = Context.IntTy.getTypePtr();
14816 New = EnumDecl::Create(Context, SearchDC, KWLoc, Loc, Name, nullptr,
14830 New = RecordDecl::Create(Context, Kind, SearchDC, KWLoc, Loc, Name,
15303 auto *TD = Context.getTagDeclType(PrevTagDecl)->getAsTagDecl();
15412 New = EnumDecl::Create(Context, SearchDC, KWLoc, Loc, Name,
15456 New = CXXRecordDecl::Create(Context, Kind, SearchDC, KWLoc, Loc, Name,
15462 New = RecordDecl::Create(Context, Kind, SearchDC, KWLoc, Loc, Name,
15471 << Context.getTagDeclType(New);
15478 << Context.getTagDeclType(New);
15492 New->setQualifierInfo(SS.getWithLocInContext(Context));
15494 New->setTemplateParameterListsInfo(Context, TemplateParameterLists);
15548 Diag(Loc, diag::warn_decl_in_param_list) << Context.getTagDeclType(New);
15603 Context.setFILEDecl(New);
15681 Context, FinalLoc, AttributeCommonInfo::AS_Keyword,
15690 Context, Record->getTagKind(), CurContext, Record->getBeginLoc(),
15694 Context.getTypeDeclType(InjectedClassName, Record);
15818 uint64_t TypeStorageSize = Context.getTypeSize(FieldTy);
15819 uint64_t TypeWidth = Context.getIntWidth(FieldTy);
15828 (IsMsStruct || Context.getTargetInfo().getCXXABI().isMicrosoft());
15895 T = Context.IntTy;
15896 TInfo = Context.getTrivialTypeSourceInfo(T, Loc);
15992 T = Context.IntTy;
15995 QualType EltTy = Context.getBaseElementType(T);
16049 TryToFixInvalidVariablyModifiedTypeSourceInfo(TInfo, Context,
16079 BitWidth = VerifyBitField(Loc, II, T, Record->isMsStruct(Context), BitWidth,
16115 FieldDecl *NewFD = FieldDecl::Create(Context, Record, TSSL, Loc, II, T, TInfo,
16184 QualType EltTy = Context.getBaseElementType(FD->getType());
16218 FD->addAttr(UnavailableAttr::CreateImplicit(Context, "",
16320 ObjCIvarDecl *NewID = ObjCIvarDecl::Create(Context, EnclosingContext,
16374 if (!Ivar->isBitField() || Ivar->isZeroLengthBitField(Context))
16387 llvm::APInt Zero(Context.getTypeSize(Context.IntTy), 0);
16387 llvm::APInt Zero(Context.getTypeSize(Context.IntTy), 0);
16388 Expr * BW = IntegerLiteral::Create(Context, Zero, Context.IntTy, DeclLoc);
16388 Expr * BW = IntegerLiteral::Create(Context, Zero, Context.IntTy, DeclLoc);
16390 Ivar = ObjCIvarDecl::Create(Context, cast<ObjCContainerDecl>(CurContext),
16392 Context.CharTy,
16393 Context.getTrivialTypeSourceInfo(Context.CharTy,
16393 Context.getTrivialTypeSourceInfo(Context.CharTy,
16414 Context.ResetObjCLayout(cast<ObjCCategoryDecl>(DC)->getClassInterface());
16417 Context.
16525 QualType BaseElem = Context.getBaseElementType(FD->getType());
16582 QualType T = Context.getObjCObjectPointerType(FD->getType());
16589 !Context.hasDirectOwnershipQualifier(FD->getType()))) {
16597 Context, "", UnavailableAttr::IR_ARCFieldWithOwnership,
16605 else if (Context.getAsArrayType(FD->getType())) {
16606 QualType BaseType = Context.getBaseElementType(FD->getType());
16761 if (!I->isZeroLengthBitField(Context))
16767 !Context.getTypeSizeInChars(FieldType).isZero())
16899 unsigned IntWidth = Context.getTargetInfo().getIntWidth();
16911 EltTy = Context.DependentTy;
16937 if (!isRepresentableIntegerValue(Context, EnumVal, EltTy)) {
16938 if (Context.getTargetInfo()
16966 if (!isRepresentableIntegerValue(Context, EnumVal, Context.IntTy))
16966 if (!isRepresentableIntegerValue(Context, EnumVal, Context.IntTy))
16970 else if (!Context.hasSameType(Val->getType(), Context.IntTy)) {
16970 else if (!Context.hasSameType(Val->getType(), Context.IntTy)) {
16972 Val = ImpCastExprToType(Val, Context.IntTy, CK_IntegralCast).get();
16982 EltTy = Context.DependentTy;
16996 EltTy = Context.IntTy;
17016 QualType T = getNextLargerIntegralType(Context, EltTy);
17040 EnumVal = EnumVal.zextOrTrunc(Context.getIntWidth(EltTy));
17051 !isRepresentableIntegerValue(Context, EnumVal, EltTy)) {
17062 EnumVal = EnumVal.extOrTrunc(Context.getIntWidth(EltTy));
17066 return EnumConstantDecl::Create(Context, Enum, IdLoc, Id, EltTy,
17351 QualType EnumType = Context.getTypeDeclType(Enum);
17364 Enum->completeDefinition(Context.DependentTy, Context.DependentTy, 0, 0);
17364 Enum->completeDefinition(Context.DependentTy, Context.DependentTy, 0, 0);
17371 unsigned IntWidth = Context.getTargetInfo().getIntWidth();
17372 unsigned CharWidth = Context.getTargetInfo().getCharWidth();
17373 unsigned ShortWidth = Context.getTargetInfo().getShortWidth();
17400 AllElementsInt = ECD->getType() == Context.IntTy;
17429 BestPromotionType = Context.getPromotedIntegerType(BestType);
17433 BestWidth = Context.getIntWidth(BestType);
17440 BestType = Context.SignedCharTy;
17444 BestType = Context.ShortTy;
17447 BestType = Context.IntTy;
17450 BestWidth = Context.getTargetInfo().getLongWidth();
17453 BestType = Context.LongTy;
17455 BestWidth = Context.getTargetInfo().getLongLongWidth();
17459 BestType = Context.LongLongTy;
17462 BestPromotionType = (BestWidth <= IntWidth ? Context.IntTy : BestType);
17468 BestType = Context.UnsignedCharTy;
17469 BestPromotionType = Context.IntTy;
17472 BestType = Context.UnsignedShortTy;
17473 BestPromotionType = Context.IntTy;
17476 BestType = Context.UnsignedIntTy;
17480 ? Context.UnsignedIntTy : Context.IntTy;
17480 ? Context.UnsignedIntTy : Context.IntTy;
17482 (BestWidth = Context.getTargetInfo().getLongWidth())) {
17483 BestType = Context.UnsignedLongTy;
17486 ? Context.UnsignedLongTy : Context.LongTy;
17486 ? Context.UnsignedLongTy : Context.LongTy;
17488 BestWidth = Context.getTargetInfo().getLongLongWidth();
17491 BestType = Context.UnsignedLongLongTy;
17494 ? Context.UnsignedLongLongTy : Context.LongLongTy;
17494 ? Context.UnsignedLongLongTy : Context.LongLongTy;
17520 isRepresentableIntegerValue(Context, InitVal, Context.IntTy)) {
17520 isRepresentableIntegerValue(Context, InitVal, Context.IntTy)) {
17521 NewTy = Context.IntTy;
17545 !Context.hasSameType(NewTy, ECD->getInitExpr()->getType()))
17546 ECD->setInitExpr(ImplicitCastExpr::Create(Context, NewTy,
17588 FileScopeAsmDecl *New = FileScopeAsmDecl::Create(Context, CurContext,
17605 Context, AliasName->getName(), /*LiteralLabel=*/true, Info);
17628 PrevDecl->addAttr(WeakAttr::CreateImplicit(Context, PragmaLoc, AttributeCommonInfo::AS_Pragma));
tools/clang/lib/Sema/SemaDeclAttr.cpp 246 !Expr->isIntegerConstantExpr(I, S.Context)) {
338 !IdxExpr->isIntegerConstantExpr(IdxInt, S.Context)) {
404 D->addAttr(::new (S.Context) AttrType(S.Context, CI));
404 D->addAttr(::new (S.Context) AttrType(S.Context, CI));
469 Record->lookup(S.Context.DeclarationNames.getCXXOperatorName(Op));
730 D->addAttr(::new (S.Context) PtGuardedVarAttr(S.Context, AL));
730 D->addAttr(::new (S.Context) PtGuardedVarAttr(S.Context, AL));
752 D->addAttr(::new (S.Context) GuardedByAttr(S.Context, AL, Arg));
752 D->addAttr(::new (S.Context) GuardedByAttr(S.Context, AL, Arg));
763 D->addAttr(::new (S.Context) PtGuardedByAttr(S.Context, AL, Arg));
763 D->addAttr(::new (S.Context) PtGuardedByAttr(S.Context, AL, Arg));
792 D->addAttr(::new (S.Context)
793 AcquiredAfterAttr(S.Context, AL, StartArg, Args.size()));
802 D->addAttr(::new (S.Context)
803 AcquiredBeforeAttr(S.Context, AL, StartArg, Args.size()));
822 D->addAttr(::new (S.Context)
823 AssertSharedLockAttr(S.Context, AL, StartArg, Size));
834 D->addAttr(::new (S.Context)
835 AssertExclusiveLockAttr(S.Context, AL, StartArg, Size));
895 D->addAttr(::new (S.Context)
896 AllocSizeAttr(S.Context, AL, SizeArgNo, NumberArgNo));
922 D->addAttr(::new (S.Context) SharedTrylockFunctionAttr(
923 S.Context, AL, AL.getArgAsExpr(0), Args.data(), Args.size()));
932 D->addAttr(::new (S.Context) ExclusiveTrylockFunctionAttr(
933 S.Context, AL, AL.getArgAsExpr(0), Args.data(), Args.size()));
944 D->addAttr(::new (S.Context) LockReturnedAttr(S.Context, AL, Args[0]));
944 D->addAttr(::new (S.Context) LockReturnedAttr(S.Context, AL, Args[0]));
959 D->addAttr(::new (S.Context)
960 LocksExcludedAttr(S.Context, AL, StartArg, Size));
997 D->addAttr(::new (S.Context) EnableIfAttr(S.Context, AL, Cond, Msg));
997 D->addAttr(::new (S.Context) EnableIfAttr(S.Context, AL, Cond, Msg));
1068 D->addAttr(::new (S.Context) DiagnoseIfAttr(
1069 S.Context, AL, Cond, Msg, DiagType, ArgDependent, cast<NamedDecl>(D)));
1101 D->addAttr(::new (S.Context) PassObjectSizeAttr(S.Context, AL, (int)Type));
1101 D->addAttr(::new (S.Context) PassObjectSizeAttr(S.Context, AL, (int)Type));
1121 D->addAttr(::new (S.Context) ConsumableAttr(S.Context, AL, DefaultState));
1121 D->addAttr(::new (S.Context) ConsumableAttr(S.Context, AL, DefaultState));
1171 D->addAttr(::new (S.Context)
1172 CallableWhenAttr(S.Context, AL, States.data(), States.size()));
1206 D->addAttr(::new (S.Context) ParamTypestateAttr(S.Context, AL, ParamState));
1206 D->addAttr(::new (S.Context) ParamTypestateAttr(S.Context, AL, ParamState));
1251 D->addAttr(::new (S.Context) ReturnTypestateAttr(S.Context, AL, ReturnState));
1251 D->addAttr(::new (S.Context) ReturnTypestateAttr(S.Context, AL, ReturnState));
1273 D->addAttr(::new (S.Context) SetTypestateAttr(S.Context, AL, NewState));
1273 D->addAttr(::new (S.Context) SetTypestateAttr(S.Context, AL, NewState));
1295 D->addAttr(::new (S.Context) TestTypestateAttr(S.Context, AL, TestState));
1295 D->addAttr(::new (S.Context) TestTypestateAttr(S.Context, AL, TestState));
1305 TD->addAttr(::new (S.Context) PackedAttr(S.Context, AL));
1305 TD->addAttr(::new (S.Context) PackedAttr(S.Context, AL));
1310 S.Context.getTypeAlign(FD->getType()) <= 8);
1318 FD->addAttr(::new (S.Context) PackedAttr(S.Context, AL));
1318 FD->addAttr(::new (S.Context) PackedAttr(S.Context, AL));
1324 FD->addAttr(::new (S.Context) PackedAttr(S.Context, AL));
1324 FD->addAttr(::new (S.Context) PackedAttr(S.Context, AL));
1361 D->addAttr(::new (S.Context) IBOutletAttr(S.Context, AL));
1361 D->addAttr(::new (S.Context) IBOutletAttr(S.Context, AL));
1380 PT = S.getTypeName(S.Context.Idents.get("NSObject"), AL.getLoc(),
1391 QTLoc = S.Context.getTrivialTypeSourceInfo(QT, AL.getLoc());
1404 D->addAttr(::new (S.Context) IBOutletCollectionAttr(S.Context, AL, QTLoc));
1404 D->addAttr(::new (S.Context) IBOutletCollectionAttr(S.Context, AL, QTLoc));
1487 D->addAttr(::new (S.Context) NonNullAttr(S.Context, AL, Start, Size));
1487 D->addAttr(::new (S.Context) NonNullAttr(S.Context, AL, Start, Size));
1507 D->addAttr(::new (S.Context) NonNullAttr(S.Context, AL, nullptr, 0));
1507 D->addAttr(::new (S.Context) NonNullAttr(S.Context, AL, nullptr, 0));
1517 D->addAttr(::new (S.Context) ReturnsNonNullAttr(S.Context, AL));
1517 D->addAttr(::new (S.Context) ReturnsNonNullAttr(S.Context, AL));
1532 D->addAttr(::new (S.Context) NoEscapeAttr(S.Context, AL));
1532 D->addAttr(::new (S.Context) NoEscapeAttr(S.Context, AL));
1550 AssumeAlignedAttr TmpAttr(Context, CI, E, OE);
1561 if (!E->isIntegerConstantExpr(I, Context)) {
1583 if (!OE->isIntegerConstantExpr(I, Context)) {
1592 D->addAttr(::new (Context) AssumeAlignedAttr(Context, CI, E, OE));
1592 D->addAttr(::new (Context) AssumeAlignedAttr(Context, CI, E, OE));
1599 AllocAlignAttr TmpAttr(Context, CI, ParamIdx());
1616 if (!Ty->isDependentType() && !Ty->isIntegralType(Context)) {
1623 D->addAttr(::new (Context) AllocAlignAttr(Context, CI, Idx));
1623 D->addAttr(::new (Context) AllocAlignAttr(Context, CI, Idx));
1654 OwnershipAttr(S.Context, AL, nullptr, nullptr, 0).getOwnKind();
1735 D->addAttr(::new (S.Context)
1736 OwnershipAttr(S.Context, AL, Module, Start, Size));
1792 D->addAttr(::new (S.Context) AliasAttr(S.Context, AL, Str));
1792 D->addAttr(::new (S.Context) AliasAttr(S.Context, AL, Str));
1794 D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL));
1794 D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL));
1809 D->addAttr(::new (S.Context) IFuncAttr(S.Context, AL, Str));
1809 D->addAttr(::new (S.Context) IFuncAttr(S.Context, AL, Str));
1817 if (S.Context.getTargetInfo().getTriple().isOSDarwin()) {
1821 if (S.Context.getTargetInfo().getTriple().isNVPTX()) {
1843 const DeclarationNameInfo target(&S.Context.Idents.get(Str), AL.getLoc());
1847 ND->markUsed(S.Context);
1850 D->addAttr(::new (S.Context) AliasAttr(S.Context, AL, Str));
1850 D->addAttr(::new (S.Context) AliasAttr(S.Context, AL, Str));
1867 D->addAttr(::new (S.Context) TLSModelAttr(S.Context, AL, Model));
1867 D->addAttr(::new (S.Context) TLSModelAttr(S.Context, AL, Model));
1873 D->addAttr(::new (S.Context) RestrictAttr(S.Context, AL));
1873 D->addAttr(::new (S.Context) RestrictAttr(S.Context, AL));
1905 if (!S.Context.getTargetInfo().validateCPUSpecificCPUDispatch(CPUName)) {
1911 const TargetInfo &Target = S.Context.getTargetInfo();
1924 D->addAttr(::new (S.Context)
1925 CPUSpecificAttr(S.Context, AL, CPUs.data(), CPUs.size()));
1927 D->addAttr(::new (S.Context)
1928 CPUDispatchAttr(S.Context, AL, CPUs.data(), CPUs.size()));
1957 D->addAttr(::new (S.Context) NakedAttr(S.Context, AL));
1957 D->addAttr(::new (S.Context) NakedAttr(S.Context, AL));
1969 D->addAttr(::new (S.Context) NoReturnAttr(S.Context, Attrs));
1969 D->addAttr(::new (S.Context) NoReturnAttr(S.Context, Attrs));
1990 if (!AL.existsInTarget(Context.getTargetInfo())) {
2015 D->addAttr(::new (S.Context) AnalyzerNoReturnAttr(S.Context, AL));
2015 D->addAttr(::new (S.Context) AnalyzerNoReturnAttr(S.Context, AL));
2070 D->addAttr(::new (S.Context) VecReturnAttr(S.Context, AL));
2070 D->addAttr(::new (S.Context) VecReturnAttr(S.Context, AL));
2085 D->addAttr(::new (S.Context) CarriesDependencyAttr(S.Context, AL));
2085 D->addAttr(::new (S.Context) CarriesDependencyAttr(S.Context, AL));
2096 D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL));
2096 D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL));
2105 D->addAttr(::new (S.Context) ConstructorAttr(S.Context, AL, priority));
2105 D->addAttr(::new (S.Context) ConstructorAttr(S.Context, AL, priority));
2114 D->addAttr(::new (S.Context) DestructorAttr(S.Context, AL, priority));
2114 D->addAttr(::new (S.Context) DestructorAttr(S.Context, AL, priority));
2124 D->addAttr(::new (S.Context) AttrTy(S.Context, AL, Str));
2124 D->addAttr(::new (S.Context) AttrTy(S.Context, AL, Str));
2135 D->addAttr(::new (S.Context) ObjCExplicitProtocolImplAttr(S.Context, AL));
2135 D->addAttr(::new (S.Context) ObjCExplicitProtocolImplAttr(S.Context, AL));
2341 auto *Avail = ::new (Context) AvailabilityAttr(
2342 Context, CI, Platform, Introduced, Deprecated, Obsoleted, IsUnavailable,
2397 if (S.Context.getTargetInfo().getTriple().isWatchOS()) {
2400 NewII = &S.Context.Idents.get("watchos");
2402 NewII = &S.Context.Idents.get("watchos_app_extension");
2436 } else if (S.Context.getTargetInfo().getTriple().isTvOS()) {
2441 NewII = &S.Context.Idents.get("tvos");
2443 NewII = &S.Context.Idents.get("tvos_app_extension");
2472 D->addAttr(::new (S.Context) ExternalSourceSymbolAttr(
2473 S.Context, AL, Language, DefinedIn, IsGeneratedDeclaration));
2488 return ::new (S.Context) T(S.Context, CI, value);
2488 return ::new (S.Context) T(S.Context, CI, value);
2537 !S.Context.getTargetInfo().hasProtectedVisibility()) {
2576 D->addAttr(new (S.Context) ObjCMethodFamilyAttr(S.Context, AL, F));
2576 D->addAttr(new (S.Context) ObjCMethodFamilyAttr(S.Context, AL, F));
2603 D->addAttr(::new (S.Context) ObjCNSObjectAttr(S.Context, AL));
2603 D->addAttr(::new (S.Context) ObjCNSObjectAttr(S.Context, AL));
2617 D->addAttr(::new (S.Context) ObjCIndependentClassAttr(S.Context, AL));
2617 D->addAttr(::new (S.Context) ObjCIndependentClassAttr(S.Context, AL));
2634 D->addAttr(::new (S.Context) BlocksAttr(S.Context, AL, type));
2634 D->addAttr(::new (S.Context) BlocksAttr(S.Context, AL, type));
2643 !E->isIntegerConstantExpr(Idx, S.Context)) {
2663 !E->isIntegerConstantExpr(Idx, S.Context)) {
2721 D->addAttr(::new (S.Context) SentinelAttr(S.Context, AL, sentinel, nullPos));
2721 D->addAttr(::new (S.Context) SentinelAttr(S.Context, AL, sentinel, nullPos));
2759 D->addAttr(::new (S.Context) WarnUnusedResultAttr(S.Context, AL, Str));
2759 D->addAttr(::new (S.Context) WarnUnusedResultAttr(S.Context, AL, Str));
2770 (S.Context.getTargetInfo().getTriple().isOSDarwin() &&
2780 D->addAttr(::new (S.Context) WeakImportAttr(S.Context, AL));
2780 D->addAttr(::new (S.Context) WeakImportAttr(S.Context, AL));
2805 D->addAttr(::new (S.Context)
2806 WorkGroupAttr(S.Context, AL, WGSize[0], WGSize[1], WGSize[2]));
2826 D->addAttr(::new (S.Context)
2827 OpenCLIntelReqdSubGroupSizeAttr(S.Context, AL, SGSize));
2848 if (!S.Context.hasSameType(A->getTypeHint(), ParmType)) {
2854 D->addAttr(::new (S.Context) VecTypeHintAttr(S.Context, AL, ParmTSI));
2854 D->addAttr(::new (S.Context) VecTypeHintAttr(S.Context, AL, ParmTSI));
2874 return ::new (Context) SectionAttr(Context, CI, Name);
2874 return ::new (Context) SectionAttr(Context, CI, Name);
2878 std::string Error = Context.getTargetInfo().isValidSectionSpecifier(SecName);
2899 std::string Error = S.Context.getTargetInfo().isValidSectionSpecifier(Str);
2916 S.Context.getTargetInfo().isValidSectionSpecifier(CodeSegName);
2942 return ::new (Context) CodeSegAttr(Context, CI, Name);
2942 return ::new (Context) CodeSegAttr(Context, CI, Name);
2979 !Context.getTargetInfo().isValidCPUName(ParsedAttrs.Architecture))
2989 if (!Context.getTargetInfo().isValidFeatureName(CurFeature))
3004 TargetAttr *NewAttr = ::new (S.Context) TargetAttr(S.Context, AL, Str);
3004 TargetAttr *NewAttr = ::new (S.Context) TargetAttr(S.Context, AL, Str);
3022 D->addAttr(::new (S.Context) MinVectorWidthAttr(S.Context, AL, VecWidth));
3022 D->addAttr(::new (S.Context) MinVectorWidthAttr(S.Context, AL, VecWidth));
3051 if (ULE->getType() == S.Context.OverloadTy)
3068 QualType Ty = S.Context.getPointerType(cast<VarDecl>(D)->getType());
3077 D->addAttr(::new (S.Context) CleanupAttr(S.Context, AL, FD));
3077 D->addAttr(::new (S.Context) CleanupAttr(S.Context, AL, FD));
3096 D->addAttr(::new (S.Context)
3097 EnumExtensibilityAttr(S.Context, AL, ExtensibilityKind));
3111 bool NotNSStringTy = !isNSStringType(Ty, S.Context);
3113 !isCFStringType(Ty, S.Context) &&
3122 if (!isNSStringType(Ty, S.Context) &&
3123 !isCFStringType(Ty, S.Context) &&
3132 D->addAttr(::new (S.Context) FormatArgAttr(S.Context, AL, Idx));
3132 D->addAttr(::new (S.Context) FormatArgAttr(S.Context, AL, Idx));
3179 if (S.Context.getAsArrayType(T))
3180 T = S.Context.getBaseElementType(T);
3200 D->addAttr(::new (S.Context) InitPriorityAttr(S.Context, AL, prioritynum));
3200 D->addAttr(::new (S.Context) InitPriorityAttr(S.Context, AL, prioritynum));
3219 return ::new (Context) FormatAttr(Context, CI, Format, FormatIdx, FirstArg);
3219 return ::new (Context) FormatAttr(Context, CI, Format, FormatIdx, FirstArg);
3241 II = &S.Context.Idents.get(Format);
3285 if (!isCFStringType(Ty, S.Context)) {
3294 if (!isNSStringType(Ty, S.Context)) {
3479 D->addAttr(::new (S.Context) CallbackAttr(
3480 S.Context, AL, EncodingIndices.data(), EncodingIndices.size()));
3523 uint64_t FirstSize = S.Context.getTypeSize(FirstType);
3524 uint64_t FirstAlign = S.Context.getTypeAlign(FirstType);
3534 if (S.Context.getTypeSize(FieldType) != FirstSize ||
3535 S.Context.getTypeAlign(FieldType) > FirstAlign) {
3537 bool isSize = S.Context.getTypeSize(FieldType) != FirstSize;
3538 unsigned FieldBits = isSize? S.Context.getTypeSize(FieldType)
3539 : S.Context.getTypeAlign(FieldType);
3551 RD->addAttr(::new (S.Context) TransparentUnionAttr(S.Context, AL));
3551 RD->addAttr(::new (S.Context) TransparentUnionAttr(S.Context, AL));
3567 D->addAttr(::new (S.Context) AnnotateAttr(S.Context, AL, Str));
3567 D->addAttr(::new (S.Context) AnnotateAttr(S.Context, AL, Str));
3575 AlignValueAttr TmpAttr(Context, CI, E);
3608 D->addAttr(::new (Context) AlignValueAttr(Context, CI, ICE.get()));
3608 D->addAttr(::new (Context) AlignValueAttr(Context, CI, ICE.get()));
3613 D->addAttr(::new (Context) AlignValueAttr(Context, CI, E));
3613 D->addAttr(::new (Context) AlignValueAttr(Context, CI, E));
3624 D->addAttr(::new (S.Context) AlignedAttr(S.Context, AL, true, nullptr));
3624 D->addAttr(::new (S.Context) AlignedAttr(S.Context, AL, true, nullptr));
3643 AlignedAttr TmpAttr(Context, CI, true, E);
3696 AlignedAttr *AA = ::new (Context) AlignedAttr(Context, CI, true, E);
3696 AlignedAttr *AA = ::new (Context) AlignedAttr(Context, CI, true, E);
3728 Context.getTargetInfo().getTriple().isOSBinFormatCOFF() ? 8192
3736 if (Context.getTargetInfo().isTLSSupported()) {
3738 Context.toCharUnitsFromBits(Context.getTargetInfo().getMaxTLSAlign())
3738 Context.toCharUnitsFromBits(Context.getTargetInfo().getMaxTLSAlign())
3749 AlignedAttr *AA = ::new (Context) AlignedAttr(Context, CI, true, ICE.get());
3749 AlignedAttr *AA = ::new (Context) AlignedAttr(Context, CI, true, ICE.get());
3758 AlignedAttr *AA = ::new (Context) AlignedAttr(Context, CI, false, TS);
3758 AlignedAttr *AA = ::new (Context) AlignedAttr(Context, CI, false, TS);
3770 UnderlyingTy = DiagTy = Context.getTagDeclType(cast<TagDecl>(D));
3788 Align = std::max(Align, I->getAlignment(Context));
3792 CharUnits RequestedAlign = Context.toCharUnitsFromBits(Align);
3793 CharUnits NaturalAlign = Context.getTypeAlignInChars(UnderlyingTy);
3870 DestWidth = S.Context.getTargetInfo().getRegisterWidth();
3872 DestWidth = S.Context.getTargetInfo().getCharWidth();
3876 DestWidth = S.Context.getTargetInfo().getPointerWidth(0);
3880 DestWidth = S.Context.getTargetInfo().getUnwindWordWidth();
3955 OldTy = Context.IntTy;
3960 D->addAttr(::new (Context) ModeAttr(Context, CI, Name));
3960 D->addAttr(::new (Context) ModeAttr(Context, CI, Name));
3998 NewElemTy = Context.getIntTypeForBitwidth(DestWidth,
4001 NewElemTy = Context.getRealTypeForBitwidth(DestWidth);
4009 NewElemTy = Context.getComplexType(NewElemTy);
4014 NewTy = Context.getVectorType(NewTy, VectorSize.getZExtValue(),
4022 unsigned NumElements = Context.getTypeSize(OldElemTy) *
4024 Context.getTypeSize(NewElemTy);
4026 Context.getVectorType(NewElemTy, NumElements, OldVT->getVectorKind());
4042 D->addAttr(::new (Context) ModeAttr(Context, CI, Name));
4042 D->addAttr(::new (Context) ModeAttr(Context, CI, Name));
4046 D->addAttr(::new (S.Context) NoDebugAttr(S.Context, AL));
4046 D->addAttr(::new (S.Context) NoDebugAttr(S.Context, AL));
4061 return ::new (Context) AlwaysInlineAttr(Context, CI);
4061 return ::new (Context) AlwaysInlineAttr(Context, CI);
4068 return ::new (Context) CommonAttr(Context, AL);
4068 return ::new (Context) CommonAttr(Context, AL);
4075 return ::new (Context) CommonAttr(Context, AL);
4075 return ::new (Context) CommonAttr(Context, AL);
4099 return ::new (Context) InternalLinkageAttr(Context, AL);
4099 return ::new (Context) InternalLinkageAttr(Context, AL);
4122 return ::new (Context) InternalLinkageAttr(Context, AL);
4122 return ::new (Context) InternalLinkageAttr(Context, AL);
4135 return ::new (Context) MinSizeAttr(Context, CI);
4135 return ::new (Context) MinSizeAttr(Context, CI);
4143 return ::new (Context) NoSpeculativeLoadHardeningAttr(Context, AL);
4143 return ::new (Context) NoSpeculativeLoadHardeningAttr(Context, AL);
4162 return ::new (Context) OptimizeNoneAttr(Context, CI);
4162 return ::new (Context) OptimizeNoneAttr(Context, CI);
4170 return ::new (Context) SpeculativeLoadHardeningAttr(Context, AL);
4170 return ::new (Context) SpeculativeLoadHardeningAttr(Context, AL);
4200 D->addAttr(::new (S.Context) CUDAConstantAttr(S.Context, AL));
4200 D->addAttr(::new (S.Context) CUDAConstantAttr(S.Context, AL));
4218 D->addAttr(::new (S.Context) CUDASharedAttr(S.Context, AL));
4218 D->addAttr(::new (S.Context) CUDASharedAttr(S.Context, AL));
4249 D->addAttr(::new (S.Context) CUDAGlobalAttr(S.Context, AL));
4249 D->addAttr(::new (S.Context) CUDAGlobalAttr(S.Context, AL));
4262 D->addAttr(::new (S.Context) GNUInlineAttr(S.Context, AL));
4262 D->addAttr(::new (S.Context) GNUInlineAttr(S.Context, AL));
4282 D->addAttr(::new (S.Context) FastCallAttr(S.Context, AL));
4282 D->addAttr(::new (S.Context) FastCallAttr(S.Context, AL));
4285 D->addAttr(::new (S.Context) StdCallAttr(S.Context, AL));
4285 D->addAttr(::new (S.Context) StdCallAttr(S.Context, AL));
4288 D->addAttr(::new (S.Context) ThisCallAttr(S.Context, AL));
4288 D->addAttr(::new (S.Context) ThisCallAttr(S.Context, AL));
4291 D->addAttr(::new (S.Context) CDeclAttr(S.Context, AL));
4291 D->addAttr(::new (S.Context) CDeclAttr(S.Context, AL));
4294 D->addAttr(::new (S.Context) PascalAttr(S.Context, AL));
4294 D->addAttr(::new (S.Context) PascalAttr(S.Context, AL));
4297 D->addAttr(::new (S.Context) SwiftCallAttr(S.Context, AL));
4297 D->addAttr(::new (S.Context) SwiftCallAttr(S.Context, AL));
4300 D->addAttr(::new (S.Context) VectorCallAttr(S.Context, AL));
4300 D->addAttr(::new (S.Context) VectorCallAttr(S.Context, AL));
4303 D->addAttr(::new (S.Context) MSABIAttr(S.Context, AL));
4303 D->addAttr(::new (S.Context) MSABIAttr(S.Context, AL));
4306 D->addAttr(::new (S.Context) SysVABIAttr(S.Context, AL));
4306 D->addAttr(::new (S.Context) SysVABIAttr(S.Context, AL));
4309 D->addAttr(::new (S.Context) RegCallAttr(S.Context, AL));
4309 D->addAttr(::new (S.Context) RegCallAttr(S.Context, AL));
4324 D->addAttr(::new (S.Context) PcsAttr(S.Context, AL, PCS));
4324 D->addAttr(::new (S.Context) PcsAttr(S.Context, AL, PCS));
4328 D->addAttr(::new (S.Context) AArch64VectorPcsAttr(S.Context, AL));
4328 D->addAttr(::new (S.Context) AArch64VectorPcsAttr(S.Context, AL));
4331 D->addAttr(::new (S.Context) IntelOclBiccAttr(S.Context, AL));
4331 D->addAttr(::new (S.Context) IntelOclBiccAttr(S.Context, AL));
4334 D->addAttr(::new (S.Context) PreserveMostAttr(S.Context, AL));
4334 D->addAttr(::new (S.Context) PreserveMostAttr(S.Context, AL));
4337 D->addAttr(::new (S.Context) PreserveAllAttr(S.Context, AL));
4337 D->addAttr(::new (S.Context) PreserveAllAttr(S.Context, AL));
4359 D->addAttr(::new (S.Context)
4360 SuppressAttr(S.Context, AL, DiagnosticIdentifiers.data(),
4403 Redecl->addAttr(::new (S.Context) OwnerAttr(S.Context, AL, DerefTypeLoc));
4403 Redecl->addAttr(::new (S.Context) OwnerAttr(S.Context, AL, DerefTypeLoc));
4420 Redecl->addAttr(::new (S.Context)
4421 PointerAttr(S.Context, AL, DerefTypeLoc));
4472 CC = Context.getTargetInfo().getTriple().isOSWindows() ? CC_C :
4476 CC = Context.getTargetInfo().getTriple().isOSWindows() ? CC_X86_64SysV :
4510 const TargetInfo &TI = Context.getTargetInfo();
4516 auto *Aux = Context.getAuxTargetInfo();
4572 CC = Context.getDefaultCallingConvention(IsVariadic, IsCXXMethod);
4637 D->addAttr(::new (Context) SwiftContextAttr(Context, CI));
4637 D->addAttr(::new (Context) SwiftContextAttr(Context, CI));
4645 D->addAttr(::new (Context) SwiftErrorResultAttr(Context, CI));
4645 D->addAttr(::new (Context) SwiftErrorResultAttr(Context, CI));
4653 D->addAttr(::new (Context) SwiftIndirectResultAttr(Context, CI));
4653 D->addAttr(::new (Context) SwiftIndirectResultAttr(Context, CI));
4677 if (Context.getTargetInfo().getRegParmMax() == 0) {
4685 if (numParams > Context.getTargetInfo().getRegParmMax()) {
4687 << Context.getTargetInfo().getRegParmMax() << NumParamsExpr->getSourceRange();
4711 if (!E->isIntegerConstantExpr(I, S.Context)) {
4728 S.Context, S.Context.getConstType(S.Context.IntTy), /*consume*/ false);
4728 S.Context, S.Context.getConstType(S.Context.IntTy), /*consume*/ false);
4728 S.Context, S.Context.getConstType(S.Context.IntTy), /*consume*/ false);
4738 CUDALaunchBoundsAttr TmpAttr(Context, CI, MaxThreads, MinBlocks);
4749 D->addAttr(::new (Context)
4750 CUDALaunchBoundsAttr(Context, CI, MaxThreads, MinBlocks));
4789 D->addAttr(::new (S.Context) ArgumentWithTypeTagAttr(
4790 S.Context, AL, AL.getArgAsIdent(0)->Ident, ArgumentIdx, TypeTagIdx,
4816 D->addAttr(::new (S.Context) TypeTagForDatatypeAttr(
4817 S.Context, AL, PointerKind, MatchingCTypeLoc, AL.getLayoutCompatible(),
4830 D->addAttr(::new (S.Context)
4831 XRayLogArgsAttr(S.Context, AL, ArgCount.getSourceIndex()));
4860 D->addAttr(::new (S.Context) ArmMveAliasAttr(S.Context, AL, Ident));
4860 D->addAttr(::new (S.Context) ArmMveAliasAttr(S.Context, AL, Ident));
5118 D->addAttr(::new (S.Context) ObjCReturnsInnerPointerAttr(S.Context, Attrs));
5118 D->addAttr(::new (S.Context) ObjCReturnsInnerPointerAttr(S.Context, Attrs));
5138 D->addAttr(::new (S.Context) ObjCRequiresSuperAttr(S.Context, Attrs));
5138 D->addAttr(::new (S.Context) ObjCRequiresSuperAttr(S.Context, Attrs));
5164 D->addAttr(::new (S.Context) ObjCBridgeAttr(S.Context, AL, Parm->Ident));
5164 D->addAttr(::new (S.Context) ObjCBridgeAttr(S.Context, AL, Parm->Ident));
5176 D->addAttr(::new (S.Context)
5177 ObjCBridgeMutableAttr(S.Context, AL, Parm->Ident));
5192 D->addAttr(::new (S.Context) ObjCBridgeRelatedAttr(
5193 S.Context, AL, RelatedClass, ClassMethod, InstanceMethod));
5219 D->addAttr(::new (S.Context) ObjCDesignatedInitializerAttr(S.Context, AL));
5219 D->addAttr(::new (S.Context) ObjCDesignatedInitializerAttr(S.Context, AL));
5226 D->addAttr(::new (S.Context)
5227 ObjCRuntimeNameAttr(S.Context, AL, MetaDataName));
5245 ::new (S.Context) ObjCBoxableAttr(S.Context, AL);
5245 ::new (S.Context) ObjCBoxableAttr(S.Context, AL);
5299 D->addAttr(::new (S.Context) ObjCPreciseLifetimeAttr(S.Context, AL));
5299 D->addAttr(::new (S.Context) ObjCPreciseLifetimeAttr(S.Context, AL));
5316 return ::new (Context) UuidAttr(Context, CI, Uuid);
5316 return ::new (Context) UuidAttr(Context, CI, Uuid);
5385 if (!S.Context.getTargetInfo().isTLSSupported()) {
5397 D->addAttr(::new (S.Context) ThreadAttr(S.Context, AL));
5397 D->addAttr(::new (S.Context) ThreadAttr(S.Context, AL));
5427 D->addAttr(::new (S.Context)
5428 AbiTagAttr(S.Context, AL, Tags.data(), Tags.size()));
5453 D->addAttr(::new (S.Context) ARMInterruptAttr(S.Context, AL, Kind));
5453 D->addAttr(::new (S.Context) ARMInterruptAttr(S.Context, AL, Kind));
5489 if (!NumParamsExpr->isIntegerConstantExpr(NumParams, S.Context)) {
5504 D->addAttr(::new (S.Context) MSP430InterruptAttr(S.Context, AL, Num));
5504 D->addAttr(::new (S.Context) MSP430InterruptAttr(S.Context, AL, Num));
5505 D->addAttr(UsedAttr::CreateImplicit(S.Context));
5560 D->addAttr(::new (S.Context) MipsInterruptAttr(S.Context, AL, Kind));
5560 D->addAttr(::new (S.Context) MipsInterruptAttr(S.Context, AL, Kind));
5581 << (S.Context.getTargetInfo().getTriple().getArch() == llvm::Triple::x86
5591 << (S.Context.getTargetInfo().getTriple().getArch() == llvm::Triple::x86
5601 << (S.Context.getTargetInfo().getTriple().getArch() == llvm::Triple::x86
5609 S.Context.getTargetInfo().getTriple().getArch() == llvm::Triple::x86_64
5614 S.Context.getTypeSize(getFunctionOrMethodParamType(D, 1)) != TypeSize)) {
5617 << (S.Context.getTargetInfo().getTriple().getArch() == llvm::Triple::x86
5620 << 3 << S.Context.getIntTypeForBitwidth(TypeSize, /*Signed=*/false);
5623 D->addAttr(::new (S.Context) AnyX86InterruptAttr(S.Context, AL));
5623 D->addAttr(::new (S.Context) AnyX86InterruptAttr(S.Context, AL));
5624 D->addAttr(UsedAttr::CreateImplicit(S.Context));
5671 FD->addAttr(::new (S.Context)
5672 WebAssemblyImportModuleAttr(S.Context, AL, Str));
5693 FD->addAttr(::new (S.Context) WebAssemblyImportNameAttr(S.Context, AL, Str));
5693 FD->addAttr(::new (S.Context) WebAssemblyImportNameAttr(S.Context, AL, Str));
5751 D->addAttr(::new (S.Context) RISCVInterruptAttr(S.Context, AL, Kind));
5751 D->addAttr(::new (S.Context) RISCVInterruptAttr(S.Context, AL, Kind));
5756 switch (S.Context.getTargetInfo().getTriple().getArch()) {
5814 AMDGPUFlatWorkGroupSizeAttr TmpAttr(Context, CI, MinExpr, MaxExpr);
5819 D->addAttr(::new (Context)
5820 AMDGPUFlatWorkGroupSizeAttr(Context, CI, MinExpr, MaxExpr));
5867 AMDGPUWavesPerEUAttr TmpAttr(Context, CI, MinExpr, MaxExpr);
5872 D->addAttr(::new (Context)
5873 AMDGPUWavesPerEUAttr(Context, CI, MinExpr, MaxExpr));
5893 D->addAttr(::new (S.Context) AMDGPUNumSGPRAttr(S.Context, AL, NumSGPR));
5893 D->addAttr(::new (S.Context) AMDGPUNumSGPRAttr(S.Context, AL, NumSGPR));
5902 D->addAttr(::new (S.Context) AMDGPUNumVGPRAttr(S.Context, AL, NumVGPR));
5902 D->addAttr(::new (S.Context) AMDGPUNumVGPRAttr(S.Context, AL, NumVGPR));
5925 D->addAttr(::new (S.Context) X86ForceAlignArgPointerAttr(S.Context, AL));
5925 D->addAttr(::new (S.Context) X86ForceAlignArgPointerAttr(S.Context, AL));
5946 D->addAttr(::new (S.Context) LayoutVersionAttr(S.Context, AL, Version));
5946 D->addAttr(::new (S.Context) LayoutVersionAttr(S.Context, AL, Version));
5959 return ::new (Context) DLLImportAttr(Context, CI);
5959 return ::new (Context) DLLImportAttr(Context, CI);
5972 return ::new (Context) DLLExportAttr(Context, CI);
5972 return ::new (Context) DLLExportAttr(Context, CI);
5977 S.Context.getTargetInfo().getCXXABI().isMicrosoft()) {
5984 !S.Context.getTargetInfo().getCXXABI().isMicrosoft()) {
5993 if (S.Context.getTargetInfo().getCXXABI().isMicrosoft() &&
6039 return ::new (Context) MSInheritanceAttr(Context, CI, BestCase);
6039 return ::new (Context) MSInheritanceAttr(Context, CI, BestCase);
6062 D->addAttr(::new (S.Context) CapabilityAttr(S.Context, AL, N));
6062 D->addAttr(::new (S.Context) CapabilityAttr(S.Context, AL, N));
6070 D->addAttr(::new (S.Context)
6071 AssertCapabilityAttr(S.Context, AL, Args.data(), Args.size()));
6080 D->addAttr(::new (S.Context) AcquireCapabilityAttr(S.Context, AL, Args.data(),
6080 D->addAttr(::new (S.Context) AcquireCapabilityAttr(S.Context, AL, Args.data(),
6090 D->addAttr(::new (S.Context) TryAcquireCapabilityAttr(
6091 S.Context, AL, AL.getArgAsExpr(0), Args.data(), Args.size()));
6100 D->addAttr(::new (S.Context) ReleaseCapabilityAttr(S.Context, AL, Args.data(),
6100 D->addAttr(::new (S.Context) ReleaseCapabilityAttr(S.Context, AL, Args.data(),
6115 RequiresCapabilityAttr *RCA = ::new (S.Context)
6116 RequiresCapabilityAttr(S.Context, AL, Args.data(), Args.size());
6148 D->addAttr(::new (S.Context) DeprecatedAttr(S.Context, AL, Str, Replacement));
6148 D->addAttr(::new (S.Context) DeprecatedAttr(S.Context, AL, Str, Replacement));
6179 D->addAttr(::new (S.Context) NoSanitizeAttr(S.Context, AL, Sanitizers.data(),
6179 D->addAttr(::new (S.Context) NoSanitizeAttr(S.Context, AL, Sanitizers.data(),
6210 D->addAttr(::new (S.Context)
6211 NoSanitizeAttr(S.Context, Info, &SanitizerName, 1));
6308 D->addAttr(::new (S.Context) OpenCLAccessAttr(S.Context, AL));
6308 D->addAttr(::new (S.Context) OpenCLAccessAttr(S.Context, AL));
6327 D->addAttr(::new (S.Context) UninitializedAttr(S.Context, AL));
6327 D->addAttr(::new (S.Context) UninitializedAttr(S.Context, AL));
6461 !AL.existsInTarget(S.Context.getTargetInfo())) {
7383 AliasAttr::CreateImplicit(Context, NDId->getName(), W.getLocation()));
7384 NewD->addAttr(WeakAttr::CreateImplicit(Context, W.getLocation(),
7390 CurContext = Context.getTranslationUnitDecl();
7396 ND->addAttr(WeakAttr::CreateImplicit(Context, W.getLocation(),
7476 if (S.Context.getSourceManager().isInSystemHeader(D->getLocation())) {
7492 D->addAttr(UnavailableAttr::CreateImplicit(S.Context, "", Reason, DD.Loc));
7614 if (const AvailabilityAttr *AA = getAttrForPlatform(S.Context, C))
7816 if (const AvailabilityAttr *AA = getAttrForPlatform(S.Context, OffendingDecl))
7827 const AvailabilityAttr *A = getAttrForPlatform(S.Context, OffendingDecl);
7832 getAttrForPlatform(S.Context, Redecl);
7853 S.Context, S.Context.getTargetInfo().getPlatformMinVersion(),
7853 S.Context, S.Context.getTargetInfo().getPlatformMinVersion(),
7867 << S.Context.getTargetInfo().getPlatformMinVersion().getAsString();
7977 if (auto AL = getAttrForPlatform(S.Context, OffendingDecl))
8216 SemaRef.Context.getTargetInfo().getPlatformMinVersion());
8316 SemaRef.Context,
8317 SemaRef.Context.getTargetInfo().getPlatformMinVersion(), Introduced)
8330 << SemaRef.Context.getTargetInfo()
tools/clang/lib/Sema/SemaDeclCXX.cpp 216 if (ExceptionsSeen.insert(Self->Context.getCanonicalType(E)).second)
264 InitializedEntity Entity = InitializedEntity::InitializeParameter(Context,
365 Param->setDefaultArg(new(Context)
844 auto *BD = BindingDecl::Create(Context, DC, B.NameLoc, B.Name);
927 S.Context.getQualifiedType(VT->getElementType(),
937 S.Context.getQualifiedType(CT->getElementType(),
964 S.Diag(Loc, DiagID) << printTemplateArgs(S.Context.getPrintingPolicy(),
1003 printTemplateArgs(S.Context.getPrintingPolicy(), Args));
1018 TemplateArgument Arg(S.Context, S.Context.MakeIntValue(I, T), T);
1018 TemplateArgument Arg(S.Context, S.Context.MakeIntValue(I, T), T);
1057 << printTemplateArgs(S.Context.getPrintingPolicy(), Args);
1079 getTrivialIntegralTemplateArgument(S, Loc, S.Context.getSizeType(), I));
1093 << printTemplateArgs(S.Context.getPrintingPolicy(), Args);
1099 return S.Context.getTypeDeclType(TD);
1171 E = ImplicitCastExpr::Create(S.Context, E.get()->getType(), CK_NoOp,
1176 getTrivialIntegralTemplateArgument(S, Loc, S.Context.getSizeType(), I));
1192 S.Context, nullptr, NestedNameSpecifierLoc(), SourceLocation(),
1216 S.Context, Src->getDeclContext(), Loc, Loc,
1218 S.Context.getTrivialTypeSourceInfo(T, Loc), Src->getStorageClass());
1284 else if (!S.Context.hasSameType(P.back().Base->getType(),
1298 if (Paths.isAmbiguous(S.Context.getCanonicalType(BaseType))) {
1305 S.CheckBaseClassAccess(Loc, BaseType, S.Context.getRecordType(RD),
1339 QualType BaseType = S.Context.getQualifiedType(S.Context.getRecordType(RD),
1339 QualType BaseType = S.Context.getQualifiedType(S.Context.getRecordType(RD),
1422 B->setType(Context.DependentTy);
1433 if (auto *CAT = Context.getAsConstantArrayType(DecompType)) {
1494 assert(Context.hasSameType(New->getType(), Old->getType()) &&
1594 return !T->isLiteralType(SemaRef.Context);
2440 << BaseType << Context.getTypeDeclType(Class);
2450 return new (Context) CXXBaseSpecifier(SpecifierRange, Virtual,
2469 if (Context.getTargetInfo().getCXXABI().isMicrosoft()) {
2537 return new (Context) CXXBaseSpecifier(SpecifierRange, Virtual,
2640 = Context.getCanonicalType(Bases[idx]->getType());
2653 Context.Deallocate(Bases[idx]);
2663 NoteIndirectBases(Context, IndirectBaseTypes, NewBaseType);
2678 Class->addAttr(WeakAttr::CreateImplicit(Context));
2696 CanQualType CanonicalBase = Context.getCanonicalType(BaseType)
2717 Context.Deallocate(Bases[idx]);
2839 if (!Paths.isAmbiguous(Context.getCanonicalType(Base).getUnqualifiedType()))
2935 PathDisplayStr += Context.getTypeDeclType(Paths.getOrigin()).getAsString();
2954 AccessSpecDecl *ASDecl = AccessSpecDecl::Create(Context, Access, CurContext,
3270 Context.getPrintingPolicy())) {
3416 Member->addAttr(OverrideAttr::Create(Context, VS.getOverrideLoc(),
3420 Context, VS.getFinalLoc(), AttributeCommonInfo::AS_Keyword,
3479 : Inherited(S.Context), S(S), Decls(Decls), BaseClasses(BaseClasses),
3532 bool AllPODFields = FieldME->getType().isPODType(S.Context);
3545 if (!FieldME->getType().isPODType(S.Context))
3933 if (SemaRef.Context.hasSameUnqualifiedType(BaseType, Base.getType())) {
3951 SemaRef.Context.getTypeDeclType(ClassDecl),
3995 Expr *List = ParenListExpr::Create(Context, LParenLoc, Args, RParenLoc);
4132 SS.getWithLocInContext(Context),
4137 TInfo = Context.CreateTypeSourceInfo(BaseType);
4143 TL.setQualifierLoc(SS.getWithLocInContext(Context));
4169 Context.getTypeDeclType(Type),
4197 BaseType = Context.getTypeDeclType(TyD);
4200 BaseType = Context.getElaboratedType(ETK_None, SS.getScopeRep(),
4202 TInfo = Context.CreateTypeSourceInfo(BaseType);
4206 TL.setQualifierLoc(SS.getWithLocInContext(Context));
4212 TInfo = Context.getTrivialTypeSourceInfo(BaseType, IdLoc);
4283 return new (Context) CXXCtorInitializer(Context, DirectMember, IdLoc,
4283 return new (Context) CXXCtorInitializer(Context, DirectMember, IdLoc,
4287 return new (Context) CXXCtorInitializer(Context, IndirectMember, IdLoc,
4287 return new (Context) CXXCtorInitializer(Context, IndirectMember, IdLoc,
4345 return new (Context) CXXCtorInitializer(Context, TInfo, InitRange.getBegin(),
4345 return new (Context) CXXCtorInitializer(Context, TInfo, InitRange.getBegin(),
4391 if (Context.hasSameUnqualifiedType(QualType(ClassDecl->getTypeForDecl(),0),
4412 << BaseType << Context.getTypeDeclType(ClassDecl)
4420 return new (Context) CXXCtorInitializer(Context, BaseTInfo,
4420 return new (Context) CXXCtorInitializer(Context, BaseTInfo,
4447 InitializedEntity::InitializeBase(Context, BaseSpec, VirtualBaseSpec);
4475 return new (Context) CXXCtorInitializer(Context, BaseTInfo,
4475 return new (Context) CXXCtorInitializer(Context, BaseTInfo,
4488 TypeSourceInfo *TargetLoc = SemaRef.Context.getTrivialTypeSourceInfo(
4512 = InitializedEntity::InitializeBase(SemaRef.Context, BaseSpec,
4534 DeclRefExpr::Create(SemaRef.Context, NestedNameSpecifierLoc(),
4543 SemaRef.Context.getQualifiedType(BaseSpec->getType().getUnqualifiedType(),
4571 new (SemaRef.Context) CXXCtorInitializer(SemaRef.Context,
4571 new (SemaRef.Context) CXXCtorInitializer(SemaRef.Context,
4572 SemaRef.Context.getTrivialTypeSourceInfo(BaseSpec->getType(),
4604 if (Field->isZeroLengthBitField(SemaRef.Context))
4608 DeclRefExpr::Create(SemaRef.Context, NestedNameSpecifierLoc(),
4664 CXXMemberInit = new (SemaRef.Context) CXXCtorInitializer(
4665 SemaRef.Context, Indirect, Loc, Loc, MemberInit.getAs<Expr>(), Loc);
4667 CXXMemberInit = new (SemaRef.Context) CXXCtorInitializer(
4668 SemaRef.Context, Field, Loc, Loc, MemberInit.getAs<Expr>(), Loc);
4676 SemaRef.Context.getBaseElementType(Field->getType());
4696 CXXMemberInit = new (SemaRef.Context) CXXCtorInitializer(SemaRef.Context,
4696 CXXMemberInit = new (SemaRef.Context) CXXCtorInitializer(SemaRef.Context,
4702 CXXMemberInit = new (SemaRef.Context) CXXCtorInitializer(SemaRef.Context,
4702 CXXMemberInit = new (SemaRef.Context) CXXCtorInitializer(SemaRef.Context,
4714 << SemaRef.Context.getTagDeclType(Constructor->getParent())
4724 << SemaRef.Context.getTagDeclType(Constructor->getParent())
4735 = new (SemaRef.Context) CXXCtorInitializer(SemaRef.Context, Field,
4735 = new (SemaRef.Context) CXXCtorInitializer(SemaRef.Context, Field,
4737 new (SemaRef.Context) ImplicitValueInitExpr(Field->getType()),
4788 if (Init->getInit()->HasSideEffects(S.Context))
4890 Init = new (SemaRef.Context)
4891 CXXCtorInitializer(SemaRef.Context, Indirect, SourceLocation(),
4894 Init = new (SemaRef.Context)
4895 CXXCtorInitializer(SemaRef.Context, Field, SourceLocation(),
4901 if (isIncompleteOrZeroLengthArrayType(SemaRef.Context, Field->getType()))
4927 new (Context) CXXCtorInitializer*[1];
4951 new (Context) CXXCtorInitializer*[Initializers.size()];
5105 new (Context) CXXCtorInitializer*[NumInitializers];
5172 IdealInitKeys.push_back(GetKeyForBase(SemaRef.Context, VBase.getType()));
5178 IdealInitKeys.push_back(GetKeyForBase(SemaRef.Context, Base.getType()));
5195 const void *InitKey = GetKeyForMember(SemaRef.Context, Init);
5334 const void *Key = GetKeyForMember(Context, Init);
5339 const void *Key = GetKeyForMember(Context, Init);
5386 if (isIncompleteOrZeroLengthArrayType(Context, Field->getType()))
5389 QualType FieldType = Context.getBaseElementType(Field->getType());
5447 Context.getTypeDeclType(ClassDecl));
5477 << Context.getTypeDeclType(ClassDecl) << VBase.getType(),
5478 Context.getTypeDeclType(ClassDecl)) ==
5481 Context.getTypeDeclType(ClassDecl), VBase.getType(),
5506 const auto *RD = Context.getBaseElementType(T)->getAsCXXRecordDecl();
5528 T = Context.getBaseElementType(T);
5595 AbstractType(S.Context.getCanonicalType(
5596 S.Context.getTypeDeclType(Record))),
5678 T = Info.S.Context.getBaseElementType(T);
5764 if (S.Context.getTargetInfo().getTriple().isWindowsGNUEnvironment())
5819 if (!S.Context.getTargetInfo().getCXXABI().isMicrosoft())
5868 if (Context.getTargetInfo().getCXXABI().isMicrosoft() && !ClassAttr) {
5888 if (Context.getTargetInfo().getCXXABI().isMicrosoft() &&
5926 !Context.getTargetInfo().getTriple().isWindowsGNUEnvironment()) {
5953 if (!Context.getTargetInfo().getCXXABI().isMicrosoft() &&
5954 !Context.getTargetInfo().getTriple().isWindowsItaniumEnvironment() &&
6239 bool isAArch64 = S.Context.getTargetInfo().getTriple().isAArch64();
6356 diag::warn_non_virtual_dtor) << Context.getRecordType(Record);
6378 << Context.getRecordType(Record) << FA->isSpelledAsSealed();
6495 if (Record->isMsStruct(Context) &&
6504 Context.getLangOpts().getClangABICompat() <= LangOptions::ClangABI::Ver4;
6506 Context.getTargetInfo().getCallingConvKind(ClangABICompat4);
6520 if (Context.getTargetInfo().getCXXABI().areArgsDestroyedLeftToRightInCallee())
6767 QualType BaseType = S.Context.getBaseElementType(F->getType());
6813 S.Context.getDefaultCallingConvention(/*IsVariadic=*/false,
6905 QualType ReturnType = Context.VoidTy;
6910 QualType DeclType = Context.getTypeDeclType(RD);
6911 DeclType = Context.getAddrSpaceQualType(DeclType, MD->getMethodQualifiers().getAddressSpace());
6912 QualType ExpectedReturnType = Context.getLValueReferenceType(DeclType);
6914 if (!Context.hasSameType(ReturnType, ExpectedReturnType)) {
7013 MD->setType(Context.getFunctionType(ReturnType,
7063 Context.getLValueReferenceType(Context.getRecordType(RD).withConst());
7063 Context.getLValueReferenceType(Context.getRecordType(RD).withConst());
7065 if (!Context.hasSameType(Param->getType(), ExpectedParmType)) {
7087 MD->setType(Context.getFunctionType(FPT->getReturnType(),
7138 !Context.hasSameType(FD->getDeclaredReturnType(), Context.BoolTy)) {
7138 !Context.hasSameType(FD->getDeclaredReturnType(), Context.BoolTy)) {
7140 << (int)DCK << FD->getDeclaredReturnType() << Context.BoolTy
7347 objectTy = S.Context.getTypeDeclType(MD->getParent());
7352 objectTy = S.Context.getTypeDeclType(target->getParent());
7507 QualType FieldType = S.Context.getBaseElementType(FD->getType());
7572 QualType UnionFieldType = S.Context.getBaseElementType(UI->getType());
7723 Context.DeclarationNames.getCXXOperatorName(OO_Delete);
7992 QualType FieldType = S.Context.getBaseElementType(FI->getType());
8035 QualType Ty = Context.getRecordType(RD);
8073 << Context.getLValueReferenceType(
8074 Context.getRecordType(RD).withConst());
8090 << Context.getRValueReferenceType(Context.getRecordType(RD));
8090 << Context.getRValueReferenceType(Context.getRecordType(RD));
8415 else if (Context.getTargetInfo().getCXXABI().isMicrosoft() &&
8677 if (Proto->getReturnType() == Context.VoidTy && !D.isInvalidType())
8684 return Context.getFunctionType(Context.VoidTy, Proto->getParamTypes(), EPI);
8684 return Context.getFunctionType(Context.VoidTy, Proto->getParamTypes(), EPI);
8708 QualType ClassTy = Context.getTagDeclType(ClassDecl);
8709 if (Context.getCanonicalType(ParamType).getUnqualifiedType() == ClassTy) {
8879 return Context.getFunctionType(Context.VoidTy, None, EPI);
8879 return Context.getFunctionType(Context.VoidTy, None, EPI);
9043 ConvType = Context.getPointerType(ConvType);
9047 ConvType = Context.getPointerType(ConvType);
9055 R = Context.getFunctionType(ConvType, None, Proto->getExtProtoInfo());
9076 QualType ConvType = Context.getCanonicalType(Conversion->getConversionType());
9087 = Context.getCanonicalType(Context.getTypeDeclType(ClassDecl));
9087 = Context.getCanonicalType(Context.getTypeDeclType(ClassDecl));
9094 ConvType = Context.getCanonicalType(ConvType).getUnqualifiedType();
9228 Context.hasSameTemplateName(SpecifiedName, GuidedTemplate);
9378 NamespaceDecl *Namespc = NamespaceDecl::Create(Context, CurContext, IsInline,
9425 UD = UsingDirectiveDecl::Create(Context, Parent,
9472 StdBadAlloc.get(Context.getExternalSource()));
9476 return cast_or_null<EnumDecl>(StdAlignValT.get(Context.getExternalSource()));
9481 StdNamespace.get(Context.getExternalSource()));
9538 ComparisonCategoryInfo *Info = Context.CompCategories.lookupInfo(Kind);
9563 NestedNameSpecifier::Create(Context, nullptr, getStdNamespace());
9564 return Context.getElaboratedType(ETK_None, NNS, Info->getType());
9633 StdNamespace = NamespaceDecl::Create(Context,
9634 Context.getTranslationUnitDecl(),
9748 Context.getTrivialTypeSourceInfo(Element,
9750 return Context.getCanonicalType(
9893 UDir = UsingDirectiveDecl::Create(Context, CurContext, UsingLoc, NamespcLoc,
9894 SS.getWithLocInContext(Context),
10115 if (IsEquivalentForUsingDecl(Context, D, Target)) {
10217 Context, CurContext, UD->getLocation(), UD, Orig, IsVirtualBase);
10219 Shadow = UsingShadowDecl::Create(Context, CurContext, UD->getLocation(), UD,
10409 UsingName.setName(Context.DeclarationNames.getCXXConstructorName(
10410 Context.getCanonicalType(Context.getRecordType(RD))));
10410 Context.getCanonicalType(Context.getRecordType(RD))));
10467 NestedNameSpecifierLoc QualifierLoc = SS.getWithLocInContext(Context);
10471 D = UnresolvedUsingTypenameDecl::Create(Context, CurContext,
10477 D = UnresolvedUsingValueDecl::Create(Context, CurContext, UsingLoc,
10487 UsingDecl::Create(Context, CurContext, UsingLoc, QualifierLoc,
10514 Context.getTypeDeclType(cast<CXXRecordDecl>(CurContext)));
10561 Builder.MakeTrivial(Context, Corrected.getCorrectionSpecifier(),
10563 QualifierLoc = Builder.getWithLocInContext(Context);
10569 UsingName.setName(Context.DeclarationNames.getCXXConstructorName(
10570 Context.getCanonicalType(Context.getRecordType(CurClass))));
10570 Context.getCanonicalType(Context.getRecordType(CurClass))));
10657 UsingPackDecl::Create(Context, CurContext, InstantiatedFrom, Expansions);
10756 if (Context.getCanonicalNestedNameSpecifier(Qual) !=
10757 Context.getCanonicalNestedNameSpecifier(DQual))
10985 TInfo = Context.getTrivialTypeSourceInfo(Context.IntTy,
10985 TInfo = Context.getTrivialTypeSourceInfo(Context.IntTy,
11004 TypeAliasDecl *NewTD = TypeAliasDecl::Create(Context, CurContext, UsingLoc,
11067 !Context.hasSameType(OldTD->getUnderlyingType(),
11087 TypeAliasTemplateDecl::Create(Context, CurContext, UsingLoc,
11183 NamespaceAliasDecl::Create(Context, CurContext, NamespaceLoc, AliasLoc,
11184 Alias, SS.getWithLocInContext(Context),
11244 } else if (auto *RT = S.Context.getBaseElementType(FD->getType())
11290 ExplicitSpec.getExpr(), Context.BoolTy, Result, CCEK_ExplicitBool);
11328 S.Context.getRecordType(ClassDecl),
11426 auto QT = Context.getFunctionType(ResultTy, Args, EPI);
11451 = Context.getCanonicalType(Context.getTypeDeclType(ClassDecl));
11451 = Context.getCanonicalType(Context.getTypeDeclType(ClassDecl));
11454 = Context.DeclarationNames.getCXXConstructorName(ClassType);
11457 Context, ClassDecl, ClassLoc, NameInfo, /*Type*/ QualType(),
11471 setupImplicitSpecialMemberType(DefaultCon, Context.VoidTy, None);
11524 Constructor->setBody(new (Context) CompoundStmt(Loc));
11525 Constructor->markUsed(Context);
11564 Context.getTrivialTypeSourceInfo(BaseCtor->getType(), UsingLoc);
11578 Context, Derived, UsingLoc, NameInfo, TInfo->getType(), TInfo,
11591 DerivedCtor->setType(Context.getFunctionType(FPT->getReturnType(),
11598 Context.getTrivialTypeSourceInfo(FPT->getParamType(I), UsingLoc);
11600 Context, DerivedCtor, UsingLoc, UsingLoc, /*IdentifierInfo=*/nullptr,
11683 ExprResult Init = new (Context) CXXInheritedCtorInitExpr(
11686 auto *TInfo = Context.getTrivialTypeSourceInfo(B.getType(), InitLoc);
11687 Inits.push_back(new (Context) CXXCtorInitializer(
11688 Context, TInfo, VBase, InitLoc, Init.get(), InitLoc,
11701 Constructor->setBody(new (Context) CompoundStmt(InitLoc));
11702 Constructor->markUsed(Context);
11728 = Context.getCanonicalType(Context.getTypeDeclType(ClassDecl));
11728 = Context.getCanonicalType(Context.getTypeDeclType(ClassDecl));
11731 = Context.DeclarationNames.getCXXDestructorName(ClassType);
11734 CXXDestructorDecl::Create(Context, ClassDecl, ClassLoc, NameInfo,
11748 setupImplicitSpecialMemberType(Destructor, Context.VoidTy, None);
11811 Destructor->setBody(new (Context) CompoundStmt(Loc));
11812 Destructor->markUsed(Context);
11885 Destructor->setType(Context.getFunctionType(Context.VoidTy, None, EPI));
11885 Destructor->setType(Context.getFunctionType(Context.VoidTy, None, EPI));
12032 QualType SizeType = S.Context.getSizeType();
12033 llvm::APInt Size(S.Context.getTypeSize(SizeType),
12034 S.Context.getTypeSizeInChars(T).getQuantity());
12040 From = new (S.Context) UnaryOperator(From, UO_AddrOf,
12041 S.Context.getPointerType(From->getType()),
12044 To = new (S.Context) UnaryOperator(To, UO_AddrOf,
12045 S.Context.getPointerType(To->getType()),
12057 LookupResult R(S, &S.Context.Idents.get(MemCpyName), Loc,
12067 ExprResult MemCpyRef = S.BuildDeclRefExpr(MemCpy, S.Context.BuiltinFnTy,
12072 To, From, IntegerLiteral::Create(S.Context, Size, SizeType, Loc)
12132 = S.Context.DeclarationNames.getCXXOperatorName(OO_Equal);
12175 const Type *CanonicalT = S.Context.getCanonicalType(T.getTypePtr());
12176 SS.MakeTrivial(S.Context,
12177 NestedNameSpecifier::Create(S.Context, nullptr, false,
12214 const ConstantArrayType *ArrayTy = S.Context.getAsConstantArrayType(T);
12231 QualType SizeType = S.Context.getSizeType();
12239 IterationVarName = &S.Context.Idents.get(OS.str());
12241 VarDecl *IterationVar = VarDecl::Create(S.Context, S.CurContext, Loc, Loc,
12243 S.Context.getTrivialTypeSourceInfo(SizeType, Loc),
12247 llvm::APInt Zero(S.Context.getTypeSize(SizeType), 0);
12248 IterationVar->setInit(IntegerLiteral::Create(S.Context, Zero, SizeType, Loc));
12255 Stmt *InitStmt = new (S.Context) DeclStmt(DeclGroupRef(IterationVar),Loc,Loc);
12279 = ArrayTy->getSize().zextOrTrunc(S.Context.getTypeSize(SizeType));
12281 = new (S.Context) BinaryOperator(IterationVarRefRVal.build(S, Loc),
12282 IntegerLiteral::Create(S.Context, Upper, SizeType, Loc),
12283 BO_NE, S.Context.BoolTy,
12289 Expr *Increment = new (S.Context)
12306 T.isTriviallyCopyableType(S.Context))
12332 QualType ArgType = Context.getTypeDeclType(ClassDecl);
12333 if (Context.getLangOpts().OpenCLCPlusPlus)
12334 ArgType = Context.getAddrSpaceQualType(ArgType, LangAS::opencl_generic);
12335 QualType RetType = Context.getLValueReferenceType(ArgType);
12340 ArgType = Context.getLValueReferenceType(ArgType);
12348 DeclarationName Name = Context.DeclarationNames.getCXXOperatorName(OO_Equal);
12352 Context, ClassDecl, ClassLoc, NameInfo, QualType(),
12370 ParmVarDecl *FromParam = ParmVarDecl::Create(Context, CopyAssignment,
12525 CastBuilder From(OtherRef, Context.getQualifiedType(BaseType, OtherQuals),
12531 Context.getQualifiedType(
12564 << Context.getTagDeclType(ClassDecl) << 0 << Field->getDeclName();
12571 QualType BaseType = Context.getBaseElementType(Field->getType());
12574 << Context.getTagDeclType(ClassDecl) << 1 << Field->getDeclName();
12581 if (Field->isZeroLengthBitField(Context))
12640 CopyAssignOperator->markUsed(Context);
12657 QualType ArgType = Context.getTypeDeclType(ClassDecl);
12658 if (Context.getLangOpts().OpenCLCPlusPlus)
12659 ArgType = Context.getAddrSpaceQualType(ArgType, LangAS::opencl_generic);
12660 QualType RetType = Context.getLValueReferenceType(ArgType);
12661 ArgType = Context.getRValueReferenceType(ArgType);
12669 DeclarationName Name = Context.DeclarationNames.getCXXOperatorName(OO_Equal);
12673 Context, ClassDecl, ClassLoc, NameInfo, QualType(),
12691 MoveAssignment->setType(Context.getFunctionType(RetType, ArgType, EPI));
12694 ParmVarDecl *FromParam = ParmVarDecl::Create(Context, MoveAssignment,
12899 Context.getQualifiedType(
12932 << Context.getTagDeclType(ClassDecl) << 0 << Field->getDeclName();
12939 QualType BaseType = Context.getBaseElementType(Field->getType());
12942 << Context.getTagDeclType(ClassDecl) << 1 << Field->getDeclName();
12949 if (Field->isZeroLengthBitField(Context))
13012 MoveAssignOperator->markUsed(Context);
13030 QualType ClassType = Context.getTypeDeclType(ClassDecl);
13036 if (Context.getLangOpts().OpenCLCPlusPlus)
13037 ArgType = Context.getAddrSpaceQualType(ArgType, LangAS::opencl_generic);
13039 ArgType = Context.getLValueReferenceType(ArgType);
13046 = Context.DeclarationNames.getCXXConstructorName(
13047 Context.getCanonicalType(ClassType));
13054 Context, ClassDecl, ClassLoc, NameInfo, QualType(), /*TInfo=*/nullptr,
13069 setupImplicitSpecialMemberType(CopyConstructor, Context.VoidTy, ArgType);
13072 ParmVarDecl *FromParam = ParmVarDecl::Create(Context, CopyConstructor,
13149 CopyConstructor->markUsed(Context);
13165 QualType ClassType = Context.getTypeDeclType(ClassDecl);
13168 if (Context.getLangOpts().OpenCLCPlusPlus)
13169 ArgType = Context.getAddrSpaceQualType(ClassType, LangAS::opencl_generic);
13170 ArgType = Context.getRValueReferenceType(ArgType);
13177 = Context.DeclarationNames.getCXXConstructorName(
13178 Context.getCanonicalType(ClassType));
13186 Context, ClassDecl, ClassLoc, NameInfo, QualType(), /*TInfo=*/nullptr,
13201 setupImplicitSpecialMemberType(MoveConstructor, Context.VoidTy, ArgType);
13204 ParmVarDecl *FromParam = ParmVarDecl::Create(Context, MoveConstructor,
13274 MoveConstructor->markUsed(Context);
13321 Invoker->markUsed(Context);
13324 Invoker->setBody(new (Context) CompoundStmt(Conv->getLocation()));
13331 Conv->setBody(CompoundStmt::Create(Context, Return, Conv->getLocation(),
13333 Conv->markUsed(Context);
13365 BuildBlock = ImplicitCastExpr::Create(Context, BuildBlock.get()->getType(),
13386 Conv->setBody(CompoundStmt::Create(Context, ReturnS, Conv->getLocation(),
13388 Conv->markUsed(Context);
13442 Context, cast<CXXRecordDecl>(FoundDecl->getDeclContext()));
13499 Context, DeclInitType, ConstructLoc, Constructor, Elidable,
13511 return CXXDefaultInitExpr::Create(Context, Loc, Field, CurContext);
13552 return CXXDefaultInitExpr::Create(Context, Loc, Field, CurContext);
13699 QTy = SemaRef.Context.removeAddrSpaceQualType(QTy);
13700 return SemaRef.Context.getPointerType(QTy);
13726 if (SemaRef.Context.getCanonicalType(ResultType) != ExpectedResultType)
13757 if (SemaRef.Context.getCanonicalType(FirstParamType).getUnqualifiedType() !=
13775 SemaRef.Context.getCanonicalType(SemaRef.Context.getSizeType());
13775 SemaRef.Context.getCanonicalType(SemaRef.Context.getSizeType());
13780 if (CheckOperatorNewDeleteTypes(SemaRef, FnDecl, SemaRef.Context.VoidPtrTy,
13813 ? SemaRef.Context.getCanonicalType(SemaRef.Context.getPointerType(
13813 ? SemaRef.Context.getCanonicalType(SemaRef.Context.getPointerType(
13814 SemaRef.Context.getRecordType(MD->getParent())))
13815 : SemaRef.Context.VoidPtrTy;
13820 SemaRef, FnDecl, SemaRef.Context.VoidTy, ExpectedFirstParamType,
13987 SemaRef.Context.hasSameType(PmDecl->getType(), SemaRef.Context.CharTy))
13987 SemaRef.Context.hasSameType(PmDecl->getType(), SemaRef.Context.CharTy))
14065 Context.hasSameType(ParamType, Context.CharTy) ||
14065 Context.hasSameType(ParamType, Context.CharTy) ||
14066 Context.hasSameType(ParamType, Context.WideCharTy) ||
14066 Context.hasSameType(ParamType, Context.WideCharTy) ||
14067 Context.hasSameType(ParamType, Context.Char8Ty) ||
14067 Context.hasSameType(ParamType, Context.Char8Ty) ||
14068 Context.hasSameType(ParamType, Context.Char16Ty) ||
14068 Context.hasSameType(ParamType, Context.Char16Ty) ||
14069 Context.hasSameType(ParamType, Context.Char32Ty)) {
14069 Context.hasSameType(ParamType, Context.Char32Ty)) {
14074 if (!(Context.hasSameType(InnerType.getUnqualifiedType(),
14075 Context.CharTy) &&
14085 << ParamType << Context.LongDoubleTy << Param->getSourceRange();
14090 << ParamType << Context.UnsignedLongLongTy << Param->getSourceRange();
14131 if (!(Context.hasSameType(InnerType, Context.CharTy) ||
14131 if (!(Context.hasSameType(InnerType, Context.CharTy) ||
14132 Context.hasSameType(InnerType, Context.WideCharTy) ||
14132 Context.hasSameType(InnerType, Context.WideCharTy) ||
14133 Context.hasSameType(InnerType, Context.Char8Ty) ||
14133 Context.hasSameType(InnerType, Context.Char8Ty) ||
14134 Context.hasSameType(InnerType, Context.Char16Ty) ||
14134 Context.hasSameType(InnerType, Context.Char16Ty) ||
14135 Context.hasSameType(InnerType, Context.Char32Ty))) {
14135 Context.hasSameType(InnerType, Context.Char32Ty))) {
14147 if (!Context.hasSameType(SecondParamType, Context.getSizeType())) {
14147 if (!Context.hasSameType(SecondParamType, Context.getSizeType())) {
14150 << SecondParamType << Context.getSizeType()
14220 LinkageSpecDecl *D = LinkageSpecDecl::Create(Context, CurContext, ExternLoc,
14246 Decl *ED = EmptyDecl::Create(Context, CurContext, SemiLoc);
14268 ExDeclType = Context.getArrayDecayedType(ExDeclType);
14270 ExDeclType = Context.getPointerType(ExDeclType);
14326 VarDecl *ExDecl = VarDecl::Create(Context, CurContext, StartLoc, Loc, Name,
14349 QualType initType = Context.getExceptionObjectType(ExDeclType);
14357 new (Context) OpaqueValueExpr(Loc, initType, VK_LValue, OK_Ordinary);
14392 TInfo = Context.getTrivialTypeSourceInfo(Context.IntTy,
14392 TInfo = Context.getTrivialTypeSourceInfo(Context.IntTy,
14510 Decl *Decl = StaticAssertDecl::Create(Context, CurContext, StaticAssertLoc,
14586 return FriendDecl::Create(Context, CurContext,
14656 NestedNameSpecifierLoc QualifierLoc = SS.getWithLocInContext(Context);
14664 TypeSourceInfo *TSI = Context.CreateTypeSourceInfo(T);
14678 FriendDecl *Friend = FriendDecl::Create(Context, CurContext, NameLoc,
14695 QualType T = Context.getDependentNameType(ETK, SS.getScopeRep(), Name);
14696 TypeSourceInfo *TSI = Context.CreateTypeSourceInfo(T);
14699 TL.setQualifierLoc(SS.getWithLocInContext(Context));
14702 FriendDecl *Friend = FriendDecl::Create(Context, CurContext, NameLoc,
14802 D = FriendTemplateDecl::Create(Context, CurContext, Loc,
15090 FriendDecl *FrD = FriendDecl::Create(Context, CurContext,
15360 if (Context.hasSameType(NewTy, OldTy) ||
15394 if (!Context.hasSameUnqualifiedType(NewClassTy, OldClassTy)) {
15625 if (Context.getTargetInfo().getCXXABI().isMicrosoft()) {
15674 const CXXMethodDecl *KeyFunction = Context.getCurrentKeyFunction(Class);
15726 if (Context.getTargetInfo().getCXXABI().hasKeyFunctions() &&
15817 new (Context) CXXCtorInitializer(Context, Field, SourceLocation(),
15817 new (Context) CXXCtorInitializer(Context, Field, SourceLocation(),
15825 Context.getBaseElementType(Field->getType())
15832 << Context.getBaseElementType(Field->getType()));
15836 ObjCImplementation->setIvarInitializers(Context,
16093 Context.BoolTy) &&
16130 Context.adjustExceptionSpec(Method, ESI, /*AsWritten*/true);
16165 T = Context.IntTy;
16166 TInfo = Context.getTrivialTypeSourceInfo(T, Loc);
16213 MSPropertyDecl::Create(Context, Record, Loc, II, T, TInfo, TSSL,
tools/clang/lib/Sema/SemaDeclObjC.cpp 100 method->addAttr(UnavailableAttr::CreateImplicit(Context, "",
163 << Context.getObjCInterfaceType(CurrentClass)
239 if (!Context.hasSameType(method->getReturnType(), Context.VoidTy)) {
239 if (!Context.hasSameType(method->getReturnType(), Context.VoidTy)) {
258 method->addAttr(NSConsumesSelfAttr::CreateImplicit(Context));
277 method->addAttr(NSReturnsRetainedAttr::CreateImplicit(Context));
295 RealizedPlatform = S.Context.getTargetInfo().getPlatformName();
387 MDecl->createImplicitParams(Context, MDecl->getClassInterface());
484 if (Context.getLangOpts().getGC() != LangOptions::NonGC)
579 SuperClassType = Context.getObjCInterfaceType(SuperClassDecl);
591 SuperClassType = Context.getTypeDeclType(TDecl);
656 SuperClassTInfo = Context.getTrivialTypeSourceInfo(SuperClassType,
696 typeBound = Context.getObjCObjectPointerType(typeBound);
702 typeBoundInfo = builder.getTypeSourceInfo(Context, typeBound);
750 Context.getTrivialTypeSourceInfo(typeBound.getUnqualifiedType());
760 typeBoundInfo = Context.getTrivialTypeSourceInfo(Context.getObjCIdType());
760 typeBoundInfo = Context.getTrivialTypeSourceInfo(Context.getObjCIdType());
764 return ObjCTypeParamDecl::Create(Context, CurContext, variance, varianceLoc,
801 return ObjCTypeParamList::create(Context, lAngleLoc, typeParams, rAngleLoc);
914 if (S.Context.hasSameType(prevTypeParam->getUnderlyingType(),
933 S.Context.getPrintingPolicy()));
941 S.Context.getTrivialTypeSourceInfo(prevTypeParam->getUnderlyingType()));
955 S.Context.getPrintingPolicy());
969 S.Context.getTrivialTypeSourceInfo(prevTypeParam->getUnderlyingType()));
1036 Context,
1044 Context.getTrivialTypeSourceInfo(typeParam->getUnderlyingType())));
1047 typeParamList = ObjCTypeParamList::create(Context,
1056 = ObjCInterfaceDecl::Create(Context, CurContext, AtInterfaceLoc, ClassName,
1094 ProtoLocs, Context);
1172 ObjCCompatibleAliasDecl::Create(Context, CurContext, AtLoc, AliasName, CDecl);
1227 PDecl = ObjCProtocolDecl::Create(Context, CurContext, ProtocolName,
1241 PList.set((ObjCProtocolDecl *const*)ProtoRefs, NumProtoRefs, Context);
1247 PDecl = ObjCProtocolDecl::Create(Context, CurContext, ProtocolName,
1267 ProtoLocs, Context);
1496 Context.CollectInheritedProtocols(baseClass, knownProtocols);
1572 type = Context.getTypeDeclType(actualTypeDecl);
1574 type = Context.getObjCInterfaceType(typeDecl.get<ObjCInterfaceDecl *>());
1575 TypeSourceInfo *parsedTSInfo = Context.getTrivialTypeSourceInfo(type, loc);
1578 parsedType, Context.getPrintingPolicy());
1681 ObjCTypeArgOrProtocolValidatorCCC CCC(Context, lookupKind);
1778 = ObjCProtocolDecl::Create(Context, CurContext, Ident,
1810 || RequireCompleteType(ClassLoc, Context.getObjCInterfaceType(IDecl),
1816 CDecl = ObjCCategoryDecl::Create(Context, CurContext, AtInterfaceLoc,
1863 CDecl = ObjCCategoryDecl::Create(Context, CurContext, AtInterfaceLoc,
1879 ProtoLocs, Context);
1883 NumProtoRefs, Context);
1905 CatIDecl = ObjCCategoryDecl::Create(Context, CurContext, AtCatImplLoc,
1914 ObjCCategoryImplDecl::Create(Context, CurContext, CatName, IDecl,
1920 } else if (RequireCompleteType(ClassLoc, Context.getObjCInterfaceType(IDecl),
1976 RequireCompleteType(ClassLoc, Context.getObjCInterfaceType(IDecl),
2030 IDecl = ObjCInterfaceDecl::Create(Context, CurContext, AtClassImplLoc,
2037 IDecl->setSuperClass(Context.getTrivialTypeSourceInfo(
2038 Context.getObjCInterfaceType(SDecl),
2055 ObjCImplementationDecl::Create(Context, CurContext, IDecl, SDecl,
2176 if (!Context.hasSameType(ImplIvar->getType(), ClsIvar->getType())) {
2182 ImplIvar->getBitWidthValue(Context) !=
2183 ClsIvar->getBitWidthValue(Context)) {
2332 !S.Context.hasSameNullabilityTypeQualifier(MethodImpl->getReturnType(),
2336 *MethodImpl->getReturnType()->getNullability(S.Context);
2338 *MethodDecl->getReturnType()->getNullability(S.Context);
2352 if (S.Context.hasSameUnqualifiedType(MethodImpl->getReturnType(),
2372 if (isObjCTypeSubstitutable(S.Context, IfacePtrTy, ImplPtrTy, false))
2424 !S.Context.hasSameNullabilityTypeQualifier(ImplTy, IfaceTy, true)) {
2428 *ImplTy->getNullability(S.Context),
2432 *IfaceTy->getNullability(S.Context),
2437 if (S.Context.hasSameUnqualifiedType(ImplTy, IfaceTy))
2456 if (isObjCTypeSubstitutable(S.Context, ImplPtrTy, IfacePtrTy, true))
2629 MethodDecl->getSelector() == GetNullarySelector("load", Context));
2721 IdentifierInfo* II = &S.Context.Idents.get("forwardInvocation");
2722 Selector fISelector = S.Context.Selectors.getSelector(1, &II);
2726 NSIDecl = IDecl->lookupInheritedClass(&S.Context.Idents.get("NSProxy"));
3112 = ObjCInterfaceDecl::Create(Context, CurContext, AtClassLoc,
3228 if (!matchTypes(Context, strategy, left->getReturnType(),
3251 if (!matchTypes(Context, strategy, lparm->getType(), rparm->getType()))
3929 if (!Context.getSourceManager().isInSystemHeader(
3953 if (!Context.getSourceManager().isInSystemHeader(
4396 QualType T1 = Context.getCanonicalType((*ParamI)->getType());
4397 QualType T2 = Context.getCanonicalType((*PrevI)->getType());
4400 if (!Context.typesAreCompatible(T1, T2)) {
4422 auto nullability = type->getNullability(S.Context);
4423 auto prevNullability = prevType->getNullability(S.Context);
4447 return S.Context.getAttributedType(
4463 ObjCRequiresSuperAttr::CreateImplicit(S.Context,
4567 HasRelatedResultType = (bareResultType == Context.getObjCInstanceType());
4569 resultDeclType = Context.getObjCIdType();
4575 Context, MethodLoc, EndLoc, Sel, resultDeclType, ReturnTInfo, CurContext,
4590 ArgType = Context.getObjCIdType();
4642 ArgType = Context.getObjCIdType();
4645 ArgType = Context.getAdjustedParameterType(ArgType);
4651 ObjCMethod->setMethodParams(Context, Params, SelectorLocs);
4772 Context.getTargetInfo().getTriple().getArch() == llvm::Triple::x86)
4826 Context.DeepCollectObjCIvars(Class, true, Ivars);
4831 Decl *FD = ObjCAtDefsFieldDecl::Create(Context, Record,
4884 VarDecl *New = VarDecl::Create(Context, CurContext, StartLoc, IdLoc, Id,
4959 QualType QT = Context.getBaseElementType(Iv->getType());
4978 !Context.AnyObjCImplementation())
tools/clang/lib/Sema/SemaExceptionSpec.cpp 66 if (!Context.getSourceManager().isInSystemHeader(D.getBeginLoc()))
115 T = Context.getArrayDecayedType(T);
117 T = Context.getPointerType(T);
229 Context.adjustExceptionSpec(Redecl, ESI);
337 Context.getSourceManager().isInSystemHeader(Old->getLocation()) ||
340 New->setType(Context.getFunctionType(
368 New->setType(Context.getFunctionType(
565 Old->getNoexceptExpr()->Profile(OldFSN, S.Context, true);
566 New->getNoexceptExpr()->Profile(NewFSN, S.Context, true);
579 OldTypes.insert(S.Context.getCanonicalType(I).getUnqualifiedType());
582 CanQualType TypePtr = S.Context.getCanonicalType(I).getUnqualifiedType();
667 if (Context.hasSameUnqualifiedType(ExceptionType, HandlerType))
701 ExceptionType = Context.getUnqualifiedArrayType(
703 HandlerType = Context.getUnqualifiedArrayType(
721 Paths.isAmbiguous(Context.getCanonicalType(HandlerType)))
1064 if (Op->Classify(S.Context).isPRValue())
tools/clang/lib/Sema/SemaExpr.cpp 405 if (Context.isSentinelNullExpr(sentinelExpr)) return;
457 E = ImpCastExprToType(E, Context.getPointerType(Ty),
472 E = ImpCastExprToType(E, Context.getArrayDecayedType(Ty),
487 isNullPointerConstant(S.Context, Expr::NPC_ValueDependentIsNotNull) &&
522 &S.Context.Idents.get("object_setClass"),
538 &S.Context.Idents.get("object_getClass"),
573 (E->getType() == Context.OverloadTy ||
597 &Context.Idents.get("object_getClass"),
625 Context.getTargetInfo().getCXXABI().isMicrosoft())
641 Res = ImplicitCastExpr::Create(Context, T, CK, E, nullptr, VK_RValue);
648 Res = ImplicitCastExpr::Create(Context, T, CK_AtomicToNonAtomic, Res.get(),
673 Res = ImpCastExprToType(E, Context.getPointerType(Ty),
701 return ImpCastExprToType(Res.get(), Context.FloatTy, CK_FloatingCast);
720 QualType PTy = Context.isPromotableBitField(E);
726 QualType PT = Context.getPromotedIntegerType(Ty);
757 E = ImpCastExprToType(E, Context.FloatTy, CK_FloatingCast).get();
760 E = ImpCastExprToType(E, Context.DoubleTy, CK_FloatingCast).get();
811 if (Ty.isCXX98PODType(Context))
996 int Order = S.Context.getFloatingTypeOrder(LHSType, RHSType);
1005 QualType ResultType = S.Context.getComplexType(LHSElementType);
1008 ResultType = S.Context.getComplexType(RHSElementType);
1042 QualType result = S.Context.getComplexType(FloatTy);
1068 int order = S.Context.getFloatingTypeOrder(LHSType, RHSType);
1083 LHSType = S.Context.FloatTy;
1104 S.Context.getFloatingTypeOrder(LHSType, RHSType) == 0)
1119 if (&S.Context.getFloatTypeSemantics(LHSElemType) ==
1120 &S.Context.getFloatTypeSemantics(RHSElemType))
1123 bool Float128AndLongDouble = (LHSElemType == S.Context.Float128Ty &&
1124 RHSElemType == S.Context.LongDoubleTy);
1125 Float128AndLongDouble |= (LHSElemType == S.Context.LongDoubleTy &&
1126 RHSElemType == S.Context.Float128Ty);
1132 (&S.Context.getFloatTypeSemantics(S.Context.LongDoubleTy) ==
1132 (&S.Context.getFloatTypeSemantics(S.Context.LongDoubleTy) ==
1146 return S.ImpCastExprToType(op, S.Context.getComplexType(toType),
1158 int order = S.Context.getIntegerTypeOrder(LHSType, RHSType);
1178 } else if (S.Context.getIntWidth(LHSType) != S.Context.getIntWidth(RHSType)) {
1178 } else if (S.Context.getIntWidth(LHSType) != S.Context.getIntWidth(RHSType)) {
1194 S.Context.getCorrespondingUnsignedType(LHSSigned ? LHSType : RHSType);
1218 return S.Context.getComplexType(ScalarType);
1226 QualType ComplexType = S.Context.getComplexType(ScalarType);
1239 QualType ComplexType = S.Context.getComplexType(ScalarType);
1311 LHSTy = S.Context.getCorrespondingSignedFixedPointType(LHSTy);
1313 RHSTy = S.Context.getCorrespondingSignedFixedPointType(RHSTy);
1329 ResultTy = S.Context.getCorrespondingSaturatedType(ResultTy);
1353 Context.getCanonicalType(LHS.get()->getType()).getUnqualifiedType();
1355 Context.getCanonicalType(RHS.get()->getType()).getUnqualifiedType();
1373 LHSType = Context.getPromotedIntegerType(LHSType);
1374 QualType LHSBitfieldPromoteTy = Context.isPromotableBitField(LHS.get());
1469 ControllingExpr->HasSideEffects(Context, false))
1510 Context.typesAreCompatible(Types[i]->getType(),
1532 return GenericSelectionExpr::Create(Context, KeyLoc, ControllingExpr, Types,
1541 else if (Context.typesAreCompatible(ControllingExpr->getType(),
1586 Context, KeyLoc, ControllingExpr, Types, Exprs, DefaultLoc, RParenLoc,
1611 ArgTy[ArgIdx] = S.Context.getArrayDecayedType(ArgTy[ArgIdx]);
1615 S.Context.DeclarationNames.getCXXLiteralOperatorName(UDSuffix);
1647 QualType CharTy = Context.CharTy;
1650 CharTy = Context.getWideCharType();
1654 CharTy = Context.Char8Ty;
1657 CharTy = Context.Char16Ty;
1660 CharTy = Context.Char32Ty;
1663 CharTy = Context.UnsignedCharTy;
1692 Context.getStringLiteralArrayType(CharTy, Literal.GetNumStringChars());
1695 StringLiteral *Lit = StringLiteral::Create(Context, Literal.GetString(),
1703 IdentifierInfo *UDSuffix = &Context.Idents.get(Literal.getUDSuffix());
1714 QualType SizeType = Context.getSizeType();
1717 Context.DeclarationNames.getCXXLiteralOperatorName(UDSuffix);
1722 Context.getArrayDecayedType(StrTy), SizeType
1732 llvm::APInt Len(Context.getIntWidth(SizeType), Literal.GetNumStringChars());
1733 IntegerLiteral *LenArg = IntegerLiteral::Create(Context, Len, SizeType,
1743 unsigned CharBits = Context.getIntWidth(CharTy);
1748 TemplateArgumentLocInfo TypeArgInfo(Context.getTrivialTypeSourceInfo(CharTy));
1753 TemplateArgument Arg(Context, Value, CharTy);
1785 SS ? SS->getWithLocInContext(Context) : NestedNameSpecifierLoc();
1802 VD->isUsableInConstantExpressions(Context))
1824 Context, NNS, TemplateKWLoc, D, RefersToCapturedVariable, NameInfo, Ty,
1876 NameInfo = Context.getNameForTemplate(TName, TNameLoc);
2275 if (Expr *E = recoverFromMSUnqualifiedLookup(*this, Context, NameInfo,
2459 QualType Ty = Context.getTypeDeclType(TD);
2466 QTL.setQualifierLoc(SS.getWithLocInContext(Context));
2468 *RecoveryTSI = TLB.getTypeSourceInfo(Context, ET);
2584 IdentifierInfo &II = Context.Idents.get("self");
2608 ObjCIvarRefExpr *Result = new (Context)
2678 DestRecordType = Context.getCanonicalType(Context.getTypeDeclType(RD));
2678 DestRecordType = Context.getCanonicalType(Context.getTypeDeclType(RD));
2680 DestRecordType = Context.getAddrSpaceQualType(
2686 DestType = Context.getPointerType(DestRecordType);
2716 if (Context.hasSameUnqualifiedType(FromRecordType, DestRecordType))
2758 QType = Context.getPointerType(QType);
2767 if (Context.hasSameUnqualifiedType(FromRecordType, DestRecordType))
2781 QualType URecordType = Context.getTypeDeclType(
2786 if (!Context.hasSameUnqualifiedType(FromRecordType, URecordType)) {
2795 UType = Context.getPointerType(UType);
2931 = UnresolvedLookupExpr::Create(Context, R.getNamingClass(),
2932 SS.getWithLocInContext(Context),
3109 if (!Context.BuiltinInfo.isPredefinedLibFunction(BID)) {
3110 type = Context.BuiltinFnTy;
3120 if (fty->getReturnType() == Context.UnknownAnyTy) {
3121 type = Context.UnknownAnyTy;
3139 type = Context.getFunctionNoProtoType(fty->getReturnType(),
3160 if (proto->getReturnType() == Context.UnknownAnyTy) {
3161 type = Context.UnknownAnyTy;
3213 currentDecl = Context.getTranslationUnitDecl();
3219 ResTy = Context.DependentTy;
3229 Context.adjustStringLiteralBaseType(Context.WideCharTy.withConst());
3229 Context.adjustStringLiteralBaseType(Context.WideCharTy.withConst());
3231 ConvertUTF8ToWideString(Context.getTypeSizeInChars(ResTy).getQuantity(),
3233 ResTy = Context.getConstantArrayType(ResTy, LengthI, nullptr,
3236 SL = StringLiteral::Create(Context, RawChars, StringLiteral::Wide,
3239 ResTy = Context.adjustStringLiteralBaseType(Context.CharTy.withConst());
3239 ResTy = Context.adjustStringLiteralBaseType(Context.CharTy.withConst());
3240 ResTy = Context.getConstantArrayType(ResTy, LengthI, nullptr,
3243 SL = StringLiteral::Create(Context, Str, StringLiteral::Ascii,
3248 return PredefinedExpr::Create(Context, Loc, ResTy, IK, SL);
3282 Ty = Context.WideCharTy; // L'x' -> wchar_t in C and C++.
3284 Ty = Context.Char8Ty; // u8'x' -> char8_t when it exists.
3286 Ty = Context.Char16Ty; // u'x' -> char16_t in C11 and C++11.
3288 Ty = Context.Char32Ty; // U'x' -> char32_t in C11 and C++11.
3290 Ty = Context.IntTy; // 'x' -> int in C, 'wxyz' -> int in C++.
3292 Ty = Context.CharTy; // 'x' -> char in C++
3304 Expr *Lit = new (Context) CharacterLiteral(Literal.getValue(), Kind, Ty,
3311 IdentifierInfo *UDSuffix = &Context.Idents.get(Literal.getUDSuffix());
3326 unsigned IntSize = Context.getTargetInfo().getIntWidth();
3327 return IntegerLiteral::Create(Context, llvm::APInt(IntSize, Val),
3328 Context.IntTy, Loc);
3333 const llvm::fltSemantics &Format = S.Context.getFloatTypeSemantics(Ty);
3360 return FloatingLiteral::Create(S.Context, Val, isExact, Ty, Loc);
3418 IdentifierInfo *UDSuffix = &Context.Idents.get(Literal.getUDSuffix());
3431 CookedTy = Context.LongDoubleTy;
3436 CookedTy = Context.UnsignedLongLongTy;
3440 Context.DeclarationNames.getCXXLiteralOperatorName(UDSuffix);
3464 llvm::APInt ResultVal(Context.getTargetInfo().getLongLongWidth(), 0);
3468 Lit = IntegerLiteral::Create(Context, ResultVal, CookedTy,
3479 QualType StrTy = Context.getConstantArrayType(
3480 Context.adjustStringLiteralBaseType(Context.CharTy.withConst()),
3480 Context.adjustStringLiteralBaseType(Context.CharTy.withConst()),
3483 Context, StringRef(TokSpelling.data(), Length), StringLiteral::Ascii,
3494 unsigned CharBits = Context.getIntWidth(Context.CharTy);
3494 unsigned CharBits = Context.getIntWidth(Context.CharTy);
3495 bool CharIsUnsigned = Context.CharTy->isUnsignedIntegerType();
3499 TemplateArgument Arg(Context, Value, Context.CharTy);
3499 TemplateArgument Arg(Context, Value, Context.CharTy);
3518 Ty = Context.ShortAccumTy;
3520 Ty = Context.LongAccumTy;
3522 Ty = Context.AccumTy;
3526 Ty = Context.ShortFractTy;
3528 Ty = Context.LongFractTy;
3530 Ty = Context.FractTy;
3534 if (Literal.isUnsigned) Ty = Context.getCorrespondingUnsignedType(Ty);
3537 unsigned scale = Context.getFixedPointScale(Ty);
3538 unsigned bit_width = Context.getTypeInfo(Ty).Width;
3544 auto MaxVal = Context.getFixedPointMax(Ty).getValue();
3554 Res = FixedPointLiteral::CreateFromRawInt(Context, Val, Ty,
3560 Ty = Context.HalfTy;
3566 Ty = Context.FloatTy;
3568 Ty = Context.LongDoubleTy;
3570 Ty = Context.Float16Ty;
3572 Ty = Context.Float128Ty;
3574 Ty = Context.DoubleTy;
3578 if (Ty == Context.DoubleTy) {
3582 Res = ImpCastExprToType(Res, Context.FloatTy, CK_FloatingCast).get();
3588 Res = ImpCastExprToType(Res, Context.FloatTy, CK_FloatingCast).get();
3607 unsigned MaxWidth = Context.getTargetInfo().getIntMaxTWidth();
3614 Ty = Context.UnsignedLongLongTy;
3615 assert(Context.getTypeSize(Ty) == ResultVal.getBitWidth() &&
3632 Ty = Context.CharTy;
3635 Ty = Context.getIntTypeForBitwidth(Width,
3642 unsigned IntSize = Context.getTargetInfo().getIntWidth();
3648 Ty = Context.IntTy;
3650 Ty = Context.UnsignedIntTy;
3657 unsigned LongSize = Context.getTargetInfo().getLongWidth();
3663 Ty = Context.LongTy;
3665 Ty = Context.UnsignedLongTy;
3670 Context.getTargetInfo().getLongLongWidth();
3680 Ty = Context.UnsignedLongTy;
3688 unsigned LongLongSize = Context.getTargetInfo().getLongLongWidth();
3697 Ty = Context.LongLongTy;
3699 Ty = Context.UnsignedLongLongTy;
3708 Ty = Context.UnsignedLongLongTy;
3709 Width = Context.getTargetInfo().getLongLongWidth();
3715 Res = IntegerLiteral::Create(Context, ResultVal, Ty, Tok.getLocation());
3720 Res = new (Context) ImaginaryLiteral(Res,
3721 Context.getComplexType(Res->getType()));
3730 return new (Context) ParenExpr(L, R, E);
3852 Context.getBaseElementType(E->getType()),
3875 E->HasSideEffects(Context, false))
3945 ExprType = Context.getBaseElementType(ExprType);
4176 captureVariablyModifiedType(Context, T, CSI);
4183 return new (Context) UnaryExprOrTypeTraitExpr(
4184 ExprKind, TInfo, Context.getSizeType(), OpLoc, R.getEnd());
4226 return new (Context) UnaryExprOrTypeTraitExpr(
4227 ExprKind, E, Context.getSizeType(), OpLoc, E->getSourceRange().getEnd());
4254 return S.Context.DependentTy;
4377 return new (Context) ArraySubscriptExpr(base, idx, Context.DependentTy,
4377 return new (Context) ArraySubscriptExpr(base, idx, Context.DependentTy,
4392 return new (Context) MSPropertySubscriptExpr(
4393 base, idx, Context.PseudoObjectTy, VK_LValue, OK_Ordinary, rbLoc);
4500 return new (Context)
4501 OMPArraySectionExpr(Base, LowerBound, Length, Context.DependentTy,
4563 if (LowerBound->EvaluateAsInt(Result, Context)) {
4577 if (Length->EvaluateAsInt(Result, Context)) {
4606 return new (Context)
4607 OMPArraySectionExpr(Base, LowerBound, Length, Context.OMPArraySectionTy,
4653 ResultType = Context.DependentTy;
4706 ResultType = Context.getQualifiedType(ResultType, Combined);
4715 LHSExp = ImpCastExprToType(LHSExp, Context.getArrayDecayedType(LHSTy),
4726 RHSExp = ImpCastExprToType(RHSExp, Context.getArrayDecayedType(RHSTy),
4794 Context, LHSExp->IgnoreParenImpCasts()->getType(), CSI);
4800 return new (Context)
4869 = InitializedEntity::InitializeParameter(Context, Param);
4933 return CXXDefaultArgExpr::Create(Context, CallLoc, Param, CurContext);
4948 } else if (Fn && Fn->getType() == Context.BoundMemberTy)
5035 if (Context.BuiltinInfo.hasCustomTypechecking(ID))
5166 if (Arg->getType() == Context.ARCUnbridgedCastTy &&
5176 if (auto *BE = dyn_cast<BlockExpr>(Arg->IgnoreParenNoopCasts(Context)))
5180 Param ? InitializedEntity::InitializeParameter(Context, Param,
5183 Context, ProtoArgType, Proto->isParamConsumed(i));
5220 if (Proto->getReturnType() == Context.UnknownAnyTy && FDecl &&
5272 const ArrayType *AT = Context.getAsArrayType(OrigTy);
5276 if (ArgExpr->isNullPointerConstant(Context,
5288 Context.getAsConstantArrayType(ArgExpr->IgnoreParenCasts()->getType());
5631 return CallExpr::Create(Context, Fn, /*Args=*/{}, Context.VoidTy,
5631 return CallExpr::Create(Context, Fn, /*Args=*/{}, Context.VoidTy,
5634 if (Fn->getType() == Context.PseudoObjectTy) {
5645 Context, Fn, cast<CallExpr>(ExecConfig), ArgExprs,
5646 Context.DependentTy, VK_RValue, RParenLoc);
5653 return CallExpr::Create(Context, Fn, ArgExprs, Context.DependentTy,
5653 return CallExpr::Create(Context, Fn, ArgExprs, Context.DependentTy,
5663 if (Fn->getType() == Context.UnknownAnyTy) {
5669 if (Fn->getType() == Context.BoundMemberTy) {
5676 if (Fn->getType() == Context.OverloadTy) {
5682 return CallExpr::Create(Context, Fn, ArgExprs, Context.DependentTy,
5682 return CallExpr::Create(Context, Fn, ArgExprs, Context.DependentTy,
5695 if (Fn->getType() == Context.UnknownAnyTy) {
5721 rewriteBuiltinFunctionDecl(this, Context, FDecl, ArgExprs))) {
5724 Context, FDecl->getQualifierLoc(), SourceLocation(), FDecl, false,
5758 if (Context.getTypeSize(DstTy) != Context.getTypeSize(SrcTy))
5758 if (Context.getTypeSize(DstTy) != Context.getTypeSize(SrcTy))
5764 return new (Context) AsTypeExpr(E, DstTy, VK, OK, BuiltinLoc, RParenLoc);
5806 bool VFP = Context.getTargetInfo().hasFeature("vfp");
5822 QualType FnPtrTy = Context.getPointerType(FDecl->getType());
5827 ResultTy = Context.BoolTy;
5837 if (!BuiltinID || !Context.BuiltinInfo.hasCustomTypechecking(BuiltinID)) {
5851 if (Fn->getType() == Context.UnknownAnyTy) {
5875 CUDAKernelCallExpr::Create(Context, Fn, cast<CallExpr>(Config), Args,
5878 TheCall = CallExpr::Create(Context, Fn, Args, ResultTy, VK_RValue,
5905 Context, Fn, cast<CallExpr>(Config), Args, ResultTy, VK_RValue,
5908 TheCall = CallExpr::Create(Context, Fn, Args, ResultTy, VK_RValue,
5916 if (BuiltinID && Context.BuiltinInfo.hasCustomTypechecking(BuiltinID))
5946 TheCall->setType(FuncT->getCallResultType(Context));
5979 Context, Proto->getParamType(i), Proto->isParamConsumed(i));
6042 TInfo = Context.getTrivialTypeSourceInfo(literalType);
6053 if (RequireCompleteType(LParenLoc, Context.getBaseElementType(literalType),
6109 ILE->setInit(i, ConstantExpr::Create(Context, Init));
6112 auto *E = new (Context) CompoundLiteralExpr(LParenLoc, TInfo, literalType,
6234 InitListExpr *E = new (Context) InitListExpr(Context, LBraceLoc, InitArgList,
6234 InitListExpr *E = new (Context) InitListExpr(Context, LBraceLoc, InitArgList,
6236 E->setType(Context.VoidTy); // FIXME: just a place holder for now.
6248 E = ImplicitCastExpr::Create(Context, E.get()->getType(),
6277 if (Context.hasSameUnqualifiedType(SrcTy, DestTy))
6293 if (Context.hasCvrSimilarType(SrcTy, DestTy))
6349 if (Src.get()->isNullPointerConstant(Context,
6416 if (Context.hasSameType(ET, DestTy))
6450 if (Context.hasSameType(ET, DestTy))
6525 uint64_t srcEltSize = Context.getTypeSize(srcEltTy);
6526 uint64_t destEltSize = Context.getTypeSize(destEltTy);
6536 switch (Context.getLangOpts().getLaxVectorConversions()) {
6565 if (Ty->isVectorType() || Ty->isIntegralType(Context)) {
6597 ExprResult CastExprRes = ImpCastExprToType(SplattedExpr, Context.IntTy,
6627 !Context.hasSameUnqualifiedType(DestTy, SrcTy))) {
6797 InitListExpr *initE = new (Context) InitListExpr(Context, LiteralLParenLoc,
6797 InitListExpr *initE = new (Context) InitListExpr(Context, LiteralLParenLoc,
6825 return ParenListExpr::Create(Context, L, Val, R);
6836 NullExpr->isNullPointerConstant(Context,
6843 NullExpr->isNullPointerConstant(Context,
6900 LHS = S.ImpCastExprToType(LHS.get(), S.Context.VoidTy, CK_ToVoid);
6901 RHS = S.ImpCastExprToType(RHS.get(), S.Context.VoidTy, CK_ToVoid);
6902 return S.Context.VoidTy;
6910 !NullExpr.get()->isNullPointerConstant(S.Context,
6926 if (S.Context.hasSameType(LHSTy, RHSTy)) {
6995 lhptee = S.Context.getQualifiedType(lhptee.getUnqualifiedType(), lhQual);
6996 rhptee = S.Context.getQualifiedType(rhptee.getUnqualifiedType(), rhQual);
6998 QualType CompositeTy = S.Context.mergeTypes(lhptee, rhptee);
7005 incompatTy = S.Context.getPointerType(
7006 S.Context.getAddrSpaceQualType(S.Context.VoidTy, ResultAddrSpace));
7006 S.Context.getAddrSpaceQualType(S.Context.VoidTy, ResultAddrSpace));
7032 return S.Context
7039 ResultTy = S.Context.getBlockPointerType(ResultTy);
7041 ResultTy = S.Context.getPointerType(ResultTy);
7058 QualType destType = S.Context.getPointerType(S.Context.VoidTy);
7058 QualType destType = S.Context.getPointerType(S.Context.VoidTy);
7090 = S.Context.getQualifiedType(lhptee, rhptee.getQualifiers());
7091 QualType destType = S.Context.getPointerType(destPointee);
7100 = S.Context.getQualifiedType(rhptee, lhptee.getQualifiers());
7101 QualType destType = S.Context.getPointerType(destPointee);
7157 S.Context.getCanonicalType(LHS.get()->getType()).getUnqualifiedType();
7159 S.Context.getCanonicalType(RHS.get()->getType()).getUnqualifiedType();
7209 QualType VectorTy = S.Context.getExtVectorType(ResTy, NumElements);
7212 if (S.Context.getTypeSize(CV->getElementType())
7213 != S.Context.getTypeSize(ResTy)) {
7268 if (S.Context.getTypeSize(CVE) != S.Context.getTypeSize(RVE)) {
7268 if (S.Context.getTypeSize(CVE) != S.Context.getTypeSize(RVE)) {
7472 (Context.hasSameType(RHSTy, Context.getObjCClassRedefinitionType()))) {
7472 (Context.hasSameType(RHSTy, Context.getObjCClassRedefinitionType()))) {
7477 (Context.hasSameType(LHSTy, Context.getObjCClassRedefinitionType()))) {
7477 (Context.hasSameType(LHSTy, Context.getObjCClassRedefinitionType()))) {
7483 (Context.hasSameType(RHSTy, Context.getObjCIdRedefinitionType()))) {
7483 (Context.hasSameType(RHSTy, Context.getObjCIdRedefinitionType()))) {
7488 (Context.hasSameType(LHSTy, Context.getObjCIdRedefinitionType()))) {
7488 (Context.hasSameType(LHSTy, Context.getObjCIdRedefinitionType()))) {
7493 if (Context.isObjCSelType(LHSTy) &&
7494 (Context.hasSameType(RHSTy, Context.getObjCSelRedefinitionType()))) {
7494 (Context.hasSameType(RHSTy, Context.getObjCSelRedefinitionType()))) {
7498 if (Context.isObjCSelType(RHSTy) &&
7499 (Context.hasSameType(LHSTy, Context.getObjCSelRedefinitionType()))) {
7499 (Context.hasSameType(LHSTy, Context.getObjCSelRedefinitionType()))) {
7506 if (Context.getCanonicalType(LHSTy) == Context.getCanonicalType(RHSTy)) {
7506 if (Context.getCanonicalType(LHSTy) == Context.getCanonicalType(RHSTy)) {
7528 Context.areCommonBaseCompatible(LHSOPT, RHSOPT)).isNull()) {
7530 } else if (Context.canAssignObjCInterfaces(LHSOPT, RHSOPT)) {
7532 } else if (Context.canAssignObjCInterfaces(RHSOPT, LHSOPT)) {
7536 Context.ObjCQualifiedIdTypesAreCompatible(LHSOPT, RHSOPT,
7542 compositeType = Context.getObjCIdType();
7544 compositeType = Context.getObjCIdType();
7549 QualType incompatTy = Context.getObjCIdType();
7572 = Context.getQualifiedType(lhptee, rhptee.getQualifiers());
7573 QualType destType = Context.getPointerType(destPointee);
7592 = Context.getQualifiedType(rhptee, lhptee.getQualifiers());
7593 QualType destType = Context.getPointerType(destPointee);
7838 && Context.hasSameType(commonExpr->getType(), RHSExpr->getType()))) {
7855 opaqueValue = new (Context) OpaqueValueExpr(commonExpr->getExprLoc(),
7879 Context);
7882 return new (Context)
7886 return new (Context) BinaryConditionalOperator(
7969 if (!S.Context.typesAreCompatible(ltrans, rtrans)) {
7974 ltrans = S.Context.UnsignedCharTy;
7976 ltrans = S.Context.getCorrespondingUnsignedType(ltrans);
7979 rtrans = S.Context.UnsignedCharTy;
7981 rtrans = S.Context.getCorrespondingUnsignedType(rtrans);
8073 if (!S.Context.typesAreBlockPointerCompatible(
8074 S.Context.getQualifiedType(LHSType.getUnqualifiedType(), LQuals),
8075 S.Context.getQualifiedType(RHSType.getUnqualifiedType(), RQuals)))
8077 } else if (!S.Context.typesAreBlockPointerCompatible(LHSType, RHSType))
8112 if (S.Context.typesAreCompatible(LHSType, RHSType))
8166 LHSType = Context.getCanonicalType(LHSType).getUnqualifiedType();
8167 RHSType = Context.getCanonicalType(RHSType).getUnqualifiedType();
8196 if (Context.typesAreCompatible(LHSTypeRef->getPointeeType(), RHSType)) {
8222 if (Context.areCompatibleVectorTypes(LHSType, RHSType)) {
8281 else if (Context.hasCvrSimilarType(RHSType, LHSType))
8305 Context.hasSameType(LHSType,
8306 Context.getObjCClassRedefinitionType())) {
8399 Context.hasSameType(RHSType,
8400 Context.getObjCClassRedefinitionType())) {
8409 LHSType->isBlockCompatibleObjCPointerType(Context)) {
8422 if (LHSType == Context.BoolTy) {
8439 if (LHSType == Context.BoolTy) {
8455 if (Context.typesAreCompatible(LHSType, RHSType)) {
8516 if (RHS.get()->isNullPointerConstant(Context,
8537 ConstructTransparentUnion(*this, Context, RHS, ArgType, InitField);
8602 } else if (RHS.get()->getType() == Context.OverloadTy) {
8617 RHS.get()->isNullPointerConstant(Context,
8632 Context, Expr::NPC_ValueDependentIsNull)) {
8660 QualType Ty = LHSType.getNonLValueExprType(Context);
8786 if (vectorEltTy->isIntegralType(S.Context)) {
8789 S.Context.getIntegerTypeOrder(vectorEltTy, scalarTy) < 0))) {
8793 if (!scalarTy->isIntegralType(S.Context))
8799 S.Context.getFloatingTypeOrder(vectorEltTy, scalarTy) < 0) {
8805 else if (scalarTy->isIntegralType(S.Context))
8827 QualType NewVecTy = S.Context.getVectorType(ElementType,
8851 bool CstInt = Int->get()->EvaluateAsInt(EVResult, S.Context);
8852 int Order = S.Context.getIntegerTypeOrder(OtherIntTy, IntTy);
8864 if (Order < 0 && S.Context.getIntWidth(OtherIntTy) < NumBits)
8871 NumBits > S.Context.getIntWidth(OtherIntTy));
8888 bool CstInt = Int->get()->EvaluateAsInt(EVResult, S.Context);
8898 llvm::APFloat Float(S.Context.getFloatTypeSemantics(FloatTy));
8901 llvm::APSInt ConvertBack(S.Context.getIntWidth(IntTy),
8911 Bits = S.Context.getTypeSize(IntTy);
8913 S.Context.getFloatTypeSemantics(FloatTy));
8952 if (VectorEltTy->isIntegralType(S.Context) &&
8953 ScalarTy->isIntegralType(S.Context) &&
8954 S.Context.getIntegerTypeOrder(VectorEltTy, ScalarTy)) {
8966 bool CstScalar = Scalar->get()->EvaluateAsFloat(Result, S.Context);
8967 int Order = S.Context.getFloatingTypeOrder(VectorEltTy, ScalarTy);
8975 Result.convert(S.Context.getFloatTypeSemantics(VectorEltTy),
8982 } else if (ScalarTy->isIntegralType(S.Context)) {
9030 if (Context.hasSameType(LHSType, RHSType))
9035 Context.areCompatibleVectorTypes(LHSType, RHSType)) {
9051 (Context.getTypeSize(LHSVecType->getElementType()) ==
9052 Context.getTypeSize(RHSVecType->getElementType()))) {
9227 if (!S.Context.hasSameUnqualifiedType(LHSTy->getPointeeType(), RHSTy))
9236 } else if (const auto *ArrayTy = S.Context.getAsArrayType(LHSTy)) {
9238 if (ArrayElemTy != S.Context.getBaseElementType(ArrayTy) ||
9241 S.Context.getTypeSize(ArrayElemTy) == S.Context.getTypeSize(RHSTy))
9241 S.Context.getTypeSize(ArrayElemTy) == S.Context.getTypeSize(RHSTy))
9261 RHS.get()->EvaluateAsInt(RHSValue, S.Context) &&
9361 << (unsigned)!S.Context.hasSameUnqualifiedType(LHS->getType(),
9638 Context, Expr::NPC_ValueDependentIsNotNull)) {
9643 (!IExp->EvaluateAsInt(KnownVal, Context) ||
9647 Context, BO_Add, PExp, IExp);
9662 QualType LHSTy = Context.isPromotableBitField(LHS.get());
9666 LHSTy = Context.getPromotedIntegerType(LHSTy);
9716 if (LHS.get()->IgnoreParenCasts()->isNullPointerConstant(Context,
9722 (!RHS.get()->EvaluateAsInt(KnownVal, Context) ||
9746 if (!Context.hasSameUnqualifiedType(lpointee, rpointee)) {
9751 if (!Context.typesAreCompatible(
9752 Context.getCanonicalType(lpointee).getUnqualifiedType(),
9753 Context.getCanonicalType(rpointee).getUnqualifiedType())) {
9769 CharUnits ElementSize = Context.getTypeSizeInChars(rpointee);
9778 return Context.getPointerDiffType();
9802 !RHS.get()->EvaluateAsInt(RHSResult, S.Context))
9813 S.Context.getTypeSize(LHS.get()->getType()));
9832 !LHS.get()->EvaluateAsInt(LHSResult, S.Context))
9929 S.Context.getExtVectorType(LHSEleType, RHSVecTy->getNumElements());
9946 S.Context.getTypeSize(LHSBT) != S.Context.getTypeSize(RHSBT)) {
9946 S.Context.getTypeSize(LHSBT) != S.Context.getTypeSize(RHSBT)) {
9955 S.Context.getExtVectorType(RHSEleType, LHSVecTy->getNumElements());
10042 if (S.Context.hasSameUnqualifiedType(LHSStrippedType, RHSStrippedType))
10399 !RHSStripped->isNullPointerConstant(S.Context,
10405 !LHSStripped->isNullPointerConstant(S.Context,
10469 switch (SCS.getNarrowingKind(S.Context, E, PreNarrowingValue,
10483 << PreNarrowingValue.getAsString(S.Context, PreNarrowingType) << ToType;
10536 if (!S.Context.hasSameUnqualifiedType(LHSStrippedType, RHSStrippedType)) {
10548 IntType = S.Context.getPromotedIntegerType(IntType);
10614 return S.Context.getLogicalOperationType();
10622 E.get()->isNullPointerConstant(Context,
10633 QualType T = Context.getCanonicalType(TI->getType()).getUnqualifiedType();
10634 if (T == Context.CharTy)
10696 LHS.get()->isNullPointerConstant(Context, Expr::NPC_ValueDependentIsNull);
10698 RHS.get()->isNullPointerConstant(Context, Expr::NPC_ValueDependentIsNull);
10704 return Context.getLogicalOperationType();
10706 assert(Context.hasSameType(LHS.get()->getType(), RHS.get()->getType()));
10802 if (Context.typesAreCompatible(LCanPointeeTy.getUnqualifiedType(),
10916 !Context.typesAreCompatible(lpointee, rpointee)) {
10958 !Context.typesAreCompatible(LHSType, RHSType)) {
10983 if (!Context.areComparableObjCPointerTypes(LHSType, RHSType))
10997 RHSType->isBlockCompatibleObjCPointerType(Context)) {
11002 LHSType->isBlockCompatibleObjCPointerType(Context) &&
11091 unsigned TypeSize = Context.getTypeSize(VTy->getElementType());
11094 if (TypeSize == Context.getTypeSize(Context.CharTy))
11094 if (TypeSize == Context.getTypeSize(Context.CharTy))
11095 return Context.getExtVectorType(Context.CharTy, VTy->getNumElements());
11095 return Context.getExtVectorType(Context.CharTy, VTy->getNumElements());
11096 else if (TypeSize == Context.getTypeSize(Context.ShortTy))
11096 else if (TypeSize == Context.getTypeSize(Context.ShortTy))
11097 return Context.getExtVectorType(Context.ShortTy, VTy->getNumElements());
11097 return Context.getExtVectorType(Context.ShortTy, VTy->getNumElements());
11098 else if (TypeSize == Context.getTypeSize(Context.IntTy))
11098 else if (TypeSize == Context.getTypeSize(Context.IntTy))
11099 return Context.getExtVectorType(Context.IntTy, VTy->getNumElements());
11099 return Context.getExtVectorType(Context.IntTy, VTy->getNumElements());
11100 else if (TypeSize == Context.getTypeSize(Context.LongTy))
11100 else if (TypeSize == Context.getTypeSize(Context.LongTy))
11101 return Context.getExtVectorType(Context.LongTy, VTy->getNumElements());
11101 return Context.getExtVectorType(Context.LongTy, VTy->getNumElements());
11102 assert(TypeSize == Context.getTypeSize(Context.LongLongTy) &&
11102 assert(TypeSize == Context.getTypeSize(Context.LongLongTy) &&
11104 return Context.getExtVectorType(Context.LongLongTy, VTy->getNumElements());
11104 return Context.getExtVectorType(Context.LongLongTy, VTy->getNumElements());
11107 if (TypeSize == Context.getTypeSize(Context.LongLongTy))
11107 if (TypeSize == Context.getTypeSize(Context.LongLongTy))
11108 return Context.getVectorType(Context.LongLongTy, VTy->getNumElements(),
11108 return Context.getVectorType(Context.LongLongTy, VTy->getNumElements(),
11110 else if (TypeSize == Context.getTypeSize(Context.LongTy))
11110 else if (TypeSize == Context.getTypeSize(Context.LongTy))
11111 return Context.getVectorType(Context.LongTy, VTy->getNumElements(),
11111 return Context.getVectorType(Context.LongTy, VTy->getNumElements(),
11113 else if (TypeSize == Context.getTypeSize(Context.IntTy))
11113 else if (TypeSize == Context.getTypeSize(Context.IntTy))
11114 return Context.getVectorType(Context.IntTy, VTy->getNumElements(),
11114 return Context.getVectorType(Context.IntTy, VTy->getNumElements(),
11116 else if (TypeSize == Context.getTypeSize(Context.ShortTy))
11116 else if (TypeSize == Context.getTypeSize(Context.ShortTy))
11117 return Context.getVectorType(Context.ShortTy, VTy->getNumElements(),
11117 return Context.getVectorType(Context.ShortTy, VTy->getNumElements(),
11119 assert(TypeSize == Context.getTypeSize(Context.CharTy) &&
11119 assert(TypeSize == Context.getTypeSize(Context.CharTy) &&
11121 return Context.getVectorType(Context.CharTy, VTy->getNumElements(),
11121 return Context.getVectorType(Context.CharTy, VTy->getNumElements(),
11146 return Context.getLogicalOperationType();
11370 if (RHS.get()->EvaluateAsInt(EVResult, Context)) {
11394 if (!Context.getLangOpts().CPlusPlus) {
11397 if (Context.getLangOpts().OpenCL &&
11398 Context.getLangOpts().OpenCLVersion < 120) {
11416 return Context.IntTy;
11438 return Context.BoolTy;
11708 Expr::isModifiableLvalueResult IsLV = E->isModifiableLvalue(S.Context,
11909 ((Context.isObjCNSObjectType(LHSType) &&
11911 (Context.isObjCNSObjectType(RHSType) &&
11952 LHSType.isNonWeakInMRRWithObjCWeak(Context)) {
12120 return S.Context.DependentTy;
12304 return Context.OverloadTy;
12308 return Context.UnknownAnyTy;
12321 return Context.DependentTy;
12359 Expr::LValueClassification lval = op->ClassifyLValue(Context);
12373 return Context.getPointerType(op->getType());
12410 QualType MPTy = Context.getMemberPointerType(
12411 op->getType(), Context.getTypeDeclType(MD->getParent()).getTypePtr());
12413 if (Context.getTargetInfo().getCXXABI().isMicrosoft())
12448 return Context.OverloadTy;
12466 QualType MPTy = Context.getMemberPointerType(
12468 Context.getTypeDeclType(cast<RecordDecl>(Ctx)).getTypePtr());
12470 if (Context.getTargetInfo().getCXXABI().isMicrosoft())
12494 return Context.getObjCObjectPointerType(op->getType());
12498 return Context.getPointerType(op->getType());
12523 return S.Context.DependentTy;
13018 assert(isVector(RHS.get()->getType(), Context.HalfTy) ==
13019 isVector(LHS.get()->getType(), Context.HalfTy) &&
13021 ConvertHalfVec = needsConversionOfHalfVec(ConvertHalfVec, Context,
13030 &Context.Idents.get("object_setClass"),
13053 return new (Context) BinaryOperator(LHS.get(), RHS.get(), Opc, ResultTy, VK,
13068 return new (Context) CompoundAssignOperator(
13491 CanOverflow = isOverflowingIntegerType(Context, resultType);
13507 isOverflowingIntegerType(Context, Input.get()->getType());
13515 needsConversionOfHalfVec(true, Context, Input.get()->getType());
13519 Input = convertVector(Input.get(), Context.FloatTy, *this);
13527 (!Context.getLangOpts().ZVector ||
13553 else if (resultType->isExtVectorType() && Context.getLangOpts().OpenCL) {
13573 if (resultType->isHalfType() && !Context.getLangOpts().NativeHalfType) {
13574 Input = ImpCastExprToType(Input.get(), Context.FloatTy, CK_FloatingCast).get();
13575 resultType = Context.FloatTy;
13582 if (Context.getLangOpts().CPlusPlus) {
13585 Input = ImpCastExprToType(Input.get(), Context.BoolTy,
13587 } else if (Context.getLangOpts().OpenCL &&
13588 Context.getLangOpts().OpenCLVersion < 120) {
13596 if (Context.getLangOpts().OpenCL &&
13597 Context.getLangOpts().OpenCLVersion < 120 &&
13598 !Context.getLangOpts().OpenCLCPlusPlus) {
13618 resultType = Context.getLogicalOperationType();
13658 auto *UO = new (Context)
13662 !isa<ArrayType>(UO->getType().getDesugaredType(Context)))
13667 return convertVector(UO, Context.HalfTy, *this);
13767 TheDecl->markUsed(Context);
13769 return new (Context) AddrLabelExpr(OpLoc, LabLoc, TheDecl,
13770 Context.getPointerType(Context.VoidTy));
13770 Context.getPointerType(Context.VoidTy));
13803 QualType Ty = Context.VoidTy;
13818 Expr *ResStmtExpr = new (Context) StmtExpr(Compound, Ty, LPLoc, RPLoc);
13885 const ArrayType *AT = Context.getAsArrayType(CurrentType);
13891 CurrentType = Context.DependentTy;
13917 CurrentType = Context.DependentTy;
13988 if (IsDerivedFrom(OC.LocStart, CurrentType, Context.getTypeDeclType(Parent),
14014 return OffsetOfExpr::Create(Context, Context.getSizeType(), BuiltinLoc, TInfo,
14014 return OffsetOfExpr::Create(Context, Context.getSizeType(), BuiltinLoc, TInfo,
14031 ArgTInfo = Context.getTrivialTypeSourceInfo(ArgTy, TypeLoc);
14049 resType = Context.DependentTy;
14071 return new (Context)
14082 BlockDecl *Block = BlockDecl::Create(Context, CurContext, CaretLoc);
14127 T = Context.getFunctionType(Context.DependentTy, None, EPI);
14127 T = Context.getFunctionType(Context.DependentTy, None, EPI);
14128 Sig = Context.getTrivialTypeSourceInfo(T);
14152 Sig = Context.CreateTypeSourceInfo(Result.getType(), Size);
14173 if (RetTy != Context.DependentTy) {
14258 QualType RetTy = Context.VoidTy;
14276 BlockTy = Context.getFunctionType(RetTy, None, EPI);
14290 BlockTy = Context.getFunctionType(RetTy, FPT->getParamTypes(), EPI);
14297 BlockTy = Context.getFunctionType(RetTy, None, EPI);
14301 BlockTy = Context.getBlockPointerType(BlockTy);
14396 BD->setCaptures(Context, Captures, BSI->CXXThisCaptureIndex != 0);
14398 BlockExpr *Result = new (Context) BlockExpr(BD, BlockTy);
14448 Context.getTargetInfo().getTriple().isNVPTX())
14454 if (!E->isTypeDependent() && Context.getTargetInfo().hasBuiltinMSVaList() &&
14455 Context.getTargetInfo().getBuiltinVaListKind() != TargetInfo::CharPtrBuiltinVaList) {
14456 QualType MSVaListType = Context.getBuiltinMSVaListType();
14457 if (Context.hasSameType(MSVaListType, E->getType())) {
14465 QualType VaListType = Context.getBuiltinVaListType();
14471 VaListType = Context.getArrayDecayedType(VaListType);
14481 Context, Context.getLValueReferenceType(VaListType), false);
14481 Context, Context.getLValueReferenceType(VaListType), false);
14496 !Context.hasSameType(VaListType, E->getType()))
14514 if (!TInfo->getType().isPODType(Context)) {
14527 PromoteType = Context.getPromotedIntegerType(TInfo->getType());
14528 if (Context.typesAreCompatible(PromoteType, TInfo->getType()))
14532 PromoteType = Context.DoubleTy;
14541 QualType T = TInfo->getType().getNonLValueExprType(Context);
14542 return new (Context) VAArgExpr(BuiltinLoc, E, TInfo, RPLoc, T, IsMS);
14549 unsigned pw = Context.getTargetInfo().getPointerWidth(0);
14550 if (pw == Context.getTargetInfo().getIntWidth())
14551 Ty = Context.IntTy;
14552 else if (pw == Context.getTargetInfo().getLongWidth())
14553 Ty = Context.LongTy;
14554 else if (pw == Context.getTargetInfo().getLongLongWidth())
14555 Ty = Context.LongLongTy;
14560 return new (Context) GNUNullExpr(Ty, TokenLoc);
14573 return new (Context)
14574 SourceLocExpr(Context, Kind, BuiltinLoc, RPLoc, ParentContext);
14693 if (SrcType->isArrayType()) SrcType = Context.getArrayDecayedType(SrcType);
14829 if (SecondType == Context.OverloadTy)
14953 if (!getLangOpts().CPlusPlus11 && E->isIntegerConstantExpr(Context)) {
14955 *Result = E->EvaluateKnownConstIntCheckOverflow(Context);
14957 E = ConstantExpr::Create(Context, E);
14968 E->EvaluateAsRValue(EvalResult, Context, /*isConstantContext*/ true) &&
14972 E = ConstantExpr::Create(Context, E, EvalResult.Val);
15104 else if (const auto *Arr = S.Context.getAsArrayType(Ty))
15270 const llvm::Triple &TT = S.Context.getTargetInfo().getTriple();
15605 Func->markUsed(Context);
15629 if (Var->hasDefinition(SemaRef.Context) == VarDecl::DeclarationOnly &&
15646 Var->markUsed(SemaRef.Context);
15855 !S.Context.hasDirectOwnershipQualifier(PointeeTy)) {
15910 CaptureType = S.Context.getLValueReferenceType(DeclRefType);
15956 CaptureType = S.Context.getLValueReferenceType(DeclRefType);
16124 captureVariablyModifiedType(Context, QTy, CSI);
16149 captureVariablyModifiedType(Context, QTy, OuterRSI);
16163 CaptureType = Context.getLValueReferenceType(DeclRefType);
16362 if (!VD->isUsableInConstantExpressions(S.Context))
16393 S.Context, DRE->getQualifierLoc(), DRE->getTemplateKeywordLoc(),
16439 S.Context, Base.get(), ME->isArrow(), ME->getOperatorLoc(),
16457 S.Context, ME->getBase(), ME->isArrow(), ME->getOperatorLoc(),
16588 return ConstantExpr::Create(S.Context, Sub.get());
16701 Var->mightBeUsableInConstantExpressions(SemaRef.Context);
16818 if (E && Var->isUsableInConstantExpressions(SemaRef.Context))
16849 !Var->isUsableInConstantExpressions(SemaRef.Context))
17009 : Inherited(S.Context), S(S), SkipLocalVariables(SkipLocalVariables) { }
17045 QualType Destroyed = S.Context.getBaseElementType(E->getDestroyedType());
17254 opE->getLHS()->IgnoreParenImpCasts()->isModifiableLvalue(Context)
17379 E->setType(S.Context.getPointerType(SubExpr->getType()));
17519 if (CalleeType == S.Context.BoundMemberTy) {
17544 E->setType(DestType.getNonLValueExprType(S.Context));
17578 ArgType = S.Context.getLValueReferenceType(ArgType);
17580 ArgType = S.Context.getRValueReferenceType(ArgType);
17586 DestType = S.Context.getFunctionType(DestType, ParamTypes,
17589 DestType = S.Context.getFunctionNoProtoType(DestType,
17600 DestType = S.Context.getPointerType(DestType);
17604 DestType = S.Context.getBlockPointerType(DestType);
17627 assert(Method->getReturnType() == S.Context.UnknownAnyTy);
17663 DestType = S.Context.getLValueReferenceType(DestType);
17707 S.Context, FD->getDeclContext(), Loc, Loc,
17731 Type = S.Context.BoundMemberTy;
17807 InitializedEntity::InitializeParameter(Context, paramType,
17931 E = ImpCastExprToType(E, Context.getPointerType(FD->getType()),
17934 return CallExpr::Create(Context, E, /*Args=*/{}, Context.IntTy,
17934 return CallExpr::Create(Context, E, /*Args=*/{}, Context.IntTy,
17970 if (E->isValueDependent() || E->isIntegerConstantExpr(Context))
17980 QualType BoolT = Context.ObjCBuiltinBoolTy;
17981 if (!Context.getBOOLDecl()) {
17982 LookupResult Result(*this, &Context.Idents.get("BOOL"), OpLoc,
17987 Context.setBOOLDecl(TD);
17990 if (Context.getBOOLDecl())
17991 BoolT = Context.getBOOLType();
17992 return new (Context)
18017 return new (Context)
18018 ObjCAvailabilityCheckExpr(Version, AtLoc, RParen, Context.BoolTy);
tools/clang/lib/Sema/SemaExprCXX.cpp 65 Type = Context.getDependentNameType(ETK_None, NNS->getPrefix(),
79 Context.getTrivialTypeSourceInfo(Type, NameLoc));
94 QualType T = Context.getDependentNameType(ETK_None, SS.getScopeRep(), &II);
125 QualType T = Context.getTypeDeclType(InjectedClassName);
257 QualType T = Context.getTypeDeclType(Type);
261 Context.hasSameUnqualifiedType(T, SearchType)) {
265 Context.getTrivialTypeSourceInfo(T, NameLoc));
284 MemberOfType = Context.getTypeDeclType(Record);
303 Context.getTrivialTypeSourceInfo(MemberOfType, NameLoc));
324 Context.getTrivialTypeSourceInfo(MemberOfType, NameLoc));
337 Context.getTrivialTypeSourceInfo(MemberOfType, NameLoc));
351 SS.getWithLocInContext(Context),
357 QualType T = Context.getTypeDeclType(NonMatchingTypeDecl);
397 !Context.hasSameUnqualifiedType(T, SearchType)) {
447 = Context.getUnqualifiedArrayType(Operand->getType().getNonReferenceType(),
459 return new (Context) CXXTypeidExpr(TypeInfoType.withConst(), Operand,
513 QualType UnqualT = Context.getUnqualifiedArrayType(T, Quals);
514 if (!Context.hasSameType(T, UnqualT)) {
524 E->HasSideEffects(Context, WasEvaluated)) {
532 return new (Context) CXXTypeidExpr(TypeInfoType.withConst(), E,
558 LookupQualifiedName(R, Context.getTranslationUnitDecl());
569 QualType TypeInfoType = Context.getTypeDeclType(CXXTypeInfoDecl);
580 TInfo = Context.getTrivialTypeSourceInfo(T, OpLoc);
642 return new (Context) CXXUuidofExpr(TypeInfoType.withConst(), Operand, UuidStr,
653 if (E->isNullPointerConstant(Context, Expr::NPC_ValueDependentIsNull)) {
666 return new (Context) CXXUuidofExpr(TypeInfoType.withConst(), E, UuidStr,
678 LookupQualifiedName(R, Context.getTranslationUnitDecl());
684 QualType GuidType = Context.getTypeDeclType(MSVCGuidDecl);
695 TInfo = Context.getTrivialTypeSourceInfo(T, OpLoc);
709 return new (Context)
710 CXXBoolLiteralExpr(Kind == tok::kw_true, Context.BoolTy, OpLoc);
716 return new (Context) CXXNullPtrLiteralExpr(Context.NullPtrTy, Loc);
716 return new (Context) CXXNullPtrLiteralExpr(Context.NullPtrTy, Loc);
775 QualType ExceptionObjectTy = Context.getExceptionObjectType(Ex->getType());
808 return new (Context)
809 CXXThrowExpr(Ex, Context.VoidTy, OpLoc, IsThrownVarInScope);
911 if (Context.getTargetInfo().getCXXABI().isMicrosoft()) {
941 Context.addCopyConstructorForExceptionObject(Subobject, CD);
956 if (Context.getTargetInfo().getCXXABI().isItaniumFamily()) {
957 CharUnits TypeAlign = Context.getTypeAlignInChars(Ty);
958 CharUnits ExnObjAlign = Context.getExnObjectAlignment();
1100 QualType ClassTy = Context.getTypeDeclType(cast<CXXRecordDecl>(DC));
1103 ThisTy = Context.getPointerType(ClassTy);
1111 CurContext, Context);
1130 QualType T = S.Context.getRecordType(Record);
1133 S.CXXThisTypeOverride = S.Context.getPointerType(T);
1270 auto *This = new (Context) CXXThisExpr(Loc, Type, IsImplicit);
1307 TInfo = Context.getTrivialTypeSourceInfo(Ty, SourceLocation());
1335 return CXXUnresolvedConstructExpr::Create(Context, TInfo, Locs.getBegin(),
1384 ElemTy = Context.getBaseElementType(Ty);
1427 Context, ResultType, Expr::getValueKindForType(Ty), TInfo, CK_NoOp,
1469 S.Context.hasSameUnqualifiedType(
1471 S.Context.getSizeType()))
1475 S.Context.hasSameUnqualifiedType(
1477 S.Context.getTypeDeclType(S.getStdAlignValT())))
1500 S.Context.hasSameUnqualifiedType(
1502 S.Context.getSizeType())) {
1609 S.Context.DeclarationNames.getCXXOperatorName(OO_Array_Delete);
1685 unsigned IntWidth = Context.getTargetInfo().getIntWidth();
1689 = CheckConvertedConstantExpression(NumElts, Context.getSizeType(), Value,
1877 = Context.getAsConstantArrayType(AllocType)) {
1878 ArraySize = IntegerLiteral::Create(Context, Array->getSize(),
1879 Context.getSizeType(),
1892 AllocType = Context.getLifetimeQualifiedType(AllocType,
1896 QualType ResultType = Context.getPointerType(AllocType);
1915 assert(Context.getTargetInfo().getIntWidth() && "Builtin type of size 0?");
1917 ConvertedSize = PerformImplicitConversion(*ArraySize, Context.getSizeType(),
2006 if ((*ArraySize)->isIntegerConstantExpr(Value, Context)) {
2015 ConstantArrayType::getNumAddressingBits(Context, AllocType, Value);
2016 if (ActiveSizeBits > ConstantArrayType::getMaxSizeBits(Context))
2041 AllocType->isDependentType() ? 0 : Context.getTypeAlign(AllocType);
2042 unsigned NewAlignment = Context.getTargetInfo().getNewAlign();
2095 << unsigned(Alignment / Context.getCharWidth())
2096 << unsigned(NewAlignment / Context.getCharWidth());
2118 InitType = Context.getConstantArrayType(
2120 llvm::APInt(Context.getTypeSize(Context.getSizeType()),
2120 llvm::APInt(Context.getTypeSize(Context.getSizeType()),
2125 Context.getIncompleteArrayType(AllocType, ArrayType::Normal, 0);
2151 auto *CAT = Context.getAsConstantArrayType(Initializer->getType());
2156 Context, CAT->getSize(), Context.getSizeType(), TypeRange.getEnd());
2156 Context, CAT->getSize(), Context.getSizeType(), TypeRange.getEnd());
2176 return CXXNewExpr::Create(Context, UseGlobal, OperatorNew, OperatorDelete,
2210 if (const ArrayType *AT = Context.getAsArrayType(AllocType)) {
2211 QualType BaseAllocType = Context.getBaseElementType(AT);
2282 S.Context.getLangOpts().MSVCCompat) {
2284 R.setLookupName(S.Context.DeclarationNames.getCXXOperatorName(OO_New));
2285 S.LookupQualifiedName(R, S.Context.getTranslationUnitDecl());
2369 IntegerLiteral Size(Context, llvm::APInt::getNullValue(
2370 Context.getTargetInfo().getPointerWidth(0)),
2371 Context.getSizeType(),
2375 QualType AlignValT = Context.VoidTy;
2378 AlignValT = Context.getTypeDeclType(getStdAlignValT());
2392 DeclarationName NewName = Context.DeclarationNames.getCXXOperatorName(
2395 QualType AllocElemType = Context.getBaseElementType(AllocType);
2421 LookupQualifiedName(R, Context.getTranslationUnitDecl());
2453 DeclarationName DeleteName = Context.DeclarationNames.getCXXOperatorName(
2482 LookupQualifiedName(FoundDelete, Context.getTranslationUnitDecl());
2522 ArgTypes.push_back(Context.VoidPtrTy);
2531 = Context.getFunctionType(Context.VoidTy, ArgTypes, EPI);
2531 = Context.getFunctionType(Context.VoidTy, ArgTypes, EPI);
2549 if (Context.hasSameType(adjustCCAndNoReturn(Fn->getType(),
2706 StdBadAlloc = CXXRecordDecl::Create(Context, TTK_Class,
2717 Context, getOrCreateStdNamespace(), SourceLocation(), SourceLocation(),
2719 AlignValT->setIntegerType(Context.getSizeType());
2720 AlignValT->setPromotionType(Context.getSizeType());
2727 QualType VoidPtr = Context.getPointerType(Context.VoidTy);
2727 QualType VoidPtr = Context.getPointerType(Context.VoidTy);
2728 QualType SizeT = Context.getSizeType();
2748 Params.push_back(Context.getTypeDeclType(getStdAlignValT()));
2751 Context.DeclarationNames.getCXXOperatorName(Kind), Return, Params);
2761 DeclareGlobalAllocationFunctions(OO_Delete, Context.VoidTy, VoidPtr);
2762 DeclareGlobalAllocationFunctions(OO_Array_Delete, Context.VoidTy, VoidPtr);
2770 DeclContext *GlobalCtx = Context.getTranslationUnitDecl();
2783 Context.getCanonicalType(P->getType().getUnqualifiedType()));
2795 FunctionProtoType::ExtProtoInfo EPI(Context.getDefaultCallingConvention(
2804 BadAllocType = Context.getTypeDeclType(getStdBadAlloc());
2815 QualType FnType = Context.getFunctionType(Return, Params, EPI);
2817 Context, GlobalCtx, SourceLocation(), SourceLocation(), Name,
2824 Context, LangOpts.GlobalAllocationFunctionVisibilityHidden
2831 Context, Alloc, SourceLocation(), SourceLocation(), nullptr, T,
2838 Context.getTranslationUnitDecl()->addDecl(Alloc);
2847 CreateAllocationFunctionDecl(CUDAHostAttr::CreateImplicit(Context));
2848 CreateAllocationFunctionDecl(CUDADeviceAttr::CreateImplicit(Context));
2859 LookupQualifiedName(FoundDelete, Context.getTranslationUnitDecl());
2873 DeclarationName Name = Context.DeclarationNames.getCXXOperatorName(OO_Delete);
2884 Loc, true, hasNewExtendedAlignment(*this, Context.getRecordType(RD)),
2900 bool Overaligned = hasNewExtendedAlignment(*this, Context.getRecordType(RD));
3306 QualType PointeeElem = Context.getBaseElementType(Pointee);
3342 DeclarationName DeleteName = Context.DeclarationNames.getCXXOperatorName(
3426 QualType Unqual = Context.getPointerType(
3427 Context.getQualifiedType(Pointee.getUnqualifiedType(), Qs));
3436 CXXDeleteExpr *Result = new (Context) CXXDeleteExpr(
3437 Context.VoidTy, UseGlobal, ArrayForm, ArrayFormAsWritten,
3447 DeclarationName NewName = S.Context.DeclarationNames.getCXXOperatorName(
3451 S.LookupQualifiedName(R, S.Context.getTranslationUnitDecl());
3557 InitializedEntity::InitializeParameter(Context, ParamTy, false);
3680 ? CheckConvertedConstantExpression(CondExpr, Context.BoolTy, Value,
3716 return Context.typesAreCompatible(Context.getWideCharType(),
3716 return Context.typesAreCompatible(Context.getWideCharType(),
3776 Result = ImplicitCastExpr::Create(S.Context, Result.get()->getType(),
3821 BeforeToType = Context.getTagDeclType(Conv->getParent());
3928 if (Context.hasSameType(FromType, Context.OverloadTy)) {
3928 if (Context.hasSameType(FromType, Context.OverloadTy)) {
3956 From = ImplicitCastExpr::Create(Context, FromType, CK_AtomicToNonAtomic,
3971 FromType = Context.getArrayDecayedType(FromType);
3977 FromType = Context.getPointerType(FromType);
4127 if (Context.getTargetInfo().getCXXABI().isMicrosoft()) {
4140 From = ImpCastExprToType(From, Context.FloatTy, CK_FloatingCast).get();
4141 FromType = Context.FloatTy;
4144 From = ImpCastExprToType(From, Context.BoolTy,
4182 if (Context.hasSameUnqualifiedType(ElType, From->getType())) {
4212 if (Context.hasSameUnqualifiedType(ElType, ToType)) {
4305 From = ImpCastExprToType(From, ToType.getNonLValueExprType(Context), CK, VK,
4328 assert(Context.hasSameType(
4506 ASTContext &C = Self.Context;
4968 ArgTy = S.Context.getRValueReferenceType(ArgTy);
4971 ArgTy.getNonLValueExprType(S.Context),
4982 Sema::ContextRAII TUContext(S, S.Context.getTranslationUnitDecl());
5015 return !Result.get()->hasNonTrivialCall(S.Context);
5030 QualType ResultType = Context.getLogicalOperationType();
5048 return TypeTraitExpr::Create(Context, ResultType, KWLoc, Kind, Args,
5062 TInfo = Context.getTrivialTypeSourceInfo(T, KWLoc);
5102 assert(Self.Context.hasSameUnqualifiedType(LhsT, RhsT)
5127 return Self.Context.hasSameType(LhsT, RhsT);
5133 return Self.Context.typesAreCompatible(Lhs, Rhs);
5176 LhsT = Self.Context.getRValueReferenceType(LhsT);
5180 OpaqueValueExpr From(KeyLoc, LhsT.getNonLValueExprType(Self.Context),
5191 Sema::ContextRAII TUContext(Self, Self.Context.getTranslationUnitDecl());
5230 LhsT = Self.Context.getRValueReferenceType(LhsT);
5232 RhsT = Self.Context.getRValueReferenceType(RhsT);
5233 OpaqueValueExpr Lhs(KeyLoc, LhsT.getNonLValueExprType(Self.Context),
5235 OpaqueValueExpr Rhs(KeyLoc, RhsT.getNonLValueExprType(Self.Context),
5243 Sema::ContextRAII TUContext(Self, Self.Context.getTranslationUnitDecl());
5267 return !Result.get()->hasNonTrivialCall(Self.Context);
5286 TSInfo = Context.getTrivialTypeSourceInfo(T);
5300 while (const ArrayType *AT = Self.Context.getAsArrayType(T)) {
5325 while (const ArrayType *AT = Self.Context.getAsArrayType(T)) {
5335 if (const ConstantArrayType *CAT = Self.Context.getAsConstantArrayType(T))
5363 return new (Context) ArrayTypeTraitExpr(KWLoc, ATT, TSInfo, Value, DimExpr,
5364 RParen, Context.getSizeType());
5402 return new (Context)
5403 ExpressionTraitExpr(KWLoc, ET, Queried, Value, RParen, Context.BoolTy);
5464 if (!Context.hasSameUnqualifiedType(Class, LHSType)) {
5485 QualType UseType = Context.getQualifiedType(Class, LHSType.getQualifiers());
5487 UseType = Context.getPointerType(UseType);
5506 Result = Context.getCVRQualifiedType(Result, LHSType.getCVRQualifiers());
5521 if (!isIndirect && !LHS.get()->Classify(Context).isLValue()) {
5535 if (isIndirect || !LHS.get()->Classify(Context).isRValue())
5551 return Context.BoundMemberTy;
5589 QualType T = To->isLValue() ? Self.Context.getLValueReferenceType(ToType)
5590 : Self.Context.getRValueReferenceType(ToType);
5643 TTy = TTy.getNonLValueExprType(Self.Context);
5768 return Context.DependentTy;
5795 return Context.VoidTy;
5810 if (!Context.hasSameType(LTy, RTy) &&
5851 if (!Context.hasSameType(LTy, RTy) &&
5885 bool Same = Context.hasSameType(LTy, RTy);
5900 LTy = Context.getQualifiedType(LTy, Qs);
5904 assert(Context.hasSameType(LTy, RTy) && "bad composite pointer type");
5937 if (Context.getCanonicalType(LTy) == Context.getCanonicalType(RTy)) {
5937 if (Context.getCanonicalType(LTy) == Context.getCanonicalType(RTy)) {
6082 if (Found.insert(S.Context.getCanonicalType(E)).second)
6135 E2->isNullPointerConstant(Context, Expr::NPC_ValueDependentIsNull)) {
6143 E1->isNullPointerConstant(Context, Expr::NPC_ValueDependentIsNull)) {
6265 Composite1 = Context.getFunctionType(FPT1->getReturnType(),
6267 Composite2 = Context.getFunctionType(FPT2->getReturnType(),
6289 Composite1 = Context.getMemberPointerType(
6290 Context.getQualifiedType(Composite1, Quals), Classes.first);
6291 Composite2 = Context.getMemberPointerType(
6292 Context.getQualifiedType(Composite2, Quals), Classes.second);
6296 Context.getPointerType(Context.getQualifiedType(Composite1, Quals));
6296 Context.getPointerType(Context.getQualifiedType(Composite1, Quals));
6298 Context.getPointerType(Context.getQualifiedType(Composite2, Quals));
6298 Context.getPointerType(Context.getQualifiedType(Composite2, Quals));
6336 if (C1.Viable && Context.hasSameType(Composite1, Composite2)) {
6380 if (T == Context.BoundMemberTy) {
6423 Context.getLangOpts().ObjCRuntime.hasEmptyCollections())
6432 Context.getLangOpts().ObjCRuntime.hasEmptyCollections())
6456 return ImplicitCastExpr::Create(Context, E->getType(), ck, E, nullptr,
6465 const Type *T = Context.getCanonicalType(E->getType().getTypePtr());
6509 CXXTemporary *Temp = CXXTemporary::Create(Context, Destructor);
6510 CXXBindTemporaryExpr *Bind = CXXBindTemporaryExpr::Create(Context, Temp, E);
6542 Context, SubExpr, Cleanup.cleanupsHaveSideEffects(), Cleanups);
6561 Context, SubStmt, SourceLocation(), SourceLocation());
6562 Expr *E = new (Context) StmtExpr(CompStmt, Context.VoidTy, SourceLocation(),
6562 Expr *E = new (Context) StmtExpr(CompStmt, Context.VoidTy, SourceLocation(),
6606 return new (Context) BinaryOperator(
6641 if (CheckCallReturnType(Call->getCallReturnType(Context),
6743 CTypes.insert(Context.getCanonicalType(BaseType));
6787 CanQualType CBaseType = Context.getCanonicalType(BaseType);
6799 else if (auto *AT = Context.getAsArrayType(BaseType))
6929 if (!Context.hasSameUnqualifiedType(DestructedType, ObjectType)) {
6934 Context.hasSameUnqualifiedType(DestructedType,
6957 Context.getTrivialTypeSourceInfo(ObjectType, DestructedTypeStart);
6974 DestructedTypeInfo = Context.getTrivialTypeSourceInfo(ObjectType,
6991 !Context.hasSameUnqualifiedType(ScopeType, ObjectType)) {
7004 = new (Context) CXXPseudoDestructorExpr(Context, Base,
7004 = new (Context) CXXPseudoDestructorExpr(Context, Base,
7006 SS.getWithLocInContext(Context),
7041 ObjectTypePtrForLookup = ParsedType::make(Context.DependentTy);
7100 DestructedTypeInfo = Context.getTrivialTypeSourceInfo(DestructedType,
7151 ScopeTypeInfo = Context.getTrivialTypeSourceInfo(ScopeType,
7175 TypeSourceInfo *DestructedTypeInfo = TLB.getTypeSourceInfo(Context, T);
7228 Context.BoundMemberTy, VK_RValue, OK_Ordinary);
7232 ResultType = ResultType.getNonLValueExprType(Context);
7235 Context, ME, /*Args=*/{}, ResultType, VK, Exp.get()->getEndLoc());
7259 if (!inTemplateInstantiation() && Operand->HasSideEffects(Context, false)) {
7266 return new (Context)
7267 CXXNoexceptExpr(Context.BoolTy, Operand, CanThrow, KeyLoc, RParen);
7389 E = ImpCastExprToType(E, Context.VoidTy, CK_ToVoid).get();
7498 VariableCanNeverBeAConstantExpression(Var, S.Context);
7550 NewSS.MakeTrivial(SemaRef.Context, NNS, TC.getCorrectionRange());
7959 FullExpr.get()->getType() == Context.UnknownAnyTy) {
7960 FullExpr = forceUnknownAnyToType(FullExpr.get(), Context.getObjCIdType());
tools/clang/lib/Sema/SemaExprMember.cpp 416 QualType VT = S.Context.getExtVectorType(vecType->getElementType(), CompSize);
424 return S.Context.getTypedefType(*I);
514 Context, BaseExpr, BaseType, IsArrow, OpLoc,
515 SS.getWithLocInContext(Context), TemplateKWLoc, FirstQualifierInScope,
890 return new (S.Context) MSPropertyRefExpr(BaseExpr, PD, IsArrow,
891 S.Context.PseudoObjectTy, VK_LValue,
892 SS.getWithLocInContext(S.Context),
903 SS ? SS->getWithLocInContext(Context) : NestedNameSpecifierLoc();
917 MemberExpr::Create(Context, Base, IsArrow, OpLoc, NNS, TemplateKWLoc,
1064 = UnresolvedMemberExpr::Create(Context, R.isUnresolvableResult(),
1067 SS.getWithLocInContext(Context),
1143 type = Context.BoundMemberTy;
1200 redef = S.Context.getObjCIdRedefinitionType();
1202 redef = S.Context.getObjCClassRedefinitionType();
1334 return new (S.Context) ObjCIsaExpr(BaseExpr.get(), IsArrow, MemberLoc,
1335 OpLoc, S.Context.getObjCClassType());
1459 ObjCIvarRefExpr *Result = new (S.Context) ObjCIvarRefExpr(
1486 assert(S.Context.hasSameUnqualifiedType(BaseType,
1498 FindGetterSetterNameDecl(OPT, Member, Sel, S.Context)) {
1504 return new (S.Context)
1505 ObjCPropertyRefExpr(PD, S.Context.PseudoObjectTy, VK_LValue,
1517 SetterSel, S.Context))
1520 return new (S.Context)
1521 ObjCPropertyRefExpr(OMD, SMD, S.Context.PseudoObjectTy, VK_LValue,
1577 return new (S.Context) ObjCPropertyRefExpr(
1578 Getter, Setter, S.Context.PseudoObjectTy, VK_LValue,
1615 S.Context.getCanonicalType(BaseExpr.get()->getType()).getQualifiers();
1616 ret = S.Context.getQualifiedType(ret, BaseQ);
1618 return new (S.Context)
1625 !S.Context.getObjCSelRedefinitionType()->isObjCSelType()) {
1627 BaseExpr.get(), S.Context.getObjCSelRedefinitionType(), CK_BitCast);
1748 E->getBase()->getType().getDesugaredType(Context))) {
1794 Context.getCanonicalType(MemberType).getQualifiers();
1800 MemberType = Context.getQualifiedType(MemberType, Combined);
tools/clang/lib/Sema/SemaExprObjC.cpp 67 const ConstantArrayType *CAT = Context.getAsConstantArrayType(S->getType());
69 QualType StrTy = Context.getConstantArrayType(
72 S = StringLiteral::Create(Context, StrBuf, StringLiteral::Ascii,
89 QualType Ty = Context.getObjCConstantStringInterface();
91 Ty = Context.getObjCObjectPointerType(Ty);
97 NSIdent = &Context.Idents.get("NSConstantString");
99 NSIdent = &Context.Idents.get(StringClass);
104 Context.setObjCConstantStringInterface(StrIF);
105 Ty = Context.getObjCConstantStringInterface();
106 Ty = Context.getObjCObjectPointerType(Ty);
112 Ty = Context.getObjCIdType();
119 Context.setObjCConstantStringInterface(StrIF);
120 Ty = Context.getObjCConstantStringInterface();
121 Ty = Context.getObjCObjectPointerType(Ty);
127 Ty = Context.getObjCNSStringType();
130 ObjCInterfaceDecl::Create (Context,
131 Context.getTranslationUnitDecl(),
134 Ty = Context.getObjCInterfaceType(NSStringIDecl);
135 Context.setObjCNSStringType(Ty);
137 Ty = Context.getObjCObjectPointerType(Ty);
141 return new (Context) ObjCStringLiteral(S, Ty, AtLoc);
226 ASTContext &Context = S.Context;
263 ASTContext &CX = S.Context;
294 ParmVarDecl *value = ParmVarDecl::Create(S.Context, Method,
299 Method->setMethodParams(S.Context, value, None);
323 NumberType = Context.CharTy;
327 NumberType = Context.getWideCharType();
331 NumberType = Context.Char16Ty;
335 NumberType = Context.Char32Ty;
350 InitializedEntity Entity = InitializedEntity::InitializeParameter(Context,
361 new (Context) ObjCBoxedExpr(Number, NSNumberPointer, Method,
375 Inner = ImpCastExprToType(Inner.get(), Context.BoolTy,
400 = InitializedEntity::InitializeParameter(S.Context, T,
493 InitializedEntity::InitializeParameter(S.Context, T,
501 new (Context) ObjCBoxedExpr(ValueExpr, Context.DependentTy, nullptr, SR);
501 new (Context) ObjCBoxedExpr(ValueExpr, Context.DependentTy, nullptr, SR);
516 if (Context.hasSameUnqualifiedType(PointeeType, Context.CharTy)) {
516 if (Context.hasSameUnqualifiedType(PointeeType, Context.CharTy)) {
524 QualType NSStringObject = Context.getObjCInterfaceType(NSStringDecl);
525 NSStringPointer = Context.getObjCObjectPointerType(NSStringObject);
541 BoxedType = Context.getAttributedType(
545 return new (Context) ObjCBoxedExpr(CE, BoxedType, nullptr, SR);
553 IdentifierInfo *II = &Context.Idents.get("stringWithUTF8String");
554 Selector stringWithUTF8String = Context.Selectors.getUnarySelector(II);
562 Context, SourceLocation(), SourceLocation(), stringWithUTF8String,
569 QualType ConstCharType = Context.CharTy.withConst();
571 ParmVarDecl::Create(Context, M,
573 &Context.Idents.get("value"),
574 Context.getPointerType(ConstCharType),
577 M->setMethodParams(Context, value, None);
592 BoxingMethod->getReturnType()->getNullability(Context);
594 BoxedType = Context.getAttributedType(
612 ValueType = Context.CharTy;
616 ValueType = Context.getWideCharType();
620 ValueType = Context.Char16Ty;
624 ValueType = Context.Char32Ty;
657 QualType NSValueObject = Context.getObjCInterfaceType(NSValueDecl);
658 NSValuePointer = Context.getObjCObjectPointerType(NSValueObject);
663 &Context.Idents.get("valueWithBytes"),
664 &Context.Idents.get("objCType")
666 Selector ValueWithBytesObjCType = Context.Selectors.getSelector(2, II);
674 Context,
692 ParmVarDecl::Create(Context, M,
694 &Context.Idents.get("bytes"),
695 Context.VoidPtrTy.withConst(),
700 QualType ConstCharType = Context.CharTy.withConst();
702 ParmVarDecl::Create(Context, M,
704 &Context.Idents.get("type"),
705 Context.getPointerType(ConstCharType),
710 M->setMethodParams(Context, Params, None);
721 if (!ValueType.isTriviallyCopyableType(Context)) {
747 InitializedEntity IE = InitializedEntity::InitializeParameter(Context,
758 new (Context) ObjCBoxedExpr(ValueExpr, BoxedType,
790 return new (Context) ObjCSubscriptRefExpr(
791 BaseExpr, IndexExpr, Context.PseudoObjectTy, VK_LValue, OK_ObjCSubscript,
807 QualType IdT = Context.getObjCIdType();
815 Context, SourceLocation(), SourceLocation(), Sel, IdT, ReturnTInfo,
816 Context.getTranslationUnitDecl(), false /*Instance*/,
822 ParmVarDecl *objects = ParmVarDecl::Create(Context, Method,
825 &Context.Idents.get("objects"),
826 Context.getPointerType(IdT),
830 ParmVarDecl *cnt = ParmVarDecl::Create(Context, Method,
833 &Context.Idents.get("cnt"),
834 Context.UnsignedLongTy,
838 Method->setMethodParams(Context, Params, None);
848 !Context.hasSameUnqualifiedType(PtrT->getPointeeType(), IdT)) {
854 << Context.getPointerType(IdT.withConst());
891 = Context.getObjCObjectPointerType(
892 Context.getObjCInterfaceType(NSArrayDecl));
895 ObjCArrayLiteral::Create(Context, Elements, Ty,
913 QualType IdT = Context.getObjCIdType();
919 Method = ObjCMethodDecl::Create(Context,
923 Context.getTranslationUnitDecl(),
930 ParmVarDecl *objects = ParmVarDecl::Create(Context, Method,
933 &Context.Idents.get("objects"),
934 Context.getPointerType(IdT),
938 ParmVarDecl *keys = ParmVarDecl::Create(Context, Method,
941 &Context.Idents.get("keys"),
942 Context.getPointerType(IdT),
946 ParmVarDecl *cnt = ParmVarDecl::Create(Context, Method,
949 &Context.Idents.get("cnt"),
950 Context.UnsignedLongTy,
954 Method->setMethodParams(Context, Params, None);
965 !Context.hasSameUnqualifiedType(PtrValue->getPointeeType(), IdT)) {
971 << Context.getPointerType(IdT.withConst());
979 !Context.hasSameUnqualifiedType(PtrKey->getPointeeType(),
986 LookupProtocol(&Context.Idents.get("NSCopying"), SR.getBegin())) {
989 Context.getObjCObjectType(Context.ObjCBuiltinIdTy, { },
989 Context.getObjCObjectType(Context.ObjCBuiltinIdTy, { },
994 QIDNSCopying = Context.getObjCObjectPointerType(QIDNSCopying);
998 err = !Context.hasSameUnqualifiedType(PtrKey->getPointeeType(),
1008 << Context.getPointerType(IdT.withConst());
1069 = Context.getObjCObjectPointerType(
1070 Context.getObjCInterfaceType(NSDictionaryDecl));
1072 Context, Elements, HasPackExpansions, Ty,
1082 StrTy = Context.DependentTy;
1093 Context.getObjCEncodingForType(EncodedType, Str, nullptr, &NotEncodedT);
1100 StrTy = Context.getStringLiteralArrayType(Context.CharTy, Str.size());
1100 StrTy = Context.getStringLiteralArrayType(Context.CharTy, Str.size());
1103 return new (Context) ObjCEncodeExpr(StrTy, EncodedTypeInfo, AtLoc, RParenLoc);
1115 TInfo = Context.getTrivialTypeSourceInfo(EncodedType,
1234 QualType Ty = Context.getObjCSelType();
1235 return new (Context) ObjCSelectorExpr(Ty, Sel, AtLoc, RParenLoc);
1256 QualType Ty = Context.getObjCProtoType();
1259 Ty = Context.getObjCObjectPointerType(Ty);
1260 return new (Context) ObjCProtocolExpr(Ty, PDecl, AtLoc, ProtoIdLoc, RParenLoc);
1312 ASTContext &Context = S.Context;
1390 if (T == Context.getObjCInstanceType()) {
1396 QualType NewResultType = Context.getObjCObjectPointerType(
1397 Context.getObjCInterfaceType(MD->getClassInterface()));
1398 if (auto Nullability = resultType->getNullability(Context))
1399 NewResultType = Context.getAttributedType(
1415 if (auto nullability = ReceiverType->getNullability(Context))
1419 if (auto nullability = resultType->getNullability(Context))
1447 resultType = resultType.getDesugaredType(Context);
1449 } while (resultType->getNullability(Context));
1455 return Context.getAttributedType(
1503 Context.hasSameUnqualifiedType(destType, MD->getReturnType()))
1509 findExplicitInstancetypeDeclarer(MD, Context.getObjCInstanceType())) {
1540 if (Context.hasSameUnqualifiedType(
1544 if (!Context.hasSameUnqualifiedType(Method->getReturnType(),
1545 Context.getObjCInstanceType()))
1627 ReturnType = Context.UnknownAnyTy;
1629 ReturnType = Context.getObjCIdType();
1668 argExpr->IgnoreParenNoopCasts(Context)))
1679 if (param->getType() == Context.UnknownAnyTy) {
1697 Context,
1707 = InitializedEntity::InitializeParameter(Context, param, paramType);
1847 return new (Context)
1848 ObjCPropertyRefExpr(PD, Context.PseudoObjectTy, VK_LValue,
1851 return new (Context)
1852 ObjCPropertyRefExpr(PD, Context.PseudoObjectTy, VK_LValue,
1864 return new (Context) ObjCPropertyRefExpr(
1865 PD, Context.PseudoObjectTy, VK_LValue, OK_ObjCProperty, MemberLoc,
1868 return new (Context)
1869 ObjCPropertyRefExpr(PD, Context.PseudoObjectTy, VK_LValue,
1933 return new (Context)
1934 ObjCPropertyRefExpr(Getter, Setter, Context.PseudoObjectTy, VK_LValue,
1937 return new (Context)
1938 ObjCPropertyRefExpr(Getter, Setter, Context.PseudoObjectTy, VK_LValue,
2023 QualType T = Context.getObjCObjectPointerType(SuperType);
2089 return new (Context)
2090 ObjCPropertyRefExpr(Getter, Setter, Context.PseudoObjectTy, VK_LValue,
2094 return new (Context) ObjCPropertyRefExpr(
2095 Getter, Setter, Context.PseudoObjectTy, VK_LValue, OK_ObjCProperty,
2099 << &propertyName << Context.getObjCInterfaceType(IFace));
2179 T = Context.getObjCInterfaceType(Class);
2181 T = Context.getTypeDeclType(Type);
2189 TypeSourceInfo *TSInfo = Context.getTrivialTypeSourceInfo(T, NameLoc);
2211 QualType T = Context.getObjCInterfaceType(Class);
2212 TypeSourceInfo *TSInfo = Context.getTrivialTypeSourceInfo(T, NameLoc);
2259 SuperTy = Context.getObjCObjectPointerType(SuperTy);
2281 receiverTypeInfo = Context.getTrivialTypeSourceInfo(ReceiverType);
2478 Context, ReceiverType, VK_RValue, LBracLoc, ReceiverTypeInfo, Sel,
2500 if (RequireCompleteType(Loc, Context.getObjCInterfaceType(Class),
2569 Result = ObjCMessageExpr::Create(Context, ReturnType, VK, LBracLoc,
2575 Result = ObjCMessageExpr::Create(Context, ReturnType, VK, LBracLoc,
2604 ReceiverTypeInfo = Context.getTrivialTypeSourceInfo(ReceiverType, LBracLoc);
2706 if (Receiver->getType() == Context.UnknownAnyTy)
2707 Result = forceUnknownAnyToType(Receiver, Context.getObjCIdType());
2721 Context, Context.DependentTy, VK_RValue, LBracLoc, Receiver, Sel,
2721 Context, Context.DependentTy, VK_RValue, LBracLoc, Receiver, Sel,
2740 !Context.getObjCIdType().isNull() &&
2749 Receiver = ImpCastExprToType(Receiver, Context.getObjCIdType(),
2753 bool IsNull = Receiver->isNullPointerConstant(Context,
2756 Receiver = ImpCastExprToType(Receiver, Context.getObjCIdType(),
2785 bool receiverIsIdLike = ReceiverType->isObjCIdOrObjectKindOfType(Context,
2788 (Receiver && Context.isObjCNSObjectType(Receiver->getType()))) {
3124 Result = ObjCMessageExpr::Create(Context, ReturnType, VK, LBracLoc,
3130 Result = ObjCMessageExpr::Create(Context, ReturnType, VK, LBracLoc,
3149 Context.getObjCInterfaceType(CurMeth->getClassInterface());
3229 IdentifierInfo *SelectorId = &Context.Idents.get("respondsToSelector");
3230 RespondsToSelectorSel = Context.Selectors.getUnarySelector(SelectorId);
3540 LookupResult R(*this, &Context.Idents.get(name), SourceLocation(),
3726 ARCCastChecker(S.Context, exprACTC, castACTC, true).Visit(castExpr);
3767 ARCCastChecker(S.Context, exprACTC, castACTC, true).Visit(castExpr);
3834 (S.Context.ObjCObjectAdoptsQTypeProtocols(
3903 (S.Context.QIdProtocolsAdoptObjCObjectProtocols(
4069 Selector Sel = Context.Selectors.getUnarySelector(CMId);
4083 Selector Sel = Context.Selectors.getNullarySelector(IMId);
4136 QualType receiverType = Context.getObjCInterfaceType(RelatedClass);
4246 if (castACTC == ACTC_none && castType->isIntegralType(Context))
4258 switch (ARCCastChecker(Context, exprACTC, castACTC, false).Visit(castExpr)) {
4270 castExpr = ImplicitCastExpr::Create(Context, castExpr->getType(),
4346 return new (Context) ParenExpr(pe->getLParen(), pe->getRParen(), sub);
4350 return new (Context)
4370 Context, gse->getGenericLoc(), gse->getControllingExpr(), subTypes,
4382 Context.getCanonicalType(castType).getUnqualifiedType();
4384 Context.getCanonicalType(exprType).getUnqualifiedType();
4497 SubExpr = ImplicitCastExpr::Create(Context, FromType,
4531 Expr *Result = new (Context) ObjCBridgedCastExpr(LParenLoc, Kind, CK,
4537 Result = ImplicitCastExpr::Create(Context, T, CK_ARCConsumeObject, Result,
4556 TSInfo = Context.getTrivialTypeSourceInfo(T, LParenLoc);
tools/clang/lib/Sema/SemaFixItUtils.cpp 35 From = S.Context.getCanonicalType(
37 To = S.Context.getCanonicalType(
57 const CanQualType FromQTy = S.Context.getCanonicalType(FromTy);
58 const CanQualType ToQTy = S.Context.getCanonicalType(ToTy);
97 S.Context.getCanonicalType(FromPtrTy->getPointeeType()), ToQTy,
102 isNullPointerConstant(S.Context, Expr::NPC_ValueDependentIsNotNull))
135 CanConvert = CompareTypes(S.Context.getPointerType(FromQTy), ToQTy,
tools/clang/lib/Sema/SemaInit.cpp 200 DeclT = S.Context.getConstantArrayType(IAT->getElementType(),
290 DummyExpr = new (SemaRef.Context) NoInitExpr(SemaRef.Context.VoidTy);
290 DummyExpr = new (SemaRef.Context) NoInitExpr(SemaRef.Context.VoidTy);
428 << (OldInit->HasSideEffects(SemaRef.Context) && FullyOverwritten)
489 InitListExpr DummyInitList(SemaRef.Context, Loc, None, Loc);
508 InitExpr = VerifyOnly ? &DummyInitList : new (SemaRef.Context)
509 InitListExpr(SemaRef.Context, Loc, None, Loc);
510 InitExpr->setType(SemaRef.Context.VoidTy);
609 SemaRef.Context, &Base, false, &ParentEntity);
613 ? new (SemaRef.Context) NoInitExpr(Base.getType())
654 Expr *Filler = new (SemaRef.Context) NoInitExpr(Field->getType());
658 ILE->updateInit(SemaRef.Context, Init, Filler);
678 ILE->updateInit(SemaRef.Context, Init, DIE.get());
715 ILE->updateInit(SemaRef.Context, Init, MemberInit.getAs<Expr>());
740 assert((ILE->getType() != SemaRef.Context.VoidTy) &&
791 ILE->resizeInits(SemaRef.Context, NumElems);
834 if (const ArrayType *AType = SemaRef.Context.getAsArrayType(ILE->getType())) {
842 ElementEntity = InitializedEntity::InitializeElement(SemaRef.Context,
847 ElementEntity = InitializedEntity::InitializeElement(SemaRef.Context,
876 Filler = new (SemaRef.Context) NoInitExpr(ElementType);
912 ILE->updateInit(SemaRef.Context, Init, Filler);
970 SemaRef.Context.getAsConstantArrayType(DeclType)) {
1180 ExprTy = ExprTy.getNonLValueExprType(SemaRef.Context);
1197 IsStringInit(StructuredList->getInit(0), T, SemaRef.Context) ==
1278 SemaRef.Context.getTypeSize(SemaRef.Context.getSizeType()),
1278 SemaRef.Context.getTypeSize(SemaRef.Context.getSizeType()),
1323 IsStringInit(SubInitList->getInit(0), ElemType, SemaRef.Context) ==
1333 assert(SemaRef.Context.hasSameType(expr->getType(), ElemType) &&
1390 SemaRef.Context.getAsArrayType(ElemType)) {
1395 if (IsStringInit(expr, arrayType, SemaRef.Context) == SIF_None) {
1495 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
1647 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity),
1691 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
1708 bool isBigEndian = SemaRef.Context.getTargetInfo().isBigEndian();
1726 unsigned typeSize = SemaRef.Context.getTypeSize(elementType);
1738 SemaRef.Context.getTypeSize(VT) > 64
1748 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
1769 VecType = SemaRef.Context.getExtVectorType(elementType, numIElts);
1771 VecType = SemaRef.Context.getVectorType(elementType, numIElts,
1820 const ArrayType *arrayType = SemaRef.Context.getAsArrayType(DeclType);
1832 if (IsStringInit(IList->getInit(Index), arrayType, SemaRef.Context) ==
1845 StructuredList->resizeInits(SemaRef.Context, StructuredIndex);
1916 InitializedEntity::InitializeElement(SemaRef.Context, StructuredIndex,
1938 DeclType = SemaRef.Context.getConstantArrayType(
1949 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity),
2014 QualType ET = SemaRef.Context.getBaseElementType(FD->getType());
2065 SemaRef.Context, &Base, false, &Entity);
2116 QualType ET = SemaRef.Context.getBaseElementType(F->getType());
2165 QualType ET = SemaRef.Context.getBaseElementType(Field->getType());
2221 QualType ET = SemaRef.Context.getBaseElementType(I->getType());
2279 DIE->ExpandDesignator(SemaRef.Context, DesigIdx, &Replacements[0],
2289 return DesignatedInitExpr::Create(SemaRef.Context, DIE->designators(),
2454 DesignatedInitUpdateExpr *DIUE = new (SemaRef.Context)
2455 DesignatedInitUpdateExpr(SemaRef.Context, D->getBeginLoc(),
2457 StructuredList->updateInit(SemaRef.Context, StructuredIndex, DIUE);
2589 StructuredList->resizeInits(SemaRef.Context, 0);
2663 StructuredList->resizeInits(SemaRef.Context, FieldIndex + 1);
2787 const ArrayType *AT = SemaRef.Context.getAsArrayType(CurrentObjectType);
2800 DesignatedStartIndex = IndexExpr->EvaluateKnownConstInt(SemaRef.Context);
2806 DIE->getArrayRangeStart(*D)->EvaluateKnownConstInt(SemaRef.Context);
2808 DIE->getArrayRangeEnd(*D)->EvaluateKnownConstInt(SemaRef.Context);
2817 DIE->getInit()->HasSideEffects(SemaRef.Context) && !VerifyOnly)
2840 ConstantArrayType::getMaxSizeBits(SemaRef.Context);
2858 ASTContext &Context = SemaRef.Context;
2917 StructuredList->resizeInits(SemaRef.Context,
2928 InitializedEntity::InitializeElement(SemaRef.Context, 0, Entity);
3032 StructuredList->updateInit(SemaRef.Context, StructuredIndex, Result);
3041 = new (SemaRef.Context) InitListExpr(SemaRef.Context,
3041 = new (SemaRef.Context) InitListExpr(SemaRef.Context,
3047 ResultType = ResultType.getNonLValueExprType(SemaRef.Context);
3054 = SemaRef.Context.getAsArrayType(CurrentObjectType)) {
3068 Result->reserveInits(SemaRef.Context, NumElements);
3082 if (Expr *PrevInit = StructuredList->updateInit(SemaRef.Context,
3212 return DesignatedInitExpr::Create(Context, Designators, InitExpressions,
3829 QualType ArrayType = S.Context.getConstantArrayType(
3831 llvm::APInt(S.Context.getTypeSize(S.Context.getSizeType()),
3831 llvm::APInt(S.Context.getTypeSize(S.Context.getSizeType()),
3900 hasCopyOrMoveCtorParam(S.Context, Info));
3917 hasCopyOrMoveCtorParam(S.Context, Info);
4022 S.Context.hasSameUnqualifiedType(UnwrappedArgs[0]->getType(), DestType)) {
4103 assert(S.Context.hasSameUnqualifiedType(ConvType, DestType) &&
4107 if (!S.Context.hasSameType(ConvType, DestType))
4154 if (S.Context.getCanonicalType(UnqualifiedSourceType) ==
4155 S.Context.OverloadTy) {
4212 QualType T1 = S.Context.getUnqualifiedArrayType(cv1T1, T1Quals);
4224 QualType T2 = S.Context.getUnqualifiedArrayType(cv2T2, T2Quals);
4307 if (S.Context.hasSameUnqualifiedType(InitType, DestType) ||
4317 if (const ArrayType *DestAT = S.Context.getAsArrayType(DestType)) {
4320 IsStringInit(SubInit[0], DestAT, S.Context) == SIF_None) {
4387 !S.Context.hasSameUnqualifiedType(E->getType(), DestType) &&
4598 cv3T3 = cv3T3.getNonLValueExprType(S.Context);
4638 QualType cv1T4 = S.Context.getQualifiedType(cv3T3, cv1T1.getQualifiers());
4667 QualType T1 = S.Context.getUnqualifiedArrayType(cv1T1, T1Quals);
4670 QualType T2 = S.Context.getUnqualifiedArrayType(cv2T2, T2Quals);
4710 Expr::Classification InitCategory = Initializer->Classify(S.Context);
4738 S.Context.getQualifiedType(T2, T1Quals),
4783 if (S.Context.getCanonicalType(T2) == S.Context.OverloadTy)
4783 if (S.Context.getCanonicalType(T2) == S.Context.OverloadTy)
4865 QualType cv1T4 = S.Context.getQualifiedType(cv2T2, T1QualsIgnoreAS);
4874 QualType cv1T4WithAS = S.Context.getQualifiedType(T2, T4Quals);
4926 ? S.Context.getQualifiedType(T1, T1Quals.withoutAddressSpace())
4951 else if (S.Context.getCanonicalType(T2) == S.Context.OverloadTy)
4951 else if (S.Context.getCanonicalType(T2) == S.Context.OverloadTy)
5020 T = S.Context.getBaseElementType(T);
5093 QualType DestType = S.Context.getBaseElementType(Entity.getType());
5281 !S.Context.hasSameUnqualifiedType(ConvType, DestType))
5283 else if (!S.Context.hasSameType(ConvType, DestType))
5391 InvalidICRKind iik = isInvalidICRSource(S.Context, src, false, isWeakAccess);
5429 if (const ArrayType *ArgArrayType = S.Context.getAsArrayType(ArgType)) {
5432 ArgType = S.Context.getPointerType(ArgPointee);
5456 ResultType = S.Context.getPointerType(ArgPointee);
5459 ResultType = Initializer->getType().getNonLValueExprType(S.Context);
5474 (!Initializer->isIntegerConstantExpr(S.Context) &&
5593 ASTContext &Context = S.Context;
5724 S.Context.hasSameUnqualifiedType(Initializer->getType(),
5735 InitializedEntity::InitializeElement(S.Context, 0, Entity);
5757 if (!hasCompatibleArrayTypes(S.Context, DestAT, SourceAT))
5759 else if (Initializer->HasSideEffects(S.Context))
6229 CurInitExpr->isTemporaryObject(S.Context, Class) &&
6230 S.Context.hasSameUnqualifiedType(
6398 hasCopyOrMoveCtorParam(S.Context,
6417 TSInfo = S.Context.getTrivialTypeSourceInfo(Entity.getType(), Loc);
6432 S.Context, Constructor,
6433 Entity.getType().getNonLValueExprType(S.Context), TSInfo,
6490 if (const ArrayType *AT = S.Context.getAsArrayType(Entity.getType()))
6491 if (checkDestructorReference(S.Context.getBaseElementType(AT), Loc, S))
7629 if (!S.Context.hasSameUnqualifiedType(DestType, SourceType)) {
7684 isNullPointerConstant(S.Context, Expr::NPC_ValueDependentIsNotNull)) {
7694 auto MTE = new (Context)
7777 = S.Context.getAsIncompleteArrayType(DeclType)) {
7799 = S.Context.getDependentSizedArrayType(ArrayT->getElementType(),
7973 ImplicitCastExpr::Create(S.Context, Step->Type, CK_DerivedToBase,
8103 CurInit = ImplicitCastExpr::Create(S.Context, CurInit.get()->getType(),
8195 bool IsTemporary = !S.Context.hasSameType(Entity.getType(), Ty);
8210 Ty = S.Context.getRValueReferenceType(Ty);
8212 Ty = S.Context.getLValueReferenceType(Ty,
8262 InitListExpr *ILE = new (S.Context) InitListExpr(S.Context,
8262 InitListExpr *ILE = new (S.Context) InitListExpr(S.Context,
8316 TSInfo = S.Context.getTrivialTypeSourceInfo(Step->Type,
8319 CurInit = new (S.Context) CXXScalarValueInitExpr(
8320 Entity.getType().getNonLValueExprType(S.Context), TSInfo,
8323 CurInit = new (S.Context) ImplicitValueInitExpr(Step->Type);
8368 S.Context.getAsArrayType(Ty), S);
8380 Expr *BaseExpr = new (S.Context)
8384 new (S.Context) ArrayInitIndexExpr(S.Context.getSizeType());
8384 new (S.Context) ArrayInitIndexExpr(S.Context.getSizeType());
8395 CurInit = new (S.Context) ArrayInitLoopExpr(Step->Type, Common,
8413 = S.Context.getAsIncompleteArrayType(Step->Type)) {
8415 = S.Context.getAsConstantArrayType(CurInit.get()->getType())) {
8416 *ResultType = S.Context.getConstantArrayType(
8436 CurInit = new (S.Context) ObjCIndirectCopyRestoreExpr(
8443 ImplicitCastExpr::Create(S.Context, Step->Type, CK_ARCProduceObject,
8458 CurInit = new (S.Context) CXXStdInitializerListExpr(Step->Type, MTE);
8498 CurInit = ImplicitCastExpr::Create(S.Context, Step->Type,
8520 if (!Init->isConstantInitializer(S.Context, false))
8524 32 != S.Context.getIntWidth(SourceType)) {
8531 Init->EvaluateAsInt(EVResult, S.Context);
8556 CurInit = S.ImpCastExprToType(Init, S.Context.OCLSamplerTy,
8658 QualType ArrayType = S.Context.getConstantArrayType(
8660 llvm::APInt(S.Context.getTypeSize(S.Context.getSizeType()),
8660 llvm::APInt(S.Context.getTypeSize(S.Context.getSizeType()),
9023 << S.Context.getTypeDeclType(Constructor->getParent())
9032 << S.Context.getTagDeclType(BaseDecl);
9036 << S.Context.getTypeDeclType(Constructor->getParent())
9047 << S.Context.getTagDeclType(Record->getDecl());
9102 << S.Context.getTypeDeclType(Constructor->getParent())
9511 switch (SCS->getNarrowingKind(S.Context, PostInit, ConstantValue,
9677 return Context.DependentTy;
9696 return Context.DependentTy;
9712 Context.DeclarationNames.getCXXDeductionGuideName(Template),
9873 isCompleteType(Kind.getLocation(), Context.getTypeDeclType(Primary));
tools/clang/lib/Sema/SemaLambda.cpp 231 SemaRef.Context,
251 CXXRecordDecl *Class = CXXRecordDecl::CreateLambda(Context, DC, Info,
329 return std::make_tuple(&Context.getManglingNumberContext(DC), nullptr);
351 &Context.getManglingNumberContext(ASTContext::NeedExtraManglingDecl,
375 Result = SubstAutoType(Result, Context.DependentTy);
376 MethodType = Context.getFunctionType(Result, FPT->getParamTypes(),
387 = Context.DeclarationNames.getCXXOperatorName(OO_Call);
394 Context, Class, EndLoc,
408 FunctionTemplateDecl::Create(Context, Class,
451 return &Context.getManglingNumberContext(
457 return &Context.getManglingNumberContext(DC);
672 if (S.Context.hasSameType(retValue->getType(), returnType))
682 E = ImplicitCastExpr::Create(S.Context, returnType, CK_IntegralCast,
743 CSI.ReturnType = Context.getTypeDeclType(ED);
763 (RetE ? RetE->getType() : Context.VoidTy).getUnqualifiedType();
764 if (Context.getCanonicalFunctionResultType(ReturnType) ==
765 Context.getCanonicalFunctionResultType(CSI.ReturnType)) {
791 QualType DeductType = Context.getAutoDeductType();
804 DeductType = Context.getPackExpansionType(DeductType, NumExpansions);
811 TypeSourceInfo *TSI = TLB.getTypeSourceInfo(Context, DeductType);
856 TypeSourceInfo *TSI = Context.getTrivialTypeSourceInfo(InitCaptureType, Loc);
864 VarDecl *NewVD = VarDecl::Create(Context, CurContext, Loc,
870 NewVD->markUsed(Context);
916 FunctionProtoType::ExtProtoInfo EPI(Context.getDefaultCallingConvention(
927 getLangOpts().CPlusPlus14 ? Context.getAutoDeductType()
928 : Context.DependentTy;
930 Context.getFunctionType(DefaultTypeForNoTrailingReturn, None, EPI);
931 MethodTyInfo = Context.getTrivialTypeSourceInfo(MethodTy);
1264 CallingConv CC = Context.getDefaultCallingConvention(
1270 return Context.getFunctionType(CallOpProto->getReturnType(),
1291 QualType PtrToFunctionTy = S.Context.getPointerType(InvokerFunctionTy);
1295 S.Context.getDefaultCallingConvention(
1302 S.Context.getFunctionType(PtrToFunctionTy, None, ConvExtInfo);
1306 = S.Context.DeclarationNames.getCXXConversionFunctionName(
1307 S.Context.getCanonicalType(PtrToFunctionTy));
1326 S.Context.getTrivialTypeSourceInfo(PtrToFunctionTy, Loc);
1330 TypeSourceInfo *ConvTSI = S.Context.getTrivialTypeSourceInfo(ConvTy, Loc);
1361 S.Context,
1363 S.Context.getTranslationUnitDecl(), From->getBeginLoc(),
1372 S.Context, Class, Loc,
1386 FunctionTemplateDecl::Create(S.Context, Class,
1398 DeclarationName InvokerName = &S.Context.Idents.get(
1412 S.Context, Class, Loc, DeclarationNameInfo(InvokerName, Loc),
1424 S.Context, Class, Loc, InvokerName,
1442 QualType BlockPtrTy = S.Context.getBlockPointerType(FunctionTy);
1445 S.Context.getDefaultCallingConvention(
1449 QualType ConvTy = S.Context.getFunctionType(BlockPtrTy, None, ConversionEPI);
1453 = S.Context.DeclarationNames.getCXXConversionFunctionName(
1454 S.Context.getCanonicalType(BlockPtrTy));
1456 NameLoc.NamedType.TInfo = S.Context.getTrivialTypeSourceInfo(BlockPtrTy, Loc);
1458 S.Context, Class, Loc, DeclarationNameInfo(Name, Loc, NameLoc), ConvTy,
1459 S.Context.getTrivialTypeSourceInfo(ConvTy, Loc),
1557 if (Init && Init->HasSideEffects(Context))
1614 TSI = Context.getTrivialTypeSourceInfo(FieldType, Loc);
1618 FieldDecl::Create(Context, RD, Loc, Loc, nullptr, FieldType, TSI, nullptr,
1802 LambdaExpr *Lambda = LambdaExpr::Create(Context, Class, IntroducerRange,
1868 Context.DeclarationNames.getCXXOperatorName(OO_Call)).front());
1870 CallOperator->markUsed(Context);
1883 BlockDecl *Block = BlockDecl::Create(Context, CurContext, ConvLocation);
1895 Context, Block, From->getBeginLoc(), From->getLocation(),
1908 Context.getTrivialTypeSourceInfo(Src->getType());
1909 VarDecl *CapVar = VarDecl::Create(Context, Block, ConvLocation,
1915 Block->setCaptures(Context, Capture, /*CapturesCXXThis=*/false);
1919 Block->setBody(new (Context) CompoundStmt(ConvLocation));
1922 Expr *BuildBlock = new (Context) BlockExpr(Block, Conv->getConversionType());
tools/clang/lib/Sema/SemaLookup.cpp 320 if (!getSema().Context.BuiltinInfo.isPredefinedLibFunction(BuiltinID))
529 QualType T = getSema().Context.getTypeDeclType(TD);
531 std::make_pair(getSema().Context.getCanonicalType(T), I));
765 ASTContext &Context = S.Context;
864 Context.BuiltinInfo.isPredefinedLibFunction(BuiltinID))
1083 = R.getSema().Context.getFunctionType(R.getLookupName().getCXXNameType(),
1387 if (CppNamespaceLookup(*this, R, Context, Ctx, UDirs)) {
1487 if (CppNamespaceLookup(*this, R, Context, Ctx, UDirs))
1510 Context.mergeDefinitionIntoModule(ND, M);
1570 for (const Module *Merged : Context.getModulesWithMergedDefinition(Def))
1577 for (const Module *Merged : Context.getModulesWithMergedDefinition(Def))
2337 SubobjectType = Context.getCanonicalType(PathElement.Base->getType());
2343 != Context.getCanonicalType(PathElement.Base->getType())) {
2512 Result.setBaseObjectType(Context.getRecordType(Class));
2769 Result.S.Context.getRecordType(Class)))
2950 Result.Namespaces.insert(Result.S.Context.getTranslationUnitDecl());
2996 if (Arg->getType() != Context.OverloadTy) {
3048 DeclarationName OpName = Context.DeclarationNames.getCXXOperatorName(Op);
3114 CanQualType CanTy = Context.getCanonicalType(Context.getTagDeclType(RD));
3114 CanQualType CanTy = Context.getCanonicalType(Context.getTagDeclType(RD));
3123 Name = Context.DeclarationNames.getCXXConstructorName(CanTy);
3132 Name = Context.DeclarationNames.getCXXConstructorName(CanTy);
3144 Name = Context.DeclarationNames.getCXXOperatorName(OO_Equal);
3190 RValueThis ? VK_RValue : VK_LValue).Classify(Context);
3321 CanQualType T = Context.getCanonicalType(Context.getTypeDeclType(Class));
3321 CanQualType T = Context.getCanonicalType(Context.getTypeDeclType(Class));
3322 DeclarationName Name = Context.DeclarationNames.getCXXConstructorName(T);
3418 if (!Context.hasSameUnqualifiedType(ArgTys[ArgIdx], ParamTy)) {
3771 auto &Idents = S.Context.Idents;
4010 Entity = Result.getSema().Context.getTranslationUnitDecl();
4065 Res = LabelDecl::Create(Context, CurContext, Loc, II, GnuLabelLoc);
4079 Res = LabelDecl::Create(Context, CurContext, Loc, II);
4234 TypoCorrection TC(&SemaRef.Context.Idents.get(Name), ND, NNS, ED);
4901 for (const auto &I : Context.Idents)
4907 = Context.Idents.getExternalIdentifierLookup()) {
5311 auto Merged = Context.getModulesWithMergedDefinition(Def);
5480 auto TE = new (Context) TypoExpr(Context.DependentTy);
5480 auto TE = new (Context) TypoExpr(Context.DependentTy);
tools/clang/lib/Sema/SemaModule.cpp 84 auto *TU = Context.getTranslationUnitDecl();
239 auto *TU = Context.getTranslationUnitDecl();
301 auto *TU = Context.getTranslationUnitDecl();
386 ImportDecl *Import = ImportDecl::Create(Context, CurContext, StartLoc,
393 Context.addModuleInitializer(ModuleScopes.back().Module, Import);
431 Context.addModuleInitializer(ModuleScopes.back().Module, ImportD);
527 ExportDecl *D = ExportDecl::Create(Context, CurContext, ExportLoc);
tools/clang/lib/Sema/SemaObjCProperty.cpp 532 if (!Context.hasSameType(PIDecl->getType(), PDecl->getType())) {
541 QualType PrimaryClassPropertyT = Context.getCanonicalType(PIDecl->getType());
542 QualType ClassExtPropertyT = Context.getCanonicalType(PDecl->getType());
604 LookupProtocol(&Context.Idents.get("NSCopying"), AtLoc))
615 T = Context.getObjCObjectPointerType(T);
617 TInfo = Context.getTrivialTypeSourceInfo(T, TLoc);
621 ObjCPropertyDecl *PDecl = ObjCPropertyDecl::Create(Context, DC,
748 ivarType = S.Context.getQualifiedType(split);
873 QualType RHSType = S.Context.getCanonicalType(Property->getType());
937 QualType LHSType = S.Context.getCanonicalType(Prop->getType());
938 if (!S.Context.propertyTypesAreCompatible(LHSType, RHSType)) {
1128 if (LocPropertyAttribute(Context, "readonly",
1212 Context.getObjCGCQualType(PropertyIvarType, Qualifiers::Weak);
1285 PropertyIvarType = Context.getQualifiedType(PropertyIvarType, qs);
1289 Ivar = ObjCIvarDecl::Create(Context, ClassImpDecl,
1331 QualType IvarType = Context.getCanonicalType(Ivar->getType());
1334 if (!Context.hasSameType(PropertyIvarType, IvarType)) {
1338 Context.canAssignObjCInterfaces(
1358 QualType lhsType =Context.getCanonicalType(PropertyIvarType).getUnqualifiedType();
1359 QualType rhsType =Context.getCanonicalType(IvarType).getUnqualifiedType();
1395 ObjCPropertyImplDecl::Create(Context, CurContext, AtLoc, PropertyLoc,
1406 getterMethod->createImplicitParams(Context, IDecl);
1414 DeclRefExpr *SelfExpr = new (Context)
1415 DeclRefExpr(Context, SelfDecl, false, SelfDecl->getType(), VK_LValue,
1419 ImplicitCastExpr::Create(Context, SelfDecl->getType(),
1423 new (Context) ObjCIvarRefExpr(Ivar,
1460 setterMethod->createImplicitParams(Context, IDecl);
1466 DeclRefExpr *SelfExpr = new (Context)
1467 DeclRefExpr(Context, SelfDecl, false, SelfDecl->getType(), VK_LValue,
1471 ImplicitCastExpr::Create(Context, SelfDecl->getType(),
1475 new (Context) ObjCIvarRefExpr(Ivar,
1483 DeclRefExpr *rhs = new (Context)
1484 DeclRefExpr(Context, Param, false, T, VK_LValue, PropertyDiagLoc);
1635 Context.getCanonicalType(SuperProperty->getType());
1637 Context.getCanonicalType(Property->getType());
1639 if (!Context.propertyTypesAreCompatible(LHSType, RHSType)) {
1662 bool compat = Context.hasSameType(PropertyRValueType, GetterType);
1669 compat = Context.canAssignObjCInterfaces(getterObjCPtr, propertyObjCPtr);
1679 QualType lhsType = Context.getCanonicalType(PropertyRValueType);
1680 QualType rhsType =Context.getCanonicalType(GetterType).getUnqualifiedType();
1917 /* ivar = */ Prop->getDefaultSynthIvarName(Context),
2314 PropertyMethod->addAttr(A->clone(S.Context));
2357 if (Context.getCanonicalType(SetterMethod->getReturnType()) !=
2358 Context.VoidTy)
2361 !Context.hasSameUnqualifiedType(
2394 resultTy = Context.getAttributedType(attr::TypeNonNull,
2399 GetterMethod = ObjCMethodDecl::Create(Context, Loc, Loc,
2414 GetterMethod->addAttr(NSReturnsNotRetainedAttr::CreateImplicit(Context,
2419 ObjCReturnsInnerPointerAttr::CreateImplicit(Context, Loc));
2423 Context, SA->getName(), Loc, AttributeCommonInfo::AS_GNU,
2445 ObjCMethodDecl::Create(Context, Loc, Loc,
2446 property->getSetterName(), Context.VoidTy,
2468 paramTy = Context.getAttributedType(attr::TypeNullable,
2475 ParmVarDecl *Argument = ParmVarDecl::Create(Context, SetterMethod,
2482 SetterMethod->setMethodParams(Context, Argument, None);
2489 Context, SA->getName(), Loc, AttributeCommonInfo::AS_GNU,
2654 if (auto nullability = PropertyTy->getNullability(Context)) {
tools/clang/lib/Sema/SemaOpenMP.cpp 1105 TypeSourceInfo *TInfo = SemaRef.Context.getTrivialTypeSourceInfo(Type, Loc);
1107 VarDecl::Create(SemaRef.Context, DC, Loc, Loc, II, Type, TInfo, SC_None);
1116 OMPReferencedVarAttr::CreateImplicit(SemaRef.Context, OrigRef));
1125 D->markUsed(S.Context);
1148 SemaRef.Context.VoidPtrTy, ".task_red.");
1150 buildDeclRefExpr(SemaRef, VD, SemaRef.Context.VoidPtrTy, SR.getBegin());
1171 SemaRef.Context.VoidPtrTy, ".task_red.");
1173 buildDeclRefExpr(SemaRef, VD, SemaRef.Context.VoidPtrTy, SR.getBegin());
1708 if ((Ty->isFloat16Type() && !Context.getTargetInfo().hasFloat16Type()) ||
1710 (Ty->isRealFloatingType() && Context.getTypeSize(Ty) == 128)) &&
1711 !Context.getTargetInfo().hasFloat128Type()) ||
1712 (Ty->isIntegerType() && Context.getTypeSize(Ty) == 128 &&
1713 !Context.getTargetInfo().hasInt128Type()))
1715 << static_cast<unsigned>(Context.getTypeSize(Ty)) << Ty
1716 << Context.getTargetInfo().getTriple().str() << E->getSourceRange();
2066 FD->addAttr(OMPCaptureKindAttr::CreateImplicit(Context, OMPC));
2296 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly;
2313 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly;
2328 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly;
2344 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly;
2358 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly;
2376 return DeclRefExpr::Create(Context, NestedNameSpecifierLoc(),
2432 VD->markUsed(Context);
2454 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly;
2472 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly;
2490 Context, SourceRange(Loc, Loc)));
2491 if (ASTMutationListener *ML = Context.getASTMutationListener())
2496 D = OMPThreadPrivateDecl::Create(Context, getCurLexicalContext(), Loc,
2544 AE->Profile(AEId, S.Context, /*Canonical=*/true);
2545 PAE->Profile(PAEId, S.Context, /*Canonical=*/true);
2589 auto *A = OMPAllocateDeclAttr::CreateImplicit(S.Context, AllocatorKind,
2592 if (ASTMutationListener *ML = S.Context.getASTMutationListener())
2641 bool IsDecl = VD->isThisDeclarationADefinition(Context) ==
2658 auto *D = OMPAllocateDecl::Create(Context, Owner, Loc, Vars, Clauses);
2704 return OMPRequiresDecl::Create(Context, getCurLexicalContext(), Loc,
3066 SemaRef, VD, VD->getType().getNonLValueExprType(SemaRef.Context),
3100 QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1).withConst();
3102 Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
3118 QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1).withConst();
3119 QualType VoidPtrTy = Context.VoidPtrTy.withConst().withRestrict();
3121 Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
3125 QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
3125 QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
3132 Context.getPointerType(CopyFnType).withConst().withRestrict()),
3133 std::make_pair(".task_t.", Context.VoidPtrTy.withConst()),
3142 Context, {}, AttributeCommonInfo::AS_Keyword,
3163 QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1).withConst();
3164 QualType VoidPtrTy = Context.VoidPtrTy.withConst().withRestrict();
3166 Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
3170 QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
3170 QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
3177 Context.getPointerType(CopyFnType).withConst().withRestrict()),
3178 std::make_pair(".task_t.", Context.VoidPtrTy.withConst()),
3187 Context, {}, AttributeCommonInfo::AS_Keyword,
3216 QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1).withConst();
3217 QualType VoidPtrTy = Context.VoidPtrTy.withConst().withRestrict();
3219 Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
3223 QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
3223 QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
3230 Context.getPointerType(CopyFnType).withConst().withRestrict()),
3231 std::make_pair(".task_t.", Context.VoidPtrTy.withConst()),
3240 Context, {}, AttributeCommonInfo::AS_Keyword,
3249 Context.getIntTypeForBitwidth(/*DestWidth=*/32, /*Signed=*/1)
3252 Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/0)
3255 Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/1)
3257 QualType VoidPtrTy = Context.VoidPtrTy.withConst().withRestrict();
3259 Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
3263 QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
3263 QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
3270 Context.getPointerType(CopyFnType).withConst().withRestrict()),
3271 std::make_pair(".task_t.", Context.VoidPtrTy.withConst()),
3285 Context, {}, AttributeCommonInfo::AS_Keyword,
3291 Context.getIntTypeForBitwidth(/*DestWidth=*/32, /*Signed=*/1)
3294 Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/0)
3297 Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/1)
3299 QualType VoidPtrTy = Context.VoidPtrTy.withConst().withRestrict();
3301 Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
3313 QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
3313 QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
3320 Context.getPointerType(CopyFnType).withConst().withRestrict()),
3321 std::make_pair(".task_t.", Context.VoidPtrTy.withConst()),
3335 Context, {}, AttributeCommonInfo::AS_Keyword,
3341 QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1).withConst();
3343 Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
3347 std::make_pair(".previous.lb.", Context.getSizeType().withConst()),
3348 std::make_pair(".previous.ub.", Context.getSizeType().withConst()),
3357 QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1).withConst();
3359 Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
3360 QualType VoidPtrTy = Context.VoidPtrTy.withConst().withRestrict();
3365 QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
3365 QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
3372 Context.getPointerType(CopyFnType).withConst().withRestrict()),
3373 std::make_pair(".task_t.", Context.VoidPtrTy.withConst()),
3382 Context, {}, AttributeCommonInfo::AS_Keyword,
3403 std::make_pair(".previous.lb.", Context.getSizeType().withConst()),
3404 std::make_pair(".previous.ub.", Context.getSizeType().withConst()),
3416 QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1).withConst();
3418 Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
3432 std::make_pair(".previous.lb.", Context.getSizeType().withConst()),
3433 std::make_pair(".previous.ub.", Context.getSizeType().withConst()),
3445 QualType KmpInt32Ty = Context.getIntTypeForBitwidth(32, 1).withConst();
3446 QualType VoidPtrTy = Context.VoidPtrTy.withConst().withRestrict();
3448 Context.getPointerType(KmpInt32Ty).withConst().withRestrict();
3452 QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
3452 QualType CopyFnType = Context.getFunctionType(Context.VoidTy, Args, EPI);
3459 Context.getPointerType(CopyFnType).withConst().withRestrict()),
3460 std::make_pair(".task_t.", Context.VoidPtrTy.withConst()),
3469 Context, {}, AttributeCommonInfo::AS_Keyword,
3623 Context.typesAreCompatible(ThisTy, ThisCapture->getType()))
4947 Context, BS, SL.get(), const_cast<Expr **>(Uniforms.data()),
5002 (LangOpts.EmitAllDecls || Context.DeclMustBeEmitted(Definition)))
5026 Context.getTypeDeclType(Method->getParent()).getTypePtr();
5027 FnPtrType = Context.getMemberPointerType(FD->getType(), ClassType);
5043 FnPtrType = Context.getPointerType(FD->getType());
5192 Context, VariantRef, Score, Data.CtxSet, ST, Data.Ctx,
5233 return OMPParallelDirective::Create(Context, StartLoc, EndLoc, Clauses, AStmt,
5500 bool IsConstant = NewStep->isIntegerConstantExpr(Result, SemaRef.Context);
5931 if (Capture->isEvaluatable(SemaRef.Context, Expr::SE_AllowSideEffects))
6164 ASTContext &C = SemaRef.Context;
6173 if (!SemaRef.Context.hasSameType(Diff.get()->getType(), Type)) {
6191 if (!SemaRef.Context.hasSameType(Diff.get()->getType(), NewType)) {
6274 !SemaRef.Context.hasSameType(Diff.get()->getType(), VarType)) {
6278 !SemaRef.Context.hasSameType(
6280 SemaRef.Context.getUnsignedPointerDiffType())) {
6282 Diff.get(), SemaRef.Context.getUnsignedPointerDiffType(),
6334 SemaRef.Context.BoolTy, /*Action=*/Sema::AA_Casting,
6352 if (!SemaRef.Context.hasSameUnqualifiedType(CondExpr.get()->getType(),
6353 SemaRef.Context.BoolTy))
6355 CondExpr.get(), SemaRef.Context.BoolTy, /*Action=*/Sema::AA_Casting,
6493 Var->getType().getNonLValueExprType(Context),
6733 if (!SemaRef.Context.hasSameType(NewStart.get()->getType(),
6809 if (!SemaRef.Context.hasSameType(Update.get()->getType(),
6827 ASTContext &C = SemaRef.Context;
6844 if (E->isIntegerConstantExpr(Result, SemaRef.Context))
6880 S.Context.getTrivialTypeSourceInfo(S.Context.VoidTy),
6880 S.Context.getTrivialTypeSourceInfo(S.Context.VoidTy),
7048 ASTContext &C = SemaRef.Context;
7095 SemaRef.Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/0);
7097 SemaRef.Context.getIntTypeForBitwidth(/*DestWidth=*/64, /*Signed=*/1);
7118 LastIteration.get()->isIntegerConstantExpr(Result, SemaRef.Context);
7154 QualType Int32Ty = SemaRef.Context.getIntTypeForBitwidth(32, true);
7626 SimdlenLength->EvaluateAsInt(SimdlenResult, S.Context);
7627 SafelenLength->EvaluateAsInt(SafelenResult, S.Context);
7679 return OMPSimdDirective::Create(Context, StartLoc, EndLoc, NestedLoopCount,
7715 return OMPForDirective::Create(Context, StartLoc, EndLoc, NestedLoopCount,
7754 return OMPForSimdDirective::Create(Context, StartLoc, EndLoc, NestedLoopCount,
7792 return OMPSectionsDirective::Create(Context, StartLoc, EndLoc, Clauses, AStmt,
7807 return OMPSectionDirective::Create(Context, StartLoc, EndLoc, AStmt,
7839 return OMPSingleDirective::Create(Context, StartLoc, EndLoc, Clauses, AStmt);
7852 return OMPMasterDirective::Create(Context, StartLoc, EndLoc, AStmt);
7878 Hint = E->EvaluateKnownConstInt(Context);
7897 << C->getHint()->EvaluateKnownConstInt(Context).toString(
7907 auto *Dir = OMPCriticalDirective::Create(Context, DirName, StartLoc, EndLoc,
7953 return OMPParallelForDirective::Create(Context, StartLoc, EndLoc,
7998 Context, StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B);
8037 Context, StartLoc, EndLoc, Clauses, AStmt, DSAStack->isCancelRegion());
8056 return OMPTaskDirective::Create(Context, StartLoc, EndLoc, Clauses, AStmt,
8062 return OMPTaskyieldDirective::Create(Context, StartLoc, EndLoc);
8067 return OMPBarrierDirective::Create(Context, StartLoc, EndLoc);
8072 return OMPTaskwaitDirective::Create(Context, StartLoc, EndLoc);
8086 return OMPTaskgroupDirective::Create(Context, StartLoc, EndLoc, Clauses,
8095 return OMPFlushDirective::Create(Context, StartLoc, EndLoc, Clauses);
8172 return OMPOrderedDirective::Create(Context, StartLoc, EndLoc, Clauses, AStmt);
8723 Checker.getX()->Profile(XId, Context, /*Canonical=*/true);
8724 PossibleX->Profile(PossibleXId, Context, /*Canonical=*/true);
8753 Checker.getX()->Profile(XId, Context, /*Canonical=*/true);
8754 PossibleX->Profile(PossibleXId, Context, /*Canonical=*/true);
8797 PossibleXRHSInFirst->Profile(X1Id, Context,
8799 PossibleXLHSInSecond->Profile(X2Id, Context,
8845 return OMPAtomicDirective::Create(Context, StartLoc, EndLoc, Clauses, AStmt,
8912 return OMPTargetDirective::Create(Context, StartLoc, EndLoc, Clauses, AStmt);
8942 return OMPTargetParallelDirective::Create(Context, StartLoc, EndLoc, Clauses,
8995 return OMPTargetParallelForDirective::Create(Context, StartLoc, EndLoc,
9033 return OMPTargetDataDirective::Create(Context, StartLoc, EndLoc, Clauses,
9070 return OMPTargetEnterDataDirective::Create(Context, StartLoc, EndLoc, Clauses,
9107 return OMPTargetExitDataDirective::Create(Context, StartLoc, EndLoc, Clauses,
9140 return OMPTargetUpdateDirective::Create(Context, StartLoc, EndLoc, Clauses,
9162 return OMPTeamsDirective::Create(Context, StartLoc, EndLoc, Clauses, AStmt);
9177 return OMPCancellationPointDirective::Create(Context, StartLoc, EndLoc,
9194 return OMPCancelDirective::Create(Context, StartLoc, EndLoc, Clauses,
9281 return OMPTaskLoopDirective::Create(Context, StartLoc, EndLoc,
9330 return OMPTaskLoopSimdDirective::Create(Context, StartLoc, EndLoc,
9366 return OMPMasterTaskLoopDirective::Create(Context, StartLoc, EndLoc,
9416 Context, StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B);
9471 Context, StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B);
9495 return OMPDistributeDirective::Create(Context, StartLoc, EndLoc,
9539 Context, StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B,
9597 Context, StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B);
9652 return OMPDistributeSimdDirective::Create(Context, StartLoc, EndLoc,
9708 Context, StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B);
9763 return OMPTargetSimdDirective::Create(Context, StartLoc, EndLoc,
9809 Context, StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B);
9871 Context, StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B);
9933 Context, StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B);
9981 Context, StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B,
10012 return OMPTargetTeamsDirective::Create(Context, StartLoc, EndLoc, Clauses,
10056 Context, StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B);
10110 Context, StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B,
10170 Context, StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B);
10227 Context, StartLoc, EndLoc, NestedLoopCount, Clauses, AStmt, B);
10997 HelperValStmt = buildPreInits(Context, Captures);
11001 return new (Context)
11028 HelperValStmt = buildPreInits(Context, Captures);
11032 return new (Context) OMPFinalClause(ValExpr, HelperValStmt, CaptureRegion,
11097 if (ValExpr->isIntegerConstantExpr(Result, SemaRef.Context) &&
11114 *HelperValStmt = buildPreInits(SemaRef.Context, Captures);
11140 HelperValStmt = buildPreInits(Context, Captures);
11143 return new (Context) OMPNumThreadsClause(
11187 return new (Context)
11200 return new (Context)
11265 return new (Context)
11282 return new (Context)
11305 Context, NumForLoops, NumForLoops ? DSAStack->getAssociatedLoops() : 0,
11440 return new (Context)
11456 return new (Context)
11471 return new (Context) OMPAtomicDefaultMemOrderClause(Kind, KindKwLoc, StartLoc,
11659 if (ValExpr->isIntegerConstantExpr(Result, Context)) {
11672 HelperValStmt = buildPreInits(Context, Captures);
11677 return new (Context)
11787 return new (Context) OMPNowaitClause(StartLoc, EndLoc);
11792 return new (Context) OMPUntiedClause(StartLoc, EndLoc);
11797 return new (Context) OMPMergeableClause(StartLoc, EndLoc);
11802 return new (Context) OMPReadClause(StartLoc, EndLoc);
11807 return new (Context) OMPWriteClause(StartLoc, EndLoc);
11812 return new (Context) OMPUpdateClause(StartLoc, EndLoc);
11817 return new (Context) OMPCaptureClause(StartLoc, EndLoc);
11822 return new (Context) OMPSeqCstClause(StartLoc, EndLoc);
11827 return new (Context) OMPThreadsClause(StartLoc, EndLoc);
11832 return new (Context) OMPSIMDClause(StartLoc, EndLoc);
11837 return new (Context) OMPNogroupClause(StartLoc, EndLoc);
11842 return new (Context) OMPUnifiedAddressClause(StartLoc, EndLoc);
11847 return new (Context) OMPUnifiedSharedMemoryClause(StartLoc, EndLoc);
11852 return new (Context) OMPReverseOffloadClause(StartLoc, EndLoc);
11857 return new (Context) OMPDynamicAllocatorsClause(StartLoc, EndLoc);
12077 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly;
12144 return OMPPrivateClause::Create(Context, StartLoc, LParenLoc, EndLoc, Vars,
12215 QualType ElemType = Context.getBaseElementType(Type).getNonReferenceType();
12224 bool IsConstant = ElemType.isConstant(Context);
12363 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly;
12402 Context.Deallocate(VDInitTemp);
12444 return OMPFirstprivateClause::Create(Context, StartLoc, LParenLoc, EndLoc,
12446 buildPreInits(Context, ExprCaptures));
12547 Type = Context.getBaseElementType(Type).getNonReferenceType();
12604 return OMPLastprivateClause::Create(Context, StartLoc, LParenLoc, EndLoc,
12606 buildPreInits(Context, ExprCaptures),
12658 return OMPSharedClause::Create(Context, StartLoc, LParenLoc, EndLoc, Vars);
12853 SemaRef.Context, /*NamingClass=*/nullptr,
12854 ReductionIdScopeSpec.getWithLocInContext(SemaRef.Context), ReductionId,
12891 SemaRef.Context.hasSameType(D->getType(), Ty))
12909 if (!Paths.isAmbiguous(SemaRef.Context.getCanonicalType(
13060 ASTContext &Context = S.Context;
13696 Context, StartLoc, LParenLoc, ColonLoc, EndLoc, RD.Vars,
13697 ReductionIdScopeSpec.getWithLocInContext(Context), ReductionId,
13699 buildPreInits(Context, RD.ExprCaptures),
13716 Context, StartLoc, LParenLoc, ColonLoc, EndLoc, RD.Vars,
13717 ReductionIdScopeSpec.getWithLocInContext(Context), ReductionId,
13719 buildPreInits(Context, RD.ExprCaptures),
13736 Context, StartLoc, LParenLoc, ColonLoc, EndLoc, RD.Vars,
13737 ReductionIdScopeSpec.getWithLocInContext(Context), ReductionId,
13739 buildPreInits(Context, RD.ExprCaptures),
13778 if (!Ty || (!Ty->isDependentType() && !Ty->isIntegralType(Context) &&
13784 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly;
13910 bool IsConstant = StepExpr->isIntegerConstantExpr(Result, Context);
13921 return OMPLinearClause::Create(Context, StartLoc, LParenLoc, LinKind, LinLoc,
13924 buildPreInits(Context, ExprCaptures),
14063 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly;
14102 return OMPAlignedClause::Create(Context, StartLoc, LParenLoc, ColonLoc,
14163 QualType ElemType = Context.getBaseElementType(Type).getNonReferenceType();
14196 return OMPCopyinClause::Create(Context, StartLoc, LParenLoc, EndLoc, Vars,
14265 VD->isThisDeclarationADefinition(Context) == VarDecl::DeclarationOnly;
14276 Type = Context.getBaseElementType(Type.getNonReferenceType())
14309 return OMPCopyprivateClause::Create(Context, StartLoc, LParenLoc, EndLoc,
14320 return OMPFlushClause::Create(Context, StartLoc, LParenLoc, EndLoc, VarList);
14351 TotalDepCount = OrderedCountExpr->EvaluateKnownConstInt(Context);
14480 auto *C = OMPDependClause::Create(Context, StartLoc, LParenLoc, EndLoc,
14508 HelperValStmt = buildPreInits(Context, Captures);
14511 return new (Context) OMPDeviceClause(ValExpr, HelperValStmt, CaptureRegion,
14524 !QTy.isTrivialType(SemaRef.Context))
15170 SemaRef.Context, /*NamingClass=*/nullptr,
15171 MapperIdScopeSpec.getWithLocInContext(SemaRef.Context), MapperId,
15189 SemaRef.Context.hasSameType(D->getType(), Type))
15207 if (!Paths.isAmbiguous(SemaRef.Context.getCanonicalType(
15539 return OMPMapClause::Create(Context, Locs, MVLI.ProcessedVarList,
15542 MapperIdScopeSpec.getWithLocInContext(Context),
15645 auto *DRD = OMPDeclareReductionDecl::Create(Context, DC, TyData.second,
15657 DeclGroupRef::Create(Context, Decls.begin(), Decls.size()));
15895 auto *DMD = OMPDeclareMapperDecl::Create(Context, DC, StartLoc, Name,
15934 D->CreateClauses(Context, ClauseList);
15960 HelperValStmt = buildPreInits(Context, Captures);
15963 return new (Context) OMPNumTeamsClause(ValExpr, HelperValStmt, CaptureRegion,
15987 HelperValStmt = buildPreInits(Context, Captures);
15990 return new (Context) OMPThreadLimitClause(
16010 return new (Context) OMPPriorityClause(ValExpr, HelperValStmt, CaptureRegion,
16031 return new (Context) OMPGrainsizeClause(ValExpr, HelperValStmt, CaptureRegion,
16052 return new (Context) OMPNumTasksClause(ValExpr, HelperValStmt, CaptureRegion,
16065 return new (Context)
16100 if (ValExpr->isIntegerConstantExpr(Result, Context)) {
16113 HelperValStmt = buildPreInits(Context, Captures);
16118 return new (Context)
16148 return new (Context)
16235 auto *A = OMPDeclareTargetDeclAttr::CreateImplicit(Context, MT, DT,
16238 if (ASTMutationListener *ML = Context.getASTMutationListener())
16336 Context, OMPDeclareTargetDeclAttr::MT_To,
16339 if (ASTMutationListener *ML = Context.getASTMutationListener())
16362 Context, Locs, MVLI.ProcessedVarList, MVLI.VarBaseDeclarations,
16364 MapperIdScopeSpec.getWithLocInContext(Context), MapperId);
16379 Context, Locs, MVLI.ProcessedVarList, MVLI.VarBaseDeclarations,
16381 MapperIdScopeSpec.getWithLocInContext(Context), MapperId);
16465 Context, Locs, MVLI.ProcessedVarList, PrivateCopies, Inits,
16546 return OMPIsDevicePtrClause::Create(Context, Locs, MVLI.ProcessedVarList,
16608 return OMPAllocateClause::Create(Context, StartLoc, LParenLoc, Allocator,
tools/clang/lib/Sema/SemaOverload.cpp 65 DeclRefExpr *DRE = new (S.Context)
66 DeclRefExpr(S.Context, Fn, false, Fn->getType(), VK_LValue, Loc, LocInfo);
71 return S.ImpCastExprToType(DRE, S.Context.getPointerType(DRE->getType()),
1126 QualType OldQType = Context.getCanonicalType(Old->getType());
1127 QualType NewQType = Context.getCanonicalType(New->getType());
1167 !Context.hasSameType(Old->getDeclaredReturnType(),
1234 NewI->getCond()->Profile(NewID, Context, true);
1235 OldI->getCond()->Profile(OldID, Context, true);
1302 = S.Context.getCanonicalType(From->getType().getUnqualifiedType());
1304 = S.Context.getCanonicalType(ToType).getUnqualifiedType();
1398 (S.Context.hasSameUnqualifiedType(FromType, ToType) ||
1412 if (!S.Context.hasSameUnqualifiedType(FromType, ToType))
1479 if (Context.hasSameUnqualifiedType(FromType, ToType))
1489 CanQualType CanTo = Context.getCanonicalType(ToType);
1490 CanQualType CanFrom = Context.getCanonicalType(FromType);
1528 FromFn = Context.adjustFunctionType(FromFn, FromEInfo.withNoReturn(false));
1537 Context.getFunctionTypeWithExceptionSpec(QualType(FromFPT, 0),
1548 if (Context.mergeExtParameterInfo(ToFPT, FromFPT, CanUseToFPT,
1554 QualType QT = Context.getFunctionType(FromFPT->getReturnType(),
1584 if (S.Context.hasSameUnqualifiedType(FromType, ToType))
1606 if (S.Context.areCompatibleVectorTypes(FromType, ToType) ||
1652 if (FromType == S.Context.OverloadTy) {
1664 if (!S.Context.hasSameUnqualifiedType(
1687 = S.Context.getTypeDeclType(Method->getParent()).getTypePtr();
1688 FromType = S.Context.getMemberPointerType(FromType, ClassType);
1693 FromType = S.Context.getPointerType(FromType);
1699 assert(S.Context.hasSameType(
1712 S.Context.getCanonicalType(FromType) != S.Context.OverloadTy) {
1712 S.Context.getCanonicalType(FromType) != S.Context.OverloadTy) {
1733 FromType = S.Context.getArrayDecayedType(FromType);
1761 FromType = S.Context.getPointerType(FromType);
1776 if (S.Context.hasSameUnqualifiedType(FromType, ToType)) {
1800 FromType = S.Context.BoolTy;
1802 ToType->isIntegralType(S.Context)) {
1819 if (&S.Context.getFloatTypeSemantics(FromType) !=
1820 &S.Context.getFloatTypeSemantics(ToType)) {
1821 bool Float128AndLongDouble = ((FromType == S.Context.Float128Ty &&
1822 ToType == S.Context.LongDoubleTy) ||
1823 (FromType == S.Context.LongDoubleTy &&
1824 ToType == S.Context.Float128Ty));
1826 (&S.Context.getFloatTypeSemantics(S.Context.LongDoubleTy) ==
1826 (&S.Context.getFloatTypeSemantics(S.Context.LongDoubleTy) ==
1834 ToType->isIntegralType(S.Context)) ||
1859 S.Context.typesAreCompatible(ToType, FromType)) {
1914 QualType CanonFrom = S.Context.getCanonicalType(FromType);
1915 QualType CanonTo = S.Context.getCanonicalType(ToType);
2016 Context.getTypeSize(FromType) < Context.getTypeSize(ToType))) {
2016 Context.getTypeSize(FromType) < Context.getTypeSize(ToType))) {
2053 return Context.hasSameUnqualifiedType(Underlying, ToType) ||
2060 return Context.hasSameUnqualifiedType(
2086 uint64_t FromSize = Context.getTypeSize(FromType);
2091 Context.IntTy, Context.UnsignedIntTy,
2091 Context.IntTy, Context.UnsignedIntTy,
2092 Context.LongTy, Context.UnsignedLongTy ,
2092 Context.LongTy, Context.UnsignedLongTy ,
2093 Context.LongLongTy, Context.UnsignedLongLongTy
2093 Context.LongLongTy, Context.UnsignedLongLongTy
2096 uint64_t ToSize = Context.getTypeSize(PromoteTypes[Idx]);
2103 return Context.hasSameUnqualifiedType(ToType, PromoteTypes[Idx]);
2125 if (FromType->isIntegralType(Context) &&
2126 MemberDecl->getBitWidth()->isIntegerConstantExpr(BitWidth, Context)) {
2128 ToSize = Context.getTypeSize(ToType);
2298 isNullPointerConstantForConversion(From, InOverloadResolution, Context)) {
2312 isNullPointerConstantForConversion(From, InOverloadResolution, Context)) {
2320 isNullPointerConstantForConversion(From, InOverloadResolution, Context)) {
2330 if (isNullPointerConstantForConversion(From, InOverloadResolution, Context)) {
2343 ToType, Context);
2354 if (Context.hasSameUnqualifiedType(FromPointeeType, ToPointeeType))
2364 ToType, Context,
2374 ToType, Context);
2381 Context.typesAreCompatible(FromPointeeType, ToPointeeType)) {
2384 ToType, Context);
2403 !Context.hasSameUnqualifiedType(FromPointeeType, ToPointeeType) &&
2407 ToType, Context);
2412 Context.areCompatibleVectorTypes(FromPointeeType, ToPointeeType)) {
2415 ToType, Context);
2457 if (Context.hasSameUnqualifiedType(ToObjCPtr->getPointeeType(),
2462 if (Context.canAssignObjCInterfaces(ToObjCPtr, FromObjCPtr)) {
2471 ToType, Context);
2472 ConvertedType = AdoptQualifiers(Context, ConvertedType, FromQualifiers);
2476 if (Context.canAssignObjCInterfaces(FromObjCPtr, ToObjCPtr)) {
2483 ToType, Context);
2484 ConvertedType = AdoptQualifiers(Context, ConvertedType, FromQualifiers);
2497 ConvertedType = AdoptQualifiers(Context, ToType, FromQualifiers);
2506 ConvertedType = AdoptQualifiers(Context, ToType, FromQualifiers);
2528 ConvertedType = Context.getPointerType(ConvertedType);
2529 ConvertedType = AdoptQualifiers(Context, ConvertedType, FromQualifiers);
2539 ConvertedType = Context.getPointerType(ConvertedType);
2540 ConvertedType = AdoptQualifiers(Context, ConvertedType, FromQualifiers);
2555 if (Context.getCanonicalType(FromPointeeType)
2556 == Context.getCanonicalType(ToPointeeType))
2567 if (Context.getCanonicalType(FromFunctionType->getReturnType()) ==
2568 Context.getCanonicalType(ToFunctionType->getReturnType())) {
2585 if (Context.getCanonicalType(FromArgType)
2586 == Context.getCanonicalType(ToArgType)) {
2601 ConvertedType = AdoptQualifiers(Context, ToType, FromQualifiers);
2622 Context.hasSameUnqualifiedType(FromType, ToType))
2664 if (Context.typesAreCompatible(FromPointee, ToPointee))
2672 FromPointee = Context.getQualifiedType(FromPointee, FromQuals);
2673 ConvertedType = Context.getPointerType(FromPointee);
2704 if (Context.hasSameType(FromPointeeType, ToPointeeType))
2719 if (Context.hasSameType(FromFunctionType->getReturnType(),
2729 if (Context.hasSameType(RHS,LHS)) {
2747 if (Context.hasSameType(FromArgType, ToArgType)) {
2761 if (!Context.mergeExtParameterInfo(ToFunctionType, FromFunctionType,
2807 if (!Context.hasSameType(FromMember->getClass(), ToMember->getClass())) {
2833 if (Context.hasSameType(FromType, ToType)) {
2863 if (!Context.hasSameType(FromFunction->getReturnType(),
2901 if (!Context.hasSameType(O->getUnqualifiedType(),
2928 From->isNullPointerConstant(Context, Expr::NPC_ValueDependentIsNotNull) ==
2930 if (Context.hasSameUnqualifiedType(From->getType(), Context.BoolTy))
2930 if (Context.hasSameUnqualifiedType(From->getType(), Context.BoolTy))
2944 !Context.hasSameUnqualifiedType(FromPointeeType, ToPointeeType)) {
2992 if (From->isNullPointerConstant(Context, Expr::NPC_ValueDependentIsNull))
3012 if (From->isNullPointerConstant(Context,
3029 if (!Context.hasSameUnqualifiedType(FromClass, ToClass) &&
3031 ConvertedType = Context.getMemberPointerType(FromTypePtr->getPointeeType(),
3053 assert(From->isNullPointerConstant(Context,
3079 if (Paths.isAmbiguous(Context.getCanonicalType(FromClass).
3127 FromType = Context.getCanonicalType(FromType);
3128 ToType = Context.getCanonicalType(ToType);
3141 while (Context.UnwrapSimilarTypes(FromType, ToType)) {
3211 return UnwrappedAnyPointer && Context.hasSameUnqualifiedType(FromType,ToType);
3274 S.Context, Info.Constructor, ToType);
3355 if (S.Context.hasSameUnqualifiedType(ToType, From->getType()) ||
3404 S.Context, Info.Constructor, ToType);
3812 if (S.Context.hasSameType(SCS.getToType(1), UnderlyingType))
3835 = compareStandardConversionSubsets(S.Context, SCS1, SCS2))
3880 = SCS1.isPointerConversionToVoidPointer(S.Context);
3882 = SCS2.isPointerConversionToVoidPointer(S.Context);
3895 !S.Context.hasSameType(SCS1.getFromType(), SCS2.getFromType())) {
3905 FromType1 = S.Context.getArrayDecayedType(FromType1);
3907 FromType2 = S.Context.getArrayDecayedType(FromType2);
3924 bool AssignLeft = S.Context.canAssignObjCInterfaces(FromObjCPtr1,
3926 bool AssignRight = S.Context.canAssignObjCInterfaces(FromObjCPtr2,
3956 T1 = S.Context.getCanonicalType(T1);
3957 T2 = S.Context.getCanonicalType(T2);
3959 QualType UnqualT1 = S.Context.getUnqualifiedArrayType(T1, T1Quals);
3960 QualType UnqualT2 = S.Context.getUnqualifiedArrayType(T2, T2Quals);
3974 T1 = S.Context.getQualifiedType(UnqualT1, T1Quals);
3976 T2 = S.Context.getQualifiedType(UnqualT2, T2Quals);
3998 S.Context.getTypeSize(SCS1.getFromType()) ==
3999 S.Context.getTypeSize(SCS1.getToType(2)))
4016 bool SCS1IsCompatibleVectorConversion = S.Context.areCompatibleVectorTypes(
4018 bool SCS2IsCompatibleVectorConversion = S.Context.areCompatibleVectorTypes(
4051 T1 = S.Context.getCanonicalType(T1);
4052 T2 = S.Context.getCanonicalType(T2);
4054 QualType UnqualT1 = S.Context.getUnqualifiedArrayType(T1, T1Quals);
4055 QualType UnqualT2 = S.Context.getUnqualifiedArrayType(T2, T2Quals);
4065 T1 = S.Context.getQualifiedType(UnqualT1, T1Quals);
4067 T2 = S.Context.getQualifiedType(UnqualT2, T2Quals);
4082 while (S.Context.UnwrapSimilarTypes(T1, T2)) {
4120 if (S.Context.hasSameUnqualifiedType(T1, T2))
4161 FromType1 = S.Context.getArrayDecayedType(FromType1);
4163 FromType2 = S.Context.getArrayDecayedType(FromType2);
4166 FromType1 = S.Context.getCanonicalType(FromType1);
4167 ToType1 = S.Context.getCanonicalType(ToType1);
4168 FromType2 = S.Context.getCanonicalType(FromType2);
4169 ToType2 = S.Context.getCanonicalType(ToType2);
4223 = S.Context.canAssignObjCInterfaces(FromPtr1, FromPtr2);
4225 = S.Context.canAssignObjCInterfaces(FromPtr2, FromPtr1);
4227 = S.Context.canAssignObjCInterfaces(ToPtr1, ToPtr2);
4229 = S.Context.canAssignObjCInterfaces(ToPtr2, ToPtr1);
4264 if (S.Context.hasSameType(FromType1, FromType2) &&
4285 if (S.Context.hasSameUnqualifiedType(ToType1, ToType2) &&
4333 if (S.Context.hasSameUnqualifiedType(FromType1, FromType2) &&
4334 !S.Context.hasSameUnqualifiedType(ToType1, ToType2)) {
4345 if (!S.Context.hasSameUnqualifiedType(FromType1, FromType2) &&
4346 S.Context.hasSameUnqualifiedType(ToType1, ToType2)) {
4384 QualType T1 = Context.getCanonicalType(OrigT1);
4385 QualType T2 = Context.getCanonicalType(OrigT2);
4387 QualType UnqualT1 = Context.getUnqualifiedArrayType(T1, T1Quals);
4388 QualType UnqualT2 = Context.getUnqualifiedArrayType(T2, T2Quals);
4406 Context.canBindObjCObjectType(UnqualT1, UnqualT2))
4427 T1 = Context.getQualifiedType(UnqualT1, T1Quals);
4429 T2 = Context.getQualifiedType(UnqualT2, T2Quals);
4610 if (S.Context.getCanonicalType(T2) == S.Context.OverloadTy) {
4610 if (S.Context.getCanonicalType(T2) == S.Context.OverloadTy) {
4623 Expr::Classification InitCategory = Init->Classify(S.Context);
4803 isRValRef && Init->Classify(S.Context).isLValue())
4900 if (S.Context.hasSameUnqualifiedType(InitType, ToType) ||
4911 InitializedEntity::InitializeParameter(S.Context, ToType,
4941 X = S.Context.getAsArrayType(ToType)->getElementType();
5002 InitializedEntity::InitializeParameter(S.Context, ToType,
5040 if (S.Context.getCanonicalType(T2) == S.Context.OverloadTy) {
5040 if (S.Context.getCanonicalType(T2) == S.Context.OverloadTy) {
5170 QualType ClassType = S.Context.getTypeDeclType(ActingContext);
5179 QualType ImplicitParamType = S.Context.getQualifiedType(ClassType, Quals);
5215 QualType FromTypeCanon = S.Context.getCanonicalType(FromType);
5236 QualType ClassTypeCanon = S.Context.getCanonicalType(ClassType);
5309 FromClassification = From->Classify(Context);
5371 if (!Context.hasSameType(From->getType(), DestType)) {
5386 return TryImplicitConversion(S, From, S.Context.BoolTy,
5403 return PerformImplicitConversion(From, Context.BoolTy, ICS, AA_Converting);
5405 if (!DiagnoseMultipleUserDefinedConversion(From, Context.BoolTy))
5558 switch (SCS->getNarrowingKind(S.Context, Result.get(), PreNarrowingValue,
5572 << PreNarrowingValue.getAsString(S.Context, PreNarrowingType) << T;
5594 if (!Result.get()->EvaluateAsConstantExpr(Eval, Usage, S.Context) ||
5604 return ConstantExpr::Create(S.Context, Result.get(), Value);
5655 QualType Ty = S.Context.getObjCIdType();
5692 QualType Ty = Context.getObjCIdType();
5759 From = ImplicitCastExpr::Create(SemaRef.Context, Result.get()->getType(),
5788 From = ImplicitCastExpr::Create(SemaRef.Context, Result.get()->getType(),
6136 !IsAcceptableNonMemberOperatorCandidate(Context, Function, Args))
6163 QualType ClassType = Context.getTypeDeclType(Constructor->getParent());
6165 (Context.hasSameUnqualifiedType(ClassType, Args[0]->getType()) ||
6184 QualType C = Context.getRecordType(Constructor->getParent());
6185 QualType D = Context.getRecordType(Shadow->getParent());
6187 if ((Context.hasSameUnqualifiedType(P, C) || IsDerivedFrom(Loc, P, C)) &&
6188 (Context.hasSameUnqualifiedType(D, P) || IsDerivedFrom(Loc, D, P))) {
6333 if (param->getType() == Context.UnknownAnyTy) {
6423 S.Context, Function->getParamDecl(I)),
6448 S.Context, Function->getParamDecl(i)),
6482 Result, Context, Function, llvm::makeArrayRef(ConvertedArgs)))
6543 Result, Context, cast<FunctionDecl>(DIA->getParent()), Args, ThisArg))
6555 return DIA->getCond()->EvaluateAsBooleanCondition(Result, Context) &&
6589 ObjectClassification = E->Classify(Context);
6855 Candidate.DeductionFailure = MakeDeductionFailureInfo(Context, Result,
6922 Candidate.DeductionFailure = MakeDeductionFailureInfo(Context, Result,
7016 if (S.Context.hasSameUnqualifiedType(ConvType, ToNonRefType))
7065 !Context.hasSameUnqualifiedType(Conversion->getConversionType(), ToType))
7107 From->Classify(Context), Conversion, ConversionContext);
7119 = Context.getCanonicalType(From->getType().getUnqualifiedType());
7120 QualType ToCanon = Context.getCanonicalType(ToType).getUnqualifiedType();
7136 DeclRefExpr ConversionRef(Context, Conversion, false, Conversion->getType(),
7139 Context.getPointerType(Conversion->getType()),
7155 QualType CallResultType = ConversionType.getNonLValueExprType(Context);
7255 Candidate.DeductionFailure = MakeDeductionFailureInfo(Context, Result,
7300 Object->Classify(Context), Conversion, ActingContext);
7402 if (CandidateSet.getRewriteInfo().shouldAddReversed(Context, FD))
7411 if (CandidateSet.getRewriteInfo().shouldAddReversed(Context, FD))
7433 DeclarationName OpName = Context.DeclarationNames.getCXXOperatorName(Op);
7466 Args[0]->Classify(Context), Args.slice(1),
7513 assert(ParamTys[ArgIdx] == Context.BoolTy &&
7591 Context(SemaRef.Context) { }
7762 Ty = SemaRef.Context.getArrayDecayedType(Ty);
7823 return S.Context.getAddrSpaceQualType(T, Arg->getType().getAddressSpace());
7836 ParamTypes[0] = S.Context.getLValueReferenceType(
7842 if (!S.Context.getCanonicalType(T).isVolatileQualified()) {
7844 ParamTypes[0] = S.Context.getLValueReferenceType(
7845 AdjustAddressSpaceForBuiltinOperandType(S, S.Context.getVolatileType(T),
7936 ArithmeticTypes.push_back(S.Context.FloatTy);
7937 ArithmeticTypes.push_back(S.Context.DoubleTy);
7938 ArithmeticTypes.push_back(S.Context.LongDoubleTy);
7939 if (S.Context.getTargetInfo().hasFloat128Type())
7940 ArithmeticTypes.push_back(S.Context.Float128Ty);
7945 ArithmeticTypes.push_back(S.Context.IntTy);
7946 ArithmeticTypes.push_back(S.Context.LongTy);
7947 ArithmeticTypes.push_back(S.Context.LongLongTy);
7948 if (S.Context.getTargetInfo().hasInt128Type())
7949 ArithmeticTypes.push_back(S.Context.Int128Ty);
7950 ArithmeticTypes.push_back(S.Context.UnsignedIntTy);
7951 ArithmeticTypes.push_back(S.Context.UnsignedLongTy);
7952 ArithmeticTypes.push_back(S.Context.UnsignedLongLongTy);
7953 if (S.Context.getTargetInfo().hasInt128Type())
7954 ArithmeticTypes.push_back(S.Context.UnsignedInt128Ty);
7959 ArithmeticTypes.push_back(S.Context.BoolTy);
7960 ArithmeticTypes.push_back(S.Context.CharTy);
7961 ArithmeticTypes.push_back(S.Context.WCharTy);
7962 if (S.Context.getLangOpts().Char8)
7963 ArithmeticTypes.push_back(S.Context.Char8Ty);
7964 ArithmeticTypes.push_back(S.Context.Char16Ty);
7965 ArithmeticTypes.push_back(S.Context.Char32Ty);
7966 ArithmeticTypes.push_back(S.Context.SignedCharTy);
7967 ArithmeticTypes.push_back(S.Context.ShortTy);
7968 ArithmeticTypes.push_back(S.Context.UnsignedCharTy);
7969 ArithmeticTypes.push_back(S.Context.UnsignedShortTy);
7985 S.Context.getLValueReferenceType(CandidateTy),
7986 S.Context.IntTy
7996 S.Context.getLValueReferenceType(
7997 S.Context.getVolatileType(CandidateTy));
8006 = S.Context.getLValueReferenceType(
8007 S.Context.getCVRQualifiedType(CandidateTy, Qualifiers::Restrict));
8012 = S.Context.getLValueReferenceType(
8013 S.Context.getCVRQualifiedType(CandidateTy,
8064 if (TypeOfT == S.Context.BoolTy) {
8215 if (!AddedTypes.insert(S.Context.getCanonicalType(*MemPtr)).second)
8223 CanQualType NullPtrTy = S.Context.getCanonicalType(S.Context.NullPtrTy);
8223 CanQualType NullPtrTy = S.Context.getCanonicalType(S.Context.NullPtrTy);
8290 std::make_pair(S.Context.getCanonicalType(FirstParamType),
8291 S.Context.getCanonicalType(SecondParamType)));
8305 if (!AddedTypes.insert(S.Context.getCanonicalType(*Ptr)).second)
8315 CanQualType CanonType = S.Context.getCanonicalType(*Enum);
8352 S.Context.getPointerDiffType(),
8353 S.Context.getPointerDiffType(),
8371 if (!AddedTypes.insert(S.Context.getCanonicalType(*Ptr)).second)
8520 if (!AddedTypes.insert(S.Context.getCanonicalType(*Enum)).second)
8530 if (!AddedTypes.insert(S.Context.getCanonicalType(*MemPtr)).second)
8564 AddedTypes.insert(S.Context.getCanonicalType(*Ptr));
8570 S.Context.getLValueReferenceType(*Ptr),
8571 isEqualOp ? *Ptr : S.Context.getPointerDiffType(),
8581 S.Context.getLValueReferenceType(S.Context.getVolatileType(*Ptr));
8581 S.Context.getLValueReferenceType(S.Context.getVolatileType(*Ptr));
8590 = S.Context.getLValueReferenceType(S.Context.getRestrictType(*Ptr));
8590 = S.Context.getLValueReferenceType(S.Context.getRestrictType(*Ptr));
8597 = S.Context.getLValueReferenceType(
8598 S.Context.getCVRQualifiedType(*Ptr,
8613 if (!AddedTypes.insert(S.Context.getCanonicalType(*Ptr)).second)
8617 S.Context.getLValueReferenceType(*Ptr),
8630 S.Context.getLValueReferenceType(S.Context.getVolatileType(*Ptr));
8630 S.Context.getLValueReferenceType(S.Context.getVolatileType(*Ptr));
8639 = S.Context.getLValueReferenceType(S.Context.getRestrictType(*Ptr));
8639 = S.Context.getLValueReferenceType(S.Context.getRestrictType(*Ptr));
8646 = S.Context.getLValueReferenceType(
8647 S.Context.getCVRQualifiedType(*Ptr,
8682 ParamTypes[0] = S.Context.getLValueReferenceType(LeftBaseTy);
8688 ParamTypes[0] = S.Context.getVolatileType(LeftBaseTy);
8689 ParamTypes[0] = S.Context.getLValueReferenceType(ParamTypes[0]);
8708 ParamTypes[0] = S.Context.getLValueReferenceType(*Vec1);
8714 ParamTypes[0] = S.Context.getVolatileType(*Vec1);
8715 ParamTypes[0] = S.Context.getLValueReferenceType(ParamTypes[0]);
8747 ParamTypes[0] = S.Context.getLValueReferenceType(LeftBaseTy);
8752 ParamTypes[0] = S.Context.getVolatileType(ParamTypes[0]);
8753 ParamTypes[0] = S.Context.getLValueReferenceType(ParamTypes[0]);
8768 QualType ParamTy = S.Context.BoolTy;
8774 QualType ParamTypes[2] = { S.Context.BoolTy, S.Context.BoolTy };
8774 QualType ParamTypes[2] = { S.Context.BoolTy, S.Context.BoolTy };
8795 QualType ParamTypes[2] = { *Ptr, S.Context.getPointerDiffType() };
8808 QualType ParamTypes[2] = { S.Context.getPointerDiffType(), *Ptr };
8863 T = Q1.apply(S.Context, T);
8888 if (!AddedTypes.insert(S.Context.getCanonicalType(*Ptr)).second)
8899 if (!AddedTypes.insert(S.Context.getCanonicalType(*MemPtr)).second)
8914 if (!AddedTypes.insert(S.Context.getCanonicalType(*Enum)).second)
8943 VisibleTypeConversionsQuals += CollectVRQualifiers(Context, Args[ArgIdx]);
9543 if (Context.hasSameType(VA->getType(), VB->getType()))
9555 !Context.hasSameType(EnumA->getIntegerType(),
9799 if (!isFunctionAlwaysEnabled(S.Context, FD)) {
9871 assert(OverloadedExpr->getType() == Context.OverloadTy);
9942 if (FromTy == S.Context.OverloadTy) {
9959 CanQualType CFromTy = S.Context.getCanonicalType(FromTy);
9960 CanQualType CToTy = S.Context.getCanonicalType(ToTy);
10280 QualType NonCanonParam = Qs.apply(S.Context, TParam->getTypeForDecl());
10281 assert(S.Context.hasSameType(Param, NonCanonParam));
10308 if (!T1.isNull() && !T2.isNull() && !S.Context.hasSameType(T1, T2)) {
10741 if (isPointer) FnType = S.Context.getPointerType(FnType);
10742 if (isRValueReference) FnType = S.Context.getRValueReferenceType(FnType);
10743 if (isLValueReference) FnType = S.Context.getLValueReferenceType(FnType);
11267 Context.getCanonicalType(Ret).getUnqualifiedType();
11706 assert(AddressOfExpr->getType() == Context.OverloadTy);
11786 assert(E->getType() == Context.OverloadTy && "SrcExpr must be an overload");
11866 MakeDeductionFailureInfo(Context, Result, Info));
11906 assert(SrcExpr.get()->getType() == Context.OverloadTy);
12199 SemaRef.Context.DeclarationNames.getCXXOperatorName(Op);
12354 CallExpr *CE = CallExpr::Create(Context, Fn, Args, Context.DependentTy,
12354 CallExpr *CE = CallExpr::Create(Context, Fn, Args, Context.DependentTy,
12537 DeclarationName OpName = Context.DeclarationNames.getCXXOperatorName(Op);
12551 llvm::APSInt Zero(Context.getTypeSize(Context.IntTy), false);
12551 llvm::APSInt Zero(Context.getTypeSize(Context.IntTy), false);
12552 Args[1] = IntegerLiteral::Create(Context, Zero, Context.IntTy,
12552 Args[1] = IntegerLiteral::Create(Context, Zero, Context.IntTy,
12561 return new (Context) UnaryOperator(Input, Opc, Context.DependentTy,
12561 return new (Context) UnaryOperator(Input, Opc, Context.DependentTy,
12566 Context, NamingClass, NestedNameSpecifierLoc(), OpNameInfo,
12568 return CXXOperatorCallExpr::Create(Context, Op, Fn, ArgsArray,
12569 Context.DependentTy, VK_RValue, OpLoc,
12620 Context,
12639 ResultTy = ResultTy.getNonLValueExprType(Context);
12643 Context, Op, FnExpr.get(), ArgsArray, ResultTy, VK, OpLoc,
12734 DeclarationName OpName = Context.DeclarationNames.getCXXOperatorName(Op);
12743 return new (Context) BinaryOperator(
12744 Args[0], Args[1], Opc, Context.DependentTy, VK_RValue, OK_Ordinary,
12747 return new (Context) CompoundAssignOperator(
12748 Args[0], Args[1], Opc, Context.DependentTy, VK_LValue, OK_Ordinary,
12749 Context.DependentTy, Context.DependentTy, OpLoc,
12749 Context.DependentTy, Context.DependentTy, OpLoc,
12758 Context, NamingClass, NestedNameSpecifierLoc(), OpNameInfo,
12760 return CXXOperatorCallExpr::Create(Context, Op, Fn, Args,
12761 Context.DependentTy, VK_RValue, OpLoc,
12825 Context.DeclarationNames.getCXXOperatorName(ExtraOp);
12914 InitializedEntity::InitializeParameter(Context,
12930 InitializedEntity::InitializeParameter(Context,
12938 InitializedEntity::InitializeParameter(Context,
12957 ResultTy = ResultTy.getNonLValueExprType(Context);
12960 Context, ChosenOp, FnExpr.get(), Args, ResultTy, VK, OpLoc,
12996 llvm::APSInt Zero(Context.getTypeSize(Context.IntTy), false);
12996 llvm::APSInt Zero(Context.getTypeSize(Context.IntTy), false);
12998 IntegerLiteral::Create(Context, Zero, Context.IntTy, OpLoc);
12998 IntegerLiteral::Create(Context, Zero, Context.IntTy, OpLoc);
13020 R = new (Context) CXXRewrittenBinaryOperator(R.get(), IsReversed);
13103 << Context.getRecordType(Method->getParent())
13133 Context.DeclarationNames.getCXXOperatorName(OO_Subscript);
13144 = UnresolvedLookupExpr::Create(Context, NamingClass,
13151 return CXXOperatorCallExpr::Create(Context, OO_Subscript, Fn, Args,
13152 Context.DependentTy, VK_RValue, RLoc,
13200 Context,
13224 ResultTy = ResultTy.getNonLValueExprType(Context);
13227 CXXOperatorCallExpr::Create(Context, OO_Subscript, FnExpr.get(),
13308 assert(MemExprE->getType() == Context.BoundMemberTy ||
13309 MemExprE->getType() == Context.OverloadTy);
13317 assert(op->getType() == Context.BoundMemberTy);
13324 QualType resultType = proto->getCallResultType(Context);
13348 CXXMemberCallExpr::Create(Context, MemExprE, Args, resultType,
13365 return CallExpr::Create(Context, MemExprE, Args, Context.VoidTy, VK_RValue,
13365 return CallExpr::Create(Context, MemExprE, Args, Context.VoidTy, VK_RValue,
13389 : UnresExpr->getBase()->Classify(Context);
13500 ResultType = ResultType.getNonLValueExprType(Context);
13505 CXXMemberCallExpr::Create(Context, MemExprE, Args, ResultType, VK,
13611 DeclarationName OpName = Context.DeclarationNames.getCXXOperatorName(OO_Call);
13624 Object.get()->Classify(Context), Args, CandidateSet,
13746 Call = ImplicitCastExpr::Create(Context, Call.get()->getType(),
13770 Context.DeclarationNames.getCXXOperatorName(OO_Call), LParenLoc);
13810 Context,
13849 ResultTy = ResultTy.getNonLValueExprType(Context);
13852 CXXOperatorCallExpr::Create(Context, OO_Call, NewFn.get(), MethodArgs,
13885 Context.DeclarationNames.getCXXOperatorName(OO_Arrow);
13899 AddMethodCandidate(Oper.getPair(), Base->getType(), Base->Classify(Context),
13969 ResultTy = ResultTy.getNonLValueExprType(Context);
13971 Context, OO_Arrow, FnExpr.get(), Base, ResultTy, VK, OpLoc, FPOptions());
14036 InitializedEntity::InitializeParameter(Context, FD->getParamDecl(ArgIdx)),
14045 ResultTy = ResultTy.getNonLValueExprType(Context);
14048 Context, Fn.get(), llvm::makeArrayRef(ConvArgs, Args.size()), ResultTy,
14097 UnresolvedLookupExpr::Create(Context, /*NamingClass=*/nullptr,
14142 return new (Context) ParenExpr(PE->getLParen(), PE->getRParen(), SubExpr);
14148 assert(Context.hasSameType(ICE->getSubExpr()->getType(),
14155 return ImplicitCastExpr::Create(Context, ICE->getType(),
14176 Context, GSE->getGenericLoc(), GSE->getControllingExpr(),
14211 = Context.getTypeDeclType(cast<RecordDecl>(Method->getDeclContext()));
14213 = Context.getMemberPointerType(Fn->getType(), ClassType.getTypePtr());
14215 if (Context.getTargetInfo().getCXXABI().isMicrosoft())
14218 return new (Context) UnaryOperator(SubExpr, UO_AddrOf, MemPtrType,
14228 return new (Context) UnaryOperator(SubExpr, UO_AddrOf,
14229 Context.getPointerType(SubExpr->getType()),
14294 type = Context.BoundMemberTy;
tools/clang/lib/Sema/SemaPseudoObject.cpp 62 return new (S.Context) ObjCPropertyRefExpr(
67 return new (S.Context) ObjCPropertyRefExpr(
77 return new (S.Context) ObjCSubscriptRefExpr(
87 return new (S.Context) MSPropertyRefExpr(
99 return new (S.Context) MSPropertySubscriptExpr(
122 return new (S.Context) ParenExpr(parens->getLParen(),
130 return new (S.Context) UnaryOperator(e, uop->getOpcode(),
158 S.Context, gse->getGenericLoc(), gse->getControllingExpr(),
170 return new (S.Context) ChooseExpr(ce->getBuiltinLoc(),
369 new (S.Context) OpaqueValueExpr(GenericLoc, e->getType(),
413 return PseudoObjectExpr::Create(S.Context, syntactic,
456 syntactic = new (S.Context) BinaryOperator(syntacticLHS, capturedRHS,
472 new (S.Context) CompoundAssignOperator(syntacticLHS, capturedRHS, opcode,
517 llvm::APInt oneV(S.Context.getTypeSize(S.Context.IntTy), 1);
517 llvm::APInt oneV(S.Context.getTypeSize(S.Context.IntTy), 1);
518 Expr *one = IntegerLiteral::Create(S.Context, oneV, S.Context.IntTy,
518 Expr *one = IntegerLiteral::Create(S.Context, oneV, S.Context.IntTy,
539 UnaryOperator *syntactic = new (S.Context) UnaryOperator(
542 ? S.Context.getTypeSize(resultType) >=
543 S.Context.getTypeSize(S.Context.IntTy)
543 S.Context.getTypeSize(S.Context.IntTy)
569 S.Context.getObjCInterfaceType(method->getClassInterface()),
585 QualType IT = S.Context.getObjCInterfaceType(PRE->getClassReceiver());
622 &S.Context.Idents.get(setterName->getName().substr(3));
738 QualType receiverType = RefExpr->getReceiverType(S.Context);
771 QualType receiverType = RefExpr->getReceiverType(S.Context);
847 QualType receiverType = RefExpr->getReceiverType(S.Context);
1133 &S.Context.Idents.get("objectForKeyedSubscript")
1135 Selector GetterSelector = S.Context.Selectors.getSelector(1, KeyIdents);
1176 &S.Context.Idents.get("objectForKeyedSubscript")
1178 AtIndexGetterSelector = S.Context.Selectors.getSelector(1, KeyIdents);
1183 &S.Context.Idents.get("objectAtIndexedSubscript")
1186 AtIndexGetterSelector = S.Context.Selectors.getSelector(1, KeyIdents);
1193 AtIndexGetter = ObjCMethodDecl::Create(S.Context, SourceLocation(),
1195 S.Context.getObjCIdType() /*ReturnType*/,
1197 S.Context.getTranslationUnitDecl(),
1203 ParmVarDecl *Argument = ParmVarDecl::Create(S.Context, AtIndexGetter,
1205 arrayRef ? &S.Context.Idents.get("index")
1206 : &S.Context.Idents.get("key"),
1207 arrayRef ? S.Context.UnsignedLongTy
1208 : S.Context.getObjCIdType(),
1212 AtIndexGetter->setMethodParams(S.Context, Argument, None);
1282 &S.Context.Idents.get("setObject"),
1283 &S.Context.Idents.get("forKeyedSubscript")
1285 AtIndexSetterSelector = S.Context.Selectors.getSelector(2, KeyIdents);
1290 &S.Context.Idents.get("setObject"),
1291 &S.Context.Idents.get("atIndexedSubscript")
1293 AtIndexSetterSelector = S.Context.Selectors.getSelector(2, KeyIdents);
1300 QualType ReturnType = S.Context.VoidTy;
1302 S.Context, SourceLocation(), SourceLocation(), AtIndexSetterSelector,
1303 ReturnType, ReturnTInfo, S.Context.getTranslationUnitDecl(),
1309 ParmVarDecl *object = ParmVarDecl::Create(S.Context, AtIndexSetter,
1311 &S.Context.Idents.get("object"),
1312 S.Context.getObjCIdType(),
1317 ParmVarDecl *key = ParmVarDecl::Create(S.Context, AtIndexSetter,
1319 arrayRef ? &S.Context.Idents.get("index")
1320 : &S.Context.Idents.get("key"),
1321 arrayRef ? S.Context.UnsignedLongTy
1322 : S.Context.getObjCIdType(),
1327 AtIndexSetter->setMethodParams(S.Context, Params, None);
1564 return new (Context) UnaryOperator(op, opcode, Context.DependentTy,
1564 return new (Context) UnaryOperator(op, opcode, Context.DependentTy,
1594 return new (Context) BinaryOperator(LHS, RHS, opcode, Context.DependentTy,
1594 return new (Context) BinaryOperator(LHS, RHS, opcode, Context.DependentTy,
1649 return new (Context) UnaryOperator(
1656 return new (Context) CompoundAssignOperator(lhs, rhs, cop->getOpcode(),
1667 return new (Context) BinaryOperator(lhs, rhs, bop->getOpcode(),
tools/clang/lib/Sema/SemaStmt.cpp 69 return new (Context) NullStmt(SemiLoc, HasLeadingEmptyMacro);
79 return new (Context) DeclStmt(DG, StartLoc, EndLoc);
244 if (!E->isUnusedResultAWarning(WarnExpr, Loc, R1, R2, Context))
286 CE->getUnusedResultAttr(Context)),
359 if (T == Context.VoidPtrTy) {
420 return CompoundStmt::Create(Context, Elts, L, R);
492 auto *CS = CaseStmt::Create(Context, LHSVal.get(), RHSVal.get(),
511 DefaultStmt *DS = new (Context) DefaultStmt(DefaultLoc, ColonLoc, SubStmt);
527 LabelStmt *LS = new (Context) LabelStmt(IdentLoc, TheDecl, SubStmt);
544 AttributedStmt *LS = AttributedStmt::Create(Context, AttrLoc, Attrs, SubStmt);
553 CommaVisitor(Sema &SemaRef) : Inherited(SemaRef.Context), SemaRef(SemaRef) {}
570 MakeFullExpr(new (Context) OpaqueValueExpr(SourceLocation(),
571 Context.BoolTy, VK_RValue),
599 return IfStmt::Create(Context, IfLoc, IsConstexpr, InitStmt, Cond.get().first,
749 auto *SS = SwitchStmt::Create(Context, InitStmt, Cond.get().first, CondExpr);
801 QualType EnumType = S.Context.getTypeDeclType(ED);
803 S.Context.hasSameUnqualifiedType(EnumType, VarType))
838 if (S.Context.hasSameUnqualifiedType(CondType, CaseType))
879 unsigned CondWidth = HasDependentValue ? 0 : Context.getIntWidth(CondType);
887 = HasDependentValue ? 0 : Context.getIntWidth(CondTypeBeforePromotion);
935 llvm::APSInt LoVal = LoBeforePromotion->EvaluateKnownConstInt(Context);
968 HasConstantCond = CondExpr->EvaluateAsInt(Result, Context,
1038 llvm::APSInt HiVal = HiBeforePromotion->EvaluateKnownConstInt(Context);
1170 RI->second->getRHS()->EvaluateKnownConstInt(Context);
1215 RI->second->getRHS()->EvaluateKnownConstInt(Context);
1266 if (!Context.hasSameUnqualifiedType(SrcType, DstType) &&
1269 SrcExpr->isIntegerConstantExpr(Context)) {
1271 unsigned DstWidth = Context.getIntWidth(DstType);
1274 llvm::APSInt RhsVal = SrcExpr->EvaluateKnownConstInt(Context);
1331 return WhileStmt::Create(Context, CondVal.first, CondVal.second, Body,
1357 return new (Context) DoStmt(Body, Cond, DoLoc, WhileLoc, CondRParen);
1378 Inherited(S.Context),
1459 Inherited(S.Context), Decls(Decls), FoundDecl(false) {
1628 Inherited(S.Context) {
1804 return new (Context)
1805 ForStmt(Context, First, Second.get().second, Second.get().first, Third,
1869 &Context.Idents.get("countByEnumeratingWithState"),
1870 &Context.Idents.get("objects"),
1871 &Context.Idents.get("count")
1873 Selector selector = Context.Selectors.getSelector(3, &selectorIdents[0]);
1931 OpaqueValueExpr OpaqueId(D->getLocation(), Context.getObjCIdType(),
1979 return new (Context) ObjCForCollectionStmt(First, CollectionExprResult.get(),
2061 TypeSourceInfo *TInfo = SemaRef.Context.getTrivialTypeSourceInfo(Type, Loc);
2062 VarDecl *Decl = VarDecl::Create(SemaRef.Context, DC, Loc, Loc, II, Type,
2136 Context.getAutoRRefDeductType(),
2392 RangeVar->markUsed(Context);
2399 Binding->setType(Context.DependentTy);
2400 LoopVar->setType(SubstAutoType(LoopVar->getType(), Context.DependentTy));
2417 QualType AutoType = Context.getAutoDeductType();
2460 Context, CAT->getSize(), Context.getPointerDiffType(), RangeLoc);
2460 Context, CAT->getSize(), Context.getPointerDiffType(), RangeLoc);
2488 CreateParsedType(VAT->desugar(), Context.getTrivialTypeSourceInfo(
2499 Context.getTrivialTypeSourceInfo(
2586 if (!Context.hasSameType(BeginType, EndType)) {
2623 if (!Context.hasSameType(BeginType, EndType))
2682 return new (Context) CXXForRangeStmt(
2763 SemaRef.Context.getLValueReferenceType(E->getType().withConst());
2802 if (VariableType.isPODType(SemaRef.Context))
2810 << SemaRef.Context.getLValueReferenceType(VariableType)
2880 TheDecl->markUsed(Context);
2881 return new (Context) GotoStmt(TheDecl, GotoLoc, LabelLoc);
2890 QualType DestTy = Context.getPointerType(Context.VoidTy.withConst());
2890 QualType DestTy = Context.getPointerType(Context.VoidTy.withConst());
2908 return new (Context) IndirectGotoStmt(GotoLoc, StarLoc, E);
2928 return new (Context) ContinueStmt(ContinueLoc);
2943 return new (Context) BreakStmt(BreakLoc);
2992 !Context.hasSameUnqualifiedType(ReturnType, VDType))
3020 Context.getDeclAlign(VD) > Context.getTypeAlignInChars(VD->getType()))
3020 Context.getDeclAlign(VD) > Context.getTypeAlignInChars(VD->getType()))
3080 if (!S.Context.hasSameUnqualifiedType(RRefType->getPointeeType(),
3105 Value = ImplicitCastExpr::Create(S.Context, Value->getType(), CK_NoOp,
3160 .isTriviallyCopyableType(Context)) {
3191 .isTriviallyCopyableType(Context)) {
3257 return ReturnStmt::Create(Context, ReturnLoc, RetValExp,
3293 FnRetType = CurCap->ReturnType = Context.DependentTy;
3303 FnRetType = Context.VoidTy;
3386 ReturnStmt::Create(Context, ReturnLoc, RetValExp, NRVOCandidate);
3503 Deduced = SubstAutoType(OrigResultType.getType(), Context.VoidTy);
3528 CanQualType OldDeducedType = Context.getCanonicalFunctionResultType(
3530 CanQualType NewDeducedType = Context.getCanonicalFunctionResultType(
3547 Context.adjustDeducedFunctionResultType(FD, Deduced);
3611 RelatedRetType = Context.getObjCInterfaceType(MD->getClassInterface());
3612 RelatedRetType = Context.getObjCObjectPointerType(RelatedRetType);
3629 return ReturnStmt::Create(Context, ReturnLoc, RetValExp,
3689 Context.VoidTy, CK_ToVoid).get();
3726 Result = ReturnStmt::Create(Context, ReturnLoc, RetValExp,
3750 Result = ReturnStmt::Create(Context, ReturnLoc, /* RetExpr=*/nullptr,
3805 Result = ReturnStmt::Create(Context, ReturnLoc, RetValExp, NRVOCandidate);
3827 return new (Context) ObjCAtCatchStmt(AtLoc, RParen, Var, Body);
3832 return new (Context) ObjCAtFinallyStmt(AtLoc, Body);
3843 return ObjCAtTryStmt::Create(Context, AtLoc, Try, CatchStmts.data(),
3869 return new (Context) ObjCAtThrowStmt(AtLoc, Throw);
3933 return new (Context) ObjCAtSynchronizedStmt(AtLoc, SyncExpr, SyncBody);
3942 return new (Context)
3949 return new (Context) ObjCAutoreleasePoolStmt(AtLoc, Body);
4103 (QualType)Context.getCanonicalType(H->getCaughtType());
4119 CatchTypePublicBases CTPB(Context, HandledTypes, HandlerCHT.isPointer());
4149 return CXXTryStmt::Create(Context, TryLoc, TryBlock, Handlers);
4181 if (!Context.getTargetInfo().isSEHTrySupported())
4184 return SEHTryStmt::Create(Context, IsCXXTry, TryLoc, TryBlock, Handler);
4199 return SEHExceptStmt::Create(Context,Loc,FilterExpr,Block);
4213 return SEHFinallyStmt::Create(Context, Loc, Block);
4225 return new (Context) SEHLeaveStmt(Loc);
4234 return new (Context) MSDependentExistsStmt(KeywordLoc, IsIfExists,
4246 SS.getWithLocInContext(Context),
4260 RD = CXXRecordDecl::Create(Context, TTK_Struct, DC, Loc, Loc,
4263 RD = RecordDecl::Create(Context, TTK_Struct, DC, Loc, Loc, /*Id=*/nullptr);
4271 CD = CapturedDecl::Create(Context, CurContext, NumParams);
4326 IdentifierInfo *ParamName = &Context.Idents.get("__context");
4327 QualType ParamType = Context.getPointerType(Context.getTagDeclType(RD));
4327 QualType ParamType = Context.getPointerType(Context.getTagDeclType(RD));
4329 ImplicitParamDecl::Create(Context, DC, Loc, ParamName, ParamType,
4364 IdentifierInfo *ParamName = &Context.Idents.get("__context");
4365 QualType ParamType = Context.getPointerType(Context.getTagDeclType(RD))
4365 QualType ParamType = Context.getPointerType(Context.getTagDeclType(RD))
4369 ImplicitParamDecl::Create(Context, DC, Loc, ParamName, ParamType,
4375 IdentifierInfo *ParamName = &Context.Idents.get(I->first);
4377 ImplicitParamDecl::Create(Context, DC, Loc, ParamName, I->second,
4386 IdentifierInfo *ParamName = &Context.Idents.get("__context");
4387 QualType ParamType = Context.getPointerType(Context.getTagDeclType(RD));
4387 QualType ParamType = Context.getPointerType(Context.getTagDeclType(RD));
4389 ImplicitParamDecl::Create(Context, DC, Loc, ParamName, ParamType,
tools/clang/lib/Sema/SemaStmtAsm.cpp 98 const Expr *E2 = E->IgnoreParenNoopCasts(S.Context);
267 if (!Context.getTargetInfo().validateOutputConstraint(Info)) {
271 return new (Context)
272 GCCAsmStmt(Context, AsmLoc, IsSimple, IsVolatile, NumOutputs,
301 OutputExpr->isModifiableLvalue(Context, /*Loc=*/nullptr);
310 const Expr *LVal = OutputExpr->IgnoreParenNoopCasts(Context);
327 unsigned Size = Context.getTypeSize(OutputExpr->getType());
328 if (!Context.getTargetInfo().validateOutputSize(Literal->getString(),
332 return new (Context)
333 GCCAsmStmt(Context, AsmLoc, IsSimple, IsVolatile, NumOutputs,
350 if (!Context.getTargetInfo().validateInputConstraint(OutputConstraintInfos,
354 return new (Context)
355 GCCAsmStmt(Context, AsmLoc, IsSimple, IsVolatile, NumOutputs,
386 if (InputExpr->EvaluateAsRValue(EVResult, Context, true)) {
391 Context))
429 unsigned Size = Context.getTypeSize(Ty);
430 if (!Context.getTargetInfo().validateInputSize(Literal->getString(),
444 if (!Context.getTargetInfo().isValidClobber(Clobber)) {
447 return new (Context)
448 GCCAsmStmt(Context, AsmLoc, IsSimple, IsVolatile, NumOutputs,
455 new (Context) GCCAsmStmt(Context, AsmLoc, IsSimple, IsVolatile, NumOutputs,
455 new (Context) GCCAsmStmt(Context, AsmLoc, IsSimple, IsVolatile, NumOutputs,
463 if (unsigned DiagID = NS->AnalyzeAsmString(Pieces, Context, DiagOffs)) {
501 unsigned Size = Context.getTypeSize(Ty);
503 if (!Context.getTargetInfo().validateConstraintModifier(
577 if (Context.hasSameType(InTy, OutTy))
606 uint64_t OutSize = Context.getTypeSize(OutTy);
607 uint64_t InSize = Context.getTypeSize(InTy);
644 InputExpr->isEvaluatable(Context)) {
663 Context.getTargetInfo(), Context);
663 Context.getTargetInfo(), Context);
705 if (isa<clang::EnumType>(T) && Res->EvaluateAsRValue(Eval, Context))
709 unsigned Size = Context.getTypeSizeInChars(T).getQuantity();
711 if (const auto *ATy = Context.getAsArrayType(T))
712 Type = Context.getTypeSizeInChars(ATy->getElementType()).getQuantity();
714 if (Res->EvaluateAsLValue(Eval, Context))
779 LookupResult BaseResult(*this, &Context.Idents.get(Base), SourceLocation(),
810 LookupResult FieldResult(*this, &Context.Idents.get(NextMember),
825 const ASTRecordLayout &RL = Context.getASTRecordLayout(RT->getDecl());
827 CharUnits Result = Context.toCharUnitsFromBits(RL.getFieldOffset(i));
842 NameInfo.setName(&Context.Idents.get(Member));
844 Context, E, T, /*IsArrow=*/false, AsmLoc, NestedNameSpecifierLoc(),
854 LookupResult FieldResult(*this, &Context.Idents.get(Member), AsmLoc,
886 new (Context) MSAsmStmt(Context, AsmLoc, LBraceLoc, IsSimple,
886 new (Context) MSAsmStmt(Context, AsmLoc, LBraceLoc, IsSimple,
901 Label->markUsed(Context);
tools/clang/lib/Sema/SemaStmtAttr.cpp 26 FallThroughAttr Attr(S.Context, A);
50 return ::new (S.Context) FallThroughAttr(S.Context, A);
50 return ::new (S.Context) FallThroughAttr(S.Context, A);
72 return ::new (S.Context) SuppressAttr(
73 S.Context, A, DiagnosticIdentifiers.data(), DiagnosticIdentifiers.size());
170 return LoopHintAttr::CreateImplicit(S.Context, Option, State, ValueExpr, A);
257 PrintingPolicy Policy(S.Context.getLangOpts());
301 if (!E->isIntegerConstantExpr(ArgVal, S.Context)) {
318 return OpenCLUnrollHintAttr::CreateImplicit(S.Context, UnrollFactor);
tools/clang/lib/Sema/SemaTemplate.cpp 147 TName = Context.DeclarationNames.getCXXOperatorName(
152 TName = Context.DeclarationNames.getCXXLiteralOperatorName(Name.Identifier);
169 TemplateResult = TemplateTy::make(Context.getAssumedTemplateName(TName));
221 Template = Context.getOverloadedTemplateName(R.begin(), R.end());
242 Template = Context.getQualifiedTemplateName(Qualifier,
321 = TemplateTy::make(Context.getDependentTemplateName(Qualifier, &II));
706 Context, /*This*/ nullptr, ThisType, /*IsArrow*/ true,
707 /*Op*/ SourceLocation(), SS.getWithLocInContext(Context), TemplateKWLoc,
720 NestedNameSpecifierLoc QualifierLoc = SS.getWithLocInContext(Context);
725 Context, QualifierLoc, TemplateKWLoc, NameInfo, TemplateArgs);
765 InstantiationTy = Context.getTypeDeclType(TD);
874 DI = SemaRef.Context.getTrivialTypeSourceInfo(T, Arg.getLocation());
892 SemaRef.Context),
949 Name = Context.getQualifiedTemplateName(SS.getScopeRep(),
991 Context, Context.getTranslationUnitDecl(), KeyLoc, ParamNameLoc, Depth,
991 Context, Context.getTranslationUnitDecl(), KeyLoc, ParamNameLoc, Depth,
1052 TSI = SubstAutoTypeSourceInfo(TSI, Context.DependentTy);
1096 return Context.getDecayedType(T);
1186 T = Context.IntTy; // Recover with an 'int' type.
1195 Context, Context.getTranslationUnitDecl(), D.getBeginLoc(),
1195 Context, Context.getTranslationUnitDecl(), D.getBeginLoc(),
1264 TemplateTemplateParmDecl::Create(Context, Context.getTranslationUnitDecl(),
1264 TemplateTemplateParmDecl::Create(Context, Context.getTranslationUnitDecl(),
1319 Param->setDefaultArgument(Context, DefaultArg);
1340 Context, TemplateLoc, LAngleLoc,
1348 T->setQualifierInfo(SS.getWithLocInContext(S.Context));
1614 CXXRecordDecl::Create(Context, Kind, SemanticContext, KWLoc, NameLoc, Name,
1621 Context, llvm::makeArrayRef(OuterTemplateParamLists,
1632 = ClassTemplateDecl::Create(Context, SemanticContext, NameLoc,
1646 T = Context.getInjectedClassNameType(NewClass, T);
1699 Context, CurContext, NewClass->getLocation(), NewTemplate, FriendLoc);
1751 SemaRef.Context.DeclarationNames.getCXXDeductionGuideName(Template);
1753 QualType DeducedType = SemaRef.Context.getTypeDeclType(Primary);
1792 SubstArgs.push_back(SemaRef.Context.getCanonicalTemplateArgument(
1793 SemaRef.Context.getInjectedTemplateArg(NewParam)));
1796 SemaRef.Context, InnerParams->getTemplateLoc(),
1822 TypeSourceInfo *NewTInfo = TLB.getTypeSourceInfo(SemaRef.Context, NewType);
1838 TypeSourceInfo *TSI = SemaRef.Context.getTrivialTypeSourceInfo(Result, Loc);
1847 SemaRef.Context, DC, Loc, Loc, nullptr, T,
1848 SemaRef.Context.getTrivialTypeSourceInfo(T, Loc), SC_None, nullptr);
1868 SemaRef.Context, DC, TTP->getBeginLoc(), TTP->getLocation(),
1990 ParmVarDecl *NewParam = ParmVarDecl::Create(SemaRef.Context, DC,
2014 CXXDeductionGuideDecl::Create(SemaRef.Context, DC, LocStart, ES, Name,
2023 SemaRef.Context, DC, Loc, DeductionGuideName, TemplateParams, Guide);
2290 NewTypeParm->setInheritedDefaultArgument(Context, OldTypeParm);
2335 NewNonTypeParm->setInheritedDefaultArgument(Context, OldNonTypeParm);
2379 NewTemplateParm->setInheritedDefaultArgument(Context, OldTemplateParm);
2625 T = Context.getTypeDeclType(Record);
2655 T = Context.getTypeDeclType(Parent);
2665 T = Context.getTypeDeclType(Parent);
2699 T = Context.getTypeDeclType(Parent);
2840 << getRangeOfTypeInNestedNameSpecifier(Context, T, SS);
2852 getRangeOfTypeInNestedNameSpecifier(Context, T, SS)))
2890 << getRangeOfTypeInNestedNameSpecifier(Context, T, SS);
2907 return TemplateParameterList::Create(Context, SourceLocation(),
3176 if (Term->EvaluateAsBooleanCondition(Succeeded, Context) &&
3206 return Context.getDependentTemplateSpecializationType(ETK_None,
3218 return Context.getTemplateSpecializationType(Name, TemplateArgs);
3306 CanonType = Context.getCanonicalTemplateSpecializationType(Name, Converted);
3331 QualType ICNT = Context.getTypeDeclType(Record);
3357 Context, ClassTemplate->getTemplatedDecl()->getTagKind(),
3376 CanonType = Context.getTypeDeclType(Decl);
3387 return Context.getTemplateSpecializationType(Name, TemplateArgs, CanonType);
3499 = Context.getDependentTemplateSpecializationType(ETK_None,
3508 SpecTL.setQualifierLoc(SS.getWithLocInContext(Context));
3515 return CreateParsedType(T, TLB.getTypeSourceInfo(Context, T));
3538 Result = Context.getElaboratedType(ETK_None, SS.getScopeRep(), Result);
3541 ElabTL.setQualifierLoc(SS.getWithLocInContext(Context));
3544 return CreateParsedType(Result, TLB.getTypeSourceInfo(Context, Result));
3569 QualType T = Context.getDependentTemplateSpecializationType(Keyword,
3579 SpecTL.setQualifierLoc(SS.getWithLocInContext(Context));
3586 return CreateParsedType(T, TLB.getTypeSourceInfo(Context, T));
3633 Result = Context.getElaboratedType(Keyword, SS.getScopeRep(), Result);
3636 ElabTL.setQualifierLoc(SS.getWithLocInContext(Context));
3637 return CreateParsedType(Result, TLB.getTypeSourceInfo(Context, Result));
3945 Context, VarTemplate->getDeclContext(), TemplateKWLoc,
3963 Context, VarTemplate->getDeclContext(), TemplateKWLoc, TemplateNameLoc,
4100 MakeDeductionFailureInfo(Context, Result, Info));
4259 return ConceptSpecializationExpr::Create(Context,
4260 SS.isSet() ? SS.getWithLocInContext(Context) : NestedNameSpecifierLoc{},
4262 ASTTemplateArgumentListInfo::Create(Context, *TemplateArgs), Converted,
4317 = UnresolvedLookupExpr::Create(Context, R.getNamingClass(),
4318 SS.getWithLocInContext(Context),
4460 Result = TemplateTy::make(Context.getDependentTemplateName(Qualifier,
4465 Result = TemplateTy::make(Context.getDependentTemplateName(Qualifier,
4546 Context.getDependentNameType(ETK_Typename, SS.getScopeRep(), II);
4550 TL.setQualifierLoc(SS.getWithLocInContext(Context));
4552 TSI = TLB.getTypeSourceInfo(Context, ArgType);
4580 ArgType = Context.getCanonicalType(ArgType);
4590 ArgType = Context.getQualifiedType(ArgType, Qs);
5008 Context, SS.getWithLocInContext(Context), TemplateKWLoc, NameInfo,
5008 Context, SS.getWithLocInContext(Context), TemplateKWLoc, NameInfo,
5243 TemplateArgument::CreatePackCopy(Context, ArgumentPack));
5323 TemplateArgument::CreatePackCopy(Context, ArgumentPack));
5341 TemplateArgument::CreatePackCopy(Context, ArgumentPack));
5687 << S.Context.getTypeDeclType(Tag) << SR;
5736 } else if (Context.hasSameUnqualifiedType(Arg, Context.OverloadTy)) {
5736 } else if (Context.hasSameUnqualifiedType(Arg, Context.OverloadTy)) {
5749 (void)Finder.Visit(Context.getCanonicalType(Arg));
5791 if (!Arg->EvaluateAsRValue(EvalResult, S.Context) ||
5826 if (S.Context.hasSameUnqualifiedType(Arg->getType(), ParamType) ||
5841 if (Arg->isNullPointerConstant(S.Context, Expr::NPC_NeverValueDependent)) {
5897 if (!S.Context.hasSameUnqualifiedType(ArgType,
6022 Converted = TemplateArgument(S.Context.getCanonicalType(ParamType),
6107 ArgType = S.Context.getPointerType(Func->getType());
6112 if (!S.Context.hasSameUnqualifiedType(Func->getType(),
6151 if (!S.Context.hasSameUnqualifiedType(Var->getType(),
6169 ArgType = S.Context.getArrayDecayedType(Var->getType());
6174 ArgType = S.Context.getPointerType(Var->getType());
6175 if (!S.Context.hasSameUnqualifiedType(ArgType, ParamType)) {
6276 Converted = TemplateArgument(S.Context.getCanonicalType(ParamType),
6289 } else if (!S.Context.hasSameUnqualifiedType(
6365 Context.getTrivialTypeSourceInfo(ParamType, Param->getLocation()),
6390 !Context.hasSameType(ParamType.getNonLValueExprType(Context),
6390 !Context.hasSameType(ParamType.getNonLValueExprType(Context),
6426 Arg, ParamType.getNonLValueExprType(Context), CK_Dependent,
6433 E = new (Context)
6463 QualType CanonParamType = Context.getCanonicalType(ParamType);
6476 Converted = TemplateArgument(Context, Value.getInt(), CanonParamType);
6527 << Value.getAsString(Context, ParamType);
6598 Value = Value.extOrTrunc(Context.getTypeSize(IntegerType));
6600 Converted = TemplateArgument(Context, Value,
6601 Context.getCanonicalType(ParamType));
6649 if (Context.hasSameType(ParamType, ArgType)) {
6676 QualType IntegerType = Context.getCanonicalType(ParamType);
6678 IntegerType = Context.getCanonicalType(Enum->getDecl()->getIntegerType());
6683 unsigned AllowedBits = Context.getTypeSize(IntegerType);
6692 unsigned AllowedBits = Context.getTypeSize(IntegerType);
6722 Converted = TemplateArgument(Context, Value,
6724 ? Context.getCanonicalType(ParamType)
6756 if (Arg->getType() == Context.OverloadTy) {
6808 if (Arg->getType() == Context.OverloadTy) {
6848 Converted = TemplateArgument(Context.getCanonicalType(ParamType),
6949 ParamType = Context.getArrayDecayedType(ParamType);
6951 ParamType = Context.getPointerType(ParamType);
6957 new (Context) CXXNullPtrLiteralExpr(Context.NullPtrTy, Loc),
6957 new (Context) CXXNullPtrLiteralExpr(Context.NullPtrTy, Loc),
6978 = Context.getTypeDeclType(cast<RecordDecl>(VD->getDeclContext()));
6980 = NestedNameSpecifier::Create(Context, nullptr, false,
6983 SS.MakeTrivial(Context, Qualifier, Loc);
7012 Context.hasSameType(((Expr*) RefExpr.get())->getType(),
7027 if (!Context.hasSameUnqualifiedType(ParamType->getPointeeType(), T) &&
7048 T = Context.getQualifiedType(T,
7095 E = new (Context) CharacterLiteral(Arg.getAsIntegral().getZExtValue(),
7098 E = new (Context) CXXBoolLiteralExpr(Arg.getAsIntegral().getBoolValue(),
7101 E = new (Context) CXXNullPtrLiteralExpr(Context.NullPtrTy, Loc);
7101 E = new (Context) CXXNullPtrLiteralExpr(Context.NullPtrTy, Loc);
7103 E = IntegerLiteral::Create(Context, Arg.getAsIntegral(), T, Loc);
7109 E = CStyleCastExpr::Create(Context, OrigT, VK_RValue, CK_IntegralCast, E,
7111 Context.getTrivialTypeSourceInfo(OrigT, Loc),
7181 if (!S.Context.hasSameType(OldNTTP->getType(), NewNTTP->getType())) {
7355 OldRC->Profile(OldRCID, Context, /*Canonical=*/true);
7356 NewRC->Profile(NewRCID, Context, /*Canonical=*/true);
7843 TemplateName CanonTemplate = Context.getCanonicalTemplateName(Name);
7844 CanonType = Context.getTemplateSpecializationType(CanonTemplate,
7847 if (Context.hasSameType(CanonType,
7874 = ClassTemplatePartialSpecializationDecl::Create(Context, Kind,
7886 Context, TemplateParameterLists.drop_back(1));
7903 = ClassTemplateSpecializationDecl::Create(Context, Kind,
7911 Specialization->setTemplateParameterListsInfo(Context,
7919 TemplateName CanonTemplate = Context.getCanonicalTemplateName(Name);
7920 CanonType = Context.getTemplateSpecializationType(
7923 CanonType = Context.getTypeDeclType(Specialization);
7946 << Context.getTypeDeclType(Specialization) << Range;
7999 = Context.getTemplateSpecializationTypeInfo(Name, TemplateNameLoc,
8021 FriendDecl *Friend = FriendDecl::Create(Context, CurContext,
8070 ConceptDecl *NewDecl = ConceptDecl::Create(Context, DC, NameLoc, Name,
8366 FD->setDependentTemplateSpecialization(Context, Previous.asUnresolvedSet(),
8429 FT = Context.getFunctionType(FPT->getReturnType(),
8455 MakeDeductionFailureInfo(Context, TDK, Info));
8471 MakeDeductionFailureInfo(Context, TDK_CUDATargetMismatch, Info));
8591 const TemplateArgumentList* TemplArgs = new (Context)
8649 if (Context.hasSameType(Adjusted, Method->getType())) {
8993 !Context.getTargetInfo().getTriple().isWindowsGNUEnvironment()) {
9016 Context.getTargetInfo().getCXXABI().isMicrosoft()) {
9056 Context.getTargetInfo().getTriple().isWindowsGNUEnvironment()) {
9108 = ClassTemplateSpecializationDecl::Create(Context, Kind,
9130 = Context.getTemplateSpecializationTypeInfo(Name, TemplateNameLoc,
9132 Context.getTypeDeclType(Specialization));
9187 (Context.getTargetInfo().getCXXABI().isMicrosoft() ||
9188 Context.getTargetInfo().getTriple().isWindowsItaniumEnvironment())) {
9205 (Context.getTargetInfo().getCXXABI().isMicrosoft() ||
9206 Context.getTargetInfo().getTriple().isWindowsItaniumEnvironment())) {
9227 Context.getTargetInfo().getTriple().isWindowsGNUEnvironment() &&
9277 << Context.getTypeDeclType(Record);
9551 if (PrevTemplate && Prev && !Context.hasSameType(Prev->getType(), R)) {
9588 if (Context.hasSameUnqualifiedType(Method->getType(), Adjusted)) {
9614 MakeDeductionFailureInfo(Context, TDK, Info));
9630 MakeDeductionFailureInfo(Context, TDK_CUDATargetMismatch, Info));
9726 Context.getTargetInfo().getCXXABI().isMicrosoft())
9784 QualType Result = Context.getDependentNameType(Kwd, NNS, Name);
9790 TL.setQualifierLoc(SS.getWithLocInContext(Context));
9792 return CreateParsedType(Result, TLB.getTypeSourceInfo(Context, Result));
9809 NestedNameSpecifierLoc QualifierLoc = SS.getWithLocInContext(Context);
9815 TypeSourceInfo *TSI = Context.CreateTypeSourceInfo(T);
9871 QualType T = Context.getDependentTemplateSpecializationType(ETK_Typename,
9881 SpecTL.setQualifierLoc(SS.getWithLocInContext(Context));
9888 return CreateParsedType(T, Builder.getTypeSourceInfo(Context, T));
9906 T = Context.getElaboratedType(ETK_Typename, SS.getScopeRep(), T);
9909 TL.setQualifierLoc(SS.getWithLocInContext(Context));
9911 TypeSourceInfo *TSI = Builder.getTypeSourceInfo(Context, T);
9980 return Context.getDependentNameType(Keyword,
10050 return Context.getDependentNameType(Keyword,
10081 return Context.getElaboratedType(Keyword,
10083 Context.getTypeDeclType(Type));
10092 return Context.getElaboratedType(
10094 Context.getDeducedTemplateSpecializationType(TemplateName(TD),
10215 NestedNameSpecifierLoc QualifierLoc = SS.getWithLocInContext(Context);
10263 NewTSI = SubstAutoTypeSourceInfo(NewTSI, Context.DependentTy);
tools/clang/lib/Sema/SemaTemplateDeduction.cpp 383 S.Context, Deduced[NTTP->getIndex()], NewDeduced);
404 QualType ParamType = S.Context.getAdjustedParameterType(NTTP->getType());
428 DeducedTemplateArgument(S.Context, Value, ValueType,
441 S.ImpCastExprToType(new (S.Context) CXXNullPtrLiteralExpr(
442 S.Context.NullPtrTy, NTTP->getLocation()),
498 DeducedTemplateArgument NewDeduced(S.Context.getCanonicalTemplateName(Arg));
499 DeducedTemplateArgument Result = checkDeducedTemplateArguments(S.Context,
514 if (S.Context.hasSameTemplateName(Param, Arg))
748 MarkUsedTemplateParameters(S.Context, Pattern, /*OnlyDeduced*/true,
894 new (S.Context) TemplateArgument[Pack.New.size()];
923 checkDeducedTemplateArguments(S.Context, OldPack, NewPack);
929 Result = checkDeducedTemplateArguments(S.Context, OldPack, NewPack);
1158 return Arg == Context.getCanonicalType(AdjustedParam);
1226 QualType Param = S.Context.getCanonicalType(ParamIn);
1227 QualType Arg = S.Context.getCanonicalType(ArgIn);
1249 if (ParamRef && ArgRef && S.Context.hasSameUnqualifiedType(Param, Arg)) {
1299 QualType UnqualParam = S.Context.getUnqualifiedArrayType(Param, Quals);
1302 Param = S.Context.getQualifiedType(UnqualParam, Quals);
1345 Arg = S.Context.getUnqualifiedArrayType(Arg, Quals);
1347 Arg = S.Context.getQualifiedType(Arg, Quals);
1370 assert(Arg != S.Context.OverloadTy && "Unresolved overloaded function");
1404 DeducedType = S.Context.getQualifiedType(DeducedType.getUnqualifiedType(),
1408 DeducedType = S.Context.getCanonicalType(DeducedType);
1411 DeducedTemplateArgument Result = checkDeducedTemplateArguments(S.Context,
1437 CanQualType CanParam = S.Context.getCanonicalType(Param);
1438 CanQualType CanArg = S.Context.getCanonicalType(Arg);
1453 Arg = S.Context.getUnqualifiedArrayType(Arg, Quals);
1454 Arg = S.Context.getQualifiedType(Arg, Param.getQualifiers());
1583 S.Context.getAsIncompleteArrayType(Arg);
1589 S.Context.getAsIncompleteArrayType(Param)->getElementType(),
1597 S.Context.getAsConstantArrayType(Arg);
1602 S.Context.getAsConstantArrayType(Param);
1615 const ArrayType *ArrayArg = S.Context.getAsArrayType(Arg);
1623 = S.Context.getAsDependentSizedArrayType(Param);
1645 S.Context.getSizeType(),
1717 S, TemplateParams, NTTP, Noexcept, S.Context.BoolTy,
1958 llvm::APSInt ArgSize(S.Context.getTypeSize(S.Context.IntTy), false);
1958 llvm::APSInt ArgSize(S.Context.getTypeSize(S.Context.IntTy), false);
1964 S.Context.UnsignedIntTy, true,
2011 llvm::APSInt ArgSize(S.Context.getTypeSize(S.Context.IntTy), false);
2011 llvm::APSInt ArgSize(S.Context.getTypeSize(S.Context.IntTy), false);
2017 S.Context.IntTy, true, Info,
2073 llvm::APSInt ArgAddressSpace(S.Context.getTypeSize(S.Context.IntTy),
2073 llvm::APSInt ArgAddressSpace(S.Context.getTypeSize(S.Context.IntTy),
2081 S.Context.removeAddrSpaceQualType(Arg), Info, Deduced, TDF))
2091 ArgAddressSpace, S.Context.IntTy,
2166 S.Context.hasSameType(Param.getNullPtrType(), Arg.getNullPtrType()))
2451 Arg, Context.getTrivialTypeSourceInfo(Arg.getAsType(), Loc));
2481 Builder.MakeTrivial(Context, DTN->getQualifier(), Loc);
2484 Builder.MakeTrivial(Context, QTN->getQualifier(), Loc);
2487 return TemplateArgumentLoc(Arg, Builder.getWithLocInContext(Context),
2490 return TemplateArgumentLoc(Arg, Builder.getWithLocInContext(Context),
2587 TemplateArgument::CreatePackCopy(S.Context, PackedArgsBuilder));
2646 Info.reset(TemplateArgumentList::CreateCopy(S.Context, Builder));
2670 Info.reset(TemplateArgumentList::CreateCopy(S.Context, Builder));
2684 Info.reset(TemplateArgumentList::CreateCopy(S.Context, Builder));
2738 = TemplateArgumentList::CreateCopy(S.Context, Builder);
2778 if (!isSameTemplateArg(S.Context, TemplateArgs[I], InstArg)) {
2819 if (!isSameTemplateArg(S.Context, TemplateArgs[I], InstArg,
3021 = TemplateArgumentList::CreateCopy(Context, Builder);
3164 ASTContext &Context = S.Context;
3357 = TemplateArgumentList::CreateCopy(Context, Builder);
3464 return S.Context.getMemberPointerType(Fn->getType(),
3465 S.Context.getTypeDeclType(Method->getParent()).getTypePtr());
3469 return S.Context.getPointerType(Fn->getType());
3547 ArgType = S.Context.getPointerType(ArgType);
3600 if (ArgType == S.Context.OverloadTy) {
3620 ArgType = S.Context.getLValueReferenceType(ArgType);
3628 ArgType = S.Context.getArrayDecayedType(ArgType);
3633 ArgType = S.Context.getPointerType(ArgType);
3703 auto *ArrTy = S.Context.getAsArrayType(AdjustedParamType);
3738 QualType T = S.Context.getSizeType();
3739 llvm::APInt Size(S.Context.getIntWidth(T), ILE->getNumInits());
3993 return Context.getFunctionType(ArgFunctionTypeP->getReturnType(),
4075 FunctionType = SubstAutoType(FunctionType, Context.DependentTy);
4127 Context.getCanonicalType(SpecializationType),
4128 Context.getCanonicalType(ArgFunctionType)))
4132 !Context.hasSameType(SpecializationType, ArgFunctionType))
4156 QualType P = Context.getCanonicalType(FromType);
4157 QualType A = Context.getCanonicalType(ToType);
4188 P = Context.getArrayDecayedType(P);
4193 P = Context.getPointerType(P);
4335 QualType Result = SemaRef.Context.getAutoType(
4348 QualType Result = SemaRef.Context.getDeducedTemplateSpecializationType(
4459 Deduced = Context.getCanonicalType(Deduced);
4478 Context, nullptr, SourceLocation(), Loc, Depth, 0, nullptr, false, false);
4666 RetType = Context.getPointerType(RetType);
4669 RetType = Context.getBlockPointerType(RetType);
4671 Context.adjustDeducedFunctionResultType(FD, RetType);
4762 AddImplicitObjectParameterType(S.Context, Method1, Args1);
4766 AddImplicitObjectParameterType(S.Context, Method2, Args2);
4836 ::MarkUsedTemplateParameters(S.Context, Args2[I], false,
4842 ::MarkUsedTemplateParameters(S.Context, Proto2->getReturnType(), false,
4847 ::MarkUsedTemplateParameters(S.Context, FD2->getType(), false,
5152 TemplateName CanonTemplate = Context.getCanonicalTemplateName(Name);
5153 QualType PT1 = Context.getTemplateSpecializationType(
5155 QualType PT2 = Context.getTemplateSpecializationType(
5174 Context.getInjectedTemplateArgs(Primary->getTemplateParameters(),
5178 Context.getCanonicalTemplateName(TemplateName(Primary));
5179 QualType PrimaryT = Context.getTemplateSpecializationType(
5181 QualType PartialT = Context.getTemplateSpecializationType(
5205 TemplateName X = Context.getCanonicalTemplateName(TemplateName(AArg));
5212 Context.getInjectedTemplateArgs(A, AArgs);
5222 Context.getInjectedTemplateArgs(P, PArgs);
5245 QualType AType = Context.getTemplateSpecializationType(X, AArgs);
5246 QualType PType = Context.getTemplateSpecializationType(X, PArgs);
5684 ::MarkUsedTemplateParameters(Context, TemplateArgs[I], OnlyDeduced,
5713 ::MarkUsedTemplateParameters(S.Context, T, true, TemplateParams->getDepth(),
tools/clang/lib/Sema/SemaTemplateInstantiate.cpp 177 cast<TemplateSpecializationType>(Context.getCanonicalType(T));
681 << CSM << Context.getTagDeclType(MD->getParent());
1096 = cast<TemplateTypeParmType>(getSema().Context.getTypeDeclType(TTPD));
1208 return getSema().Context.getSubstTemplateTemplateParmPack(TTP, Arg);
1219 Template = getSema().Context.getSubstTemplateTemplateParm(TTP, Template);
1290 return new (SemaRef.Context) SubstNonTypeTemplateParmPackExpr(
1291 TargetType.getNonLValueExprType(SemaRef.Context),
1315 return LoopHintAttr::CreateImplicit(getSema().Context, LH->getOption(),
1378 return new (SemaRef.Context) SubstNonTypeTemplateParmExpr(
1431 FunctionParmPackExpr::Create(getSema().Context, T, E->getParameterPack(),
1453 auto *PackExpr = FunctionParmPackExpr::Create(getSema().Context, T, PD,
1551 = getSema().Context.getSubstTemplateTypeParmPackType(T, Arg);
1568 = getSema().Context.getSubstTemplateTypeParmType(T, Replacement);
1584 QualType Result = getSema().Context.getTemplateTypeParmType(
1608 Result = getSema().Context.getSubstTemplateTypeParmType(
1682 return TLB.getTypeSourceInfo(Context, TL.getType());
1692 return TLB.getTypeSourceInfo(Context, Result);
1777 return TLB.getTypeSourceInfo(Context, Result);
1853 ParmVarDecl *NewParm = CheckParameter(Context.getTranslationUnitDecl(),
1950 InstantiatedBases.push_back(new (Context) CXXBaseSpecifier(Base));
2112 PrettyDeclStackTraceEntry CrashInfo(Context, Instantiation, SourceLocation(),
2243 instantiateTemplateAttribute(I->TmplAttr, Context, *this, TemplateArgs);
2350 PrettyDeclStackTraceEntry CrashInfo(Context, Instantiation, SourceLocation(),
2426 PrettyDeclStackTraceEntry CrashInfo(Context, Instantiation, SourceLocation(),
2524 MakeDeductionFailureInfo(S.Context, Result, Info));
2771 if (Context.getTargetInfo().getTriple().isOSWindows() &&
tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp 491 TmplAttr, Context, *this, TemplateArgs);
608 New->addAttr(A->clone(Context));
614 New->addAttr(A->clone(Context));
634 Attr *NewAttr = sema::instantiateTemplateAttribute(TmplAttr, Context,
682 LabelDecl *Inst = LabelDecl::Create(SemaRef.Context, Owner, D->getLocation(),
696 = NamespaceAliasDecl::Create(SemaRef.Context, Owner,
717 DI = SemaRef.Context.getTrivialTypeSourceInfo(SemaRef.Context.IntTy);
717 DI = SemaRef.Context.getTrivialTypeSourceInfo(SemaRef.Context.IntTy);
736 DI = SemaRef.Context.getTrivialTypeSourceInfo(
742 Typedef = TypeAliasDecl::Create(SemaRef.Context, Owner, D->getBeginLoc(),
745 Typedef = TypedefDecl::Create(SemaRef.Context, Owner, D->getBeginLoc(),
826 = TypeAliasTemplateDecl::Create(SemaRef.Context, Owner, D->getLocation(),
843 auto *NewBD = BindingDecl::Create(SemaRef.Context, Owner, D->getLocation(),
895 Var = DecompositionDecl::Create(SemaRef.Context, DC, D->getInnerLocStart(),
899 Var = VarDecl::Create(SemaRef.Context, DC, D->getInnerLocStart(),
931 = AccessSpecDecl::Create(SemaRef.Context, D->getAccess(), Owner,
1004 SemaRef.Context.setInstantiatedFromUnnamedFieldDecl(Field, D);
1049 SemaRef.Context, Owner, D->getLocation(), D->getDeclName(), DI->getType(),
1066 new (SemaRef.Context)NamedDecl*[D->getChainingSize()];
1080 SemaRef.Context, Owner, D->getLocation(), D->getIdentifier(), T,
1084 IndirectField->addAttr(Attr->clone(SemaRef.Context));
1132 FriendDecl::Create(SemaRef.Context, Owner, D->getLocation(),
1170 EnumDecl::Create(SemaRef.Context, Owner, D->getBeginLoc(),
1182 Enum->setIntegerType(SemaRef.Context.IntTy);
1197 SemaRef.Context.setManglingNumber(Enum, SemaRef.Context.getManglingNumber(D));
1197 SemaRef.Context.setManglingNumber(Enum, SemaRef.Context.getManglingNumber(D));
1200 if (DeclaratorDecl *DD = SemaRef.Context.getDeclaratorForUnnamedTagDecl(D))
1201 SemaRef.Context.addDeclaratorForUnnamedTagDecl(Enum, DD);
1204 if (TypedefNameDecl *TND = SemaRef.Context.getTypedefNameForUnnamedTagDecl(D))
1205 SemaRef.Context.addTypedefNameForUnnamedTagDecl(Enum, TND);
1429 SemaRef.Context, Pattern->getTagKind(), DC, Pattern->getBeginLoc(),
1440 = ClassTemplateDecl::Create(SemaRef.Context, DC, D->getLocation(),
1463 SemaRef.Context.getInjectedClassNameType(RecordInst,
1548 SemaRef.Context, DC, D->getLocation(), D->getIdentifier(), InstParams,
1665 SemaRef.Context, D->getTagKind(), Owner, D->getBeginLoc(),
1697 SemaRef.Context.setManglingNumber(Record,
1698 SemaRef.Context.getManglingNumber(D));
1702 if (DeclaratorDecl *DD = SemaRef.Context.getDeclaratorForUnnamedTagDecl(D))
1703 SemaRef.Context.addDeclaratorForUnnamedTagDecl(Record, DD);
1707 if (TypedefNameDecl *TND = SemaRef.Context.getTypedefNameForUnnamedTagDecl(D))
1708 SemaRef.Context.addTypedefNameForUnnamedTagDecl(Record, TND);
1805 QualType T = adjustFunctionTypeForInstantiation(SemaRef.Context, D, TInfo);
1838 SemaRef.Context, DC, D->getInnerLocStart(),
1846 SemaRef.Context, DC, D->getInnerLocStart(), NameInfo, T, TInfo,
1890 FunctionTemplate = FunctionTemplateDecl::Create(SemaRef.Context, DC,
1906 TemplateArgumentList::CreateCopy(SemaRef.Context,
2122 QualType T = adjustFunctionTypeForInstantiation(SemaRef.Context, D, TInfo);
2158 SemaRef.Context, Record, StartLoc, NameInfo, T, TInfo,
2164 SemaRef.Context, Record, StartLoc, NameInfo, T, TInfo,
2169 SemaRef.Context, Record, StartLoc, NameInfo, T, TInfo,
2174 Method = CXXMethodDecl::Create(SemaRef.Context, Record, StartLoc, NameInfo,
2199 FunctionTemplate = FunctionTemplateDecl::Create(SemaRef.Context, Record,
2213 TemplateArgumentList::CreateCopy(SemaRef.Context,
2227 SemaRef.Context,
2407 SemaRef.Context, Owner, D->getBeginLoc(), D->getLocation(),
2539 T = SemaRef.Context.IntTy;
2547 SemaRef.Context, Owner, D->getInnerLocStart(), D->getLocation(),
2553 SemaRef.Context, Owner, D->getInnerLocStart(), D->getLocation(),
2678 SemaRef.Context, Owner, D->getLocation(),
2683 SemaRef.Context, Owner, D->getLocation(),
2696 SemaRef.Context,
2716 = UsingDirectiveDecl::Create(SemaRef.Context, Owner, D->getLocation(),
2753 NameInfo.setName(SemaRef.Context.DeclarationNames.getCXXConstructorName(
2754 SemaRef.Context.getCanonicalType(SemaRef.Context.getRecordType(RD))));
2754 SemaRef.Context.getCanonicalType(SemaRef.Context.getRecordType(RD))));
2764 UsingDecl *NewUD = UsingDecl::Create(SemaRef.Context, Owner,
2789 SemaRef.Context.setInstantiatedFromUsingDecl(NewUD, D);
2830 SemaRef.Context.setInstantiatedFromUsingShadowDecl(InstShadow, Shadow);
2942 SemaRef.Context.setInstantiatedFromUsingDecl(UD, D);
3326 SemaRef.Context, D->getTagKind(), Owner, D->getBeginLoc(),
3340 QualType CanonType = SemaRef.Context.getTemplateSpecializationType(
3342 SemaRef.Context.getRecordType(InstD));
3351 TypeSourceInfo *WrittenTy = SemaRef.Context.getTemplateSpecializationTypeInfo(
3445 SemaRef.Context, Owner, D->getInnerLocStart(), D->getLocation(),
3534 = TemplateParameterList::Create(SemaRef.Context, L->getTemplateLoc(),
3610 = SemaRef.Context.getTemplateSpecializationType(TemplateName(ClassTemplate),
3621 = SemaRef.Context.getTemplateSpecializationTypeInfo(
3646 << SemaRef.Context.getTypeDeclType(PrevDecl);
3654 SemaRef.Context, PartialSpec->getTagKind(), Owner,
3733 QualType CanonType = SemaRef.Context.getTemplateSpecializationType(
3743 TypeSourceInfo *WrittenTy = SemaRef.Context.getTemplateSpecializationTypeInfo(
3788 SemaRef.Context, Owner, PartialSpec->getInnerLocStart(),
4026 SemaRef.Context.setManglingNumber(New,
4027 SemaRef.Context.getManglingNumber(Tmpl));
4083 New->setType(SemaRef.Context.getFunctionType(
4153 assert(S.Context.getTargetInfo().getCXXABI().isMicrosoft() &&
4314 PrettyDeclStackTraceEntry CrashInfo(Context, Function, SourceLocation(),
4371 if (Context.getTargetInfo().getCXXABI().isMicrosoft() &&
4585 Context.setManglingNumber(NewVar, Context.getManglingNumber(OldVar));
4585 Context.setManglingNumber(NewVar, Context.getManglingNumber(OldVar));
4586 Context.setStaticLocalNumber(NewVar, Context.getStaticLocalNumber(OldVar));
4586 Context.setStaticLocalNumber(NewVar, Context.getStaticLocalNumber(OldVar));
4742 PrettyDeclStackTraceEntry CrashInfo(Context, Var, SourceLocation(),
4845 PrettyDeclStackTraceEntry CrashInfo(Context, Var, SourceLocation(),
5501 QualType T = Context.getTypeDeclType(Spec);
5528 findInstantiationOf(Context, VTSD->getSpecializedTemplate(),
5535 Result = findInstantiationOf(Context, D, Found.begin(), Found.end());
5545 Result = findInstantiationOf(Context, D,
5565 << Context.getTypeDeclType(cast<CXXRecordDecl>(ParentDC));
5578 << Context.getTypeDeclType(cast<TypeDecl>(Spec->getDeclContext()));
5580 << Context.getTypeDeclType(Spec);
5661 PrettyDeclStackTraceEntry CrashInfo(Context, Var, SourceLocation(),
tools/clang/lib/Sema/SemaTemplateVariadic.cpp 597 return TLB.getTypeSourceInfo(Context, Result);
617 return Context.getPackExpansionType(Pattern, NumExpansions);
641 return new (Context)
642 PackExpansionExpr(Context.DependentTy, Pattern, EllipsisLoc, NumExpansions);
1020 return SizeOfPackExpr::Create(Context, OpLoc, ParameterPack, NameLoc,
1036 ExpansionTSInfo = Context.getTrivialTypeSourceInfo(Argument.getAsType(),
1051 TLB.getTypeSourceInfo(Context, Pattern.getType());
1207 return new (Context) CXXFoldExpr(Context.DependentTy, LParenLoc, LHS,
1207 return new (Context) CXXFoldExpr(Context.DependentTy, LParenLoc, LHS,
1230 ScalarType = Context.VoidTy;
1238 return new (Context) CXXScalarValueInitExpr(
1239 ScalarType, Context.getTrivialTypeSourceInfo(ScalarType, EllipsisLoc),
tools/clang/lib/Sema/SemaType.cpp 256 sema.Context.getAttributedType(A->getKind(), ModifiedType, EquivType);
956 } else if (S.Context.canAssignObjCInterfaces(boundObjC, typeArgObjC)) {
986 if (bound->isBlockCompatibleObjCPointerType(S.Context))
1035 return S.Context.getObjCObjectType(type, finalTypeArgs, { }, false);
1047 Result = Context.applyObjCProtocolQualifiers(Result, Protocols,
1083 Result = Context.applyObjCProtocolQualifiers(Result, Protocols,
1103 QualType Result = Context.getObjCObjectType(
1104 Context.ObjCBuiltinIdTy, { },
1109 Result = Context.getObjCObjectPointerType(Result);
1111 TypeSourceInfo *ResultTInfo = Context.CreateTypeSourceInfo(Result);
1120 ObjCObjectTL.getBaseLoc().initialize(Context, SourceLocation());
1154 BaseTypeInfo = Context.getTrivialTypeSourceInfo(T, Loc);
1184 TypeSourceInfo *ResultTInfo = Context.CreateTypeSourceInfo(Result);
1240 ObjCObjectTL.getBaseLoc().initialize(Context, Loc);
1271 ASTContext &Context = S.Context;
1469 if (!S.Context.getTargetInfo().hasInt128Type() &&
1482 if (!S.Context.getTargetInfo().hasFloat16Type() && !S.getLangOpts().CUDA &&
1497 if (!S.Context.getTargetInfo().hasFloat128Type() &&
1811 return Context.getQualifiedType(T, Qs);
1860 return Context.getParenType(T);
1912 return S.Context.getQualifiedType(type, qs);
2016 return Context.getPointerType(T);
2035 assert(Context.getCanonicalType(T) != Context.OverloadTy &&
2035 assert(Context.getCanonicalType(T) != Context.OverloadTy &&
2077 return Context.getLValueReferenceType(T, SpelledAsLValue);
2078 return Context.getRValueReferenceType(T);
2090 return Context.getReadPipeType(T);
2102 return Context.getWritePipeType(T);
2176 if (Context.getTargetInfo().getCXXABI().isMicrosoft())
2231 llvm::APSInt ConstVal(Context.getTypeSize(Context.getSizeType()));
2231 llvm::APSInt ConstVal(Context.getTypeSize(Context.getSizeType()));
2234 T = Context.getVariableArrayType(T, nullptr, ASM, Quals, Brackets);
2236 T = Context.getIncompleteArrayType(T, ASM, Quals);
2238 T = Context.getDependentSizedArrayType(T, ArraySize, ASM, Quals, Brackets);
2254 T = Context.getVariableArrayType(T, ArraySize, ASM, Quals, Brackets);
2285 = ConstantArrayType::getNumAddressingBits(Context, T, ConstVal);
2286 if (ActiveSizeBits > ConstantArrayType::getMaxSizeBits(Context)) {
2293 T = Context.getConstantArrayType(T, ConstVal, ArraySize, ASM, Quals);
2302 if (T->isVariableArrayType() && !Context.getTargetInfo().isVLASupported()) {
2338 const QualType ArrType = Context.getBaseElementType(T);
2361 return Context.getDependentVectorType(CurType, SizeExpr, AttrLoc,
2365 if (!SizeExpr->isIntegerConstantExpr(VecSize, Context)) {
2373 return Context.getDependentVectorType(CurType, SizeExpr, AttrLoc,
2377 unsigned TypeSize = static_cast<unsigned>(Context.getTypeSize(CurType));
2397 return Context.getVectorType(CurType, VectorSize / TypeSize,
2422 if (!ArraySize->isIntegerConstantExpr(vecSize, Context)) {
2445 return Context.getExtVectorType(T, vectorSize);
2448 return Context.getDependentSizedExtVectorType(T, ArraySize, AttrLoc);
2552 QualType ParamType = Context.getAdjustedParameterType(ParamTypes[Idx]);
2584 return Context.getFunctionType(T, ParamTypes, EPI);
2633 return Context.getMemberPointerType(T, Class.getTypePtr());
2658 return Context.getBlockPointerType(T);
2752 declSpecType = S.Context.getQualifiedType(declSpecType, qs);
2932 T = SemaRef.Context.VoidTy;
2940 T = SemaRef.Context.DependentTy;
2994 SemaRef.Context, SemaRef.Context.getTranslationUnitDecl(),
2994 SemaRef.Context, SemaRef.Context.getTranslationUnitDecl(),
3140 T = SemaRef.Context.IntTy;
3215 << SemaRef.Context.getTypeDeclType(OwnedTagDecl);
3504 CallingConv CC = S.Context.getDefaultCallingConvention(FTI.isVariadic,
3890 !S.Context.getDiagnostics().isIgnored(diagKind, pointerLoc)) {
4020 ASTContext &Context = S.Context;
4131 !T->getNullability(S.Context)) {
4269 TypedefDecl *vaListTypedef = S.Context.getBuiltinVaListDecl();
4346 !T->getNullability(S.Context)) {
4370 T->isArrayType() && !T->getNullability(S.Context) && !isVaList(T) &&
5306 declSpecTy = S.Context.getQualifiedType(declSpecTy, qs);
5330 IdentifierLoc *Arg = new (S.Context) IdentifierLoc;
5331 Arg->Ident = &S.Context.Idents.get(attrStr);
5339 &S.Context.Idents.get("objc_ownership"), SourceLocation(),
5405 Qualifiers::ObjCLifetime ownership = Context.getInnerObjCOwnership(FromTy);
5775 TypeSourceInfo *TInfo = S.Context.CreateTypeSourceInfo(T);
5813 DeclaratorLocFiller(S.Context, State, D.getTypeObject(i)).Visit(CurrTL);
5824 TypeSpecLocFiller(S.Context, State, D.getDeclSpec()).Visit(CurrTL);
5880 QualType T = Context.getObjCInstanceType();
5881 TypeSourceInfo *TInfo = Context.getTrivialTypeSourceInfo(T, Loc);
5897 if (!AddrSpace->isIntegerConstantExpr(addrSpace, S.Context)) {
5944 return Context.getAddrSpaceQualType(T, ASIdx);
5957 return Context.getDependentAddressSpaceType(T, AddrSpace, AttrLoc);
6020 ASTContext &Ctx = S.Context;
6060 Type = S.Context.getAddrSpaceQualType(Type, ASIdx);
6138 if (S.Context.hasDirectOwnershipQualifier(type)) {
6188 createSimpleAttr<ObjCInertUnsafeUnretainedAttr>(S.Context, attr),
6195 type = S.Context.getQualifiedType(underlyingType);
6200 type = state.getAttributedType(::new (S.Context)
6201 ObjCOwnershipAttr(S.Context, attr, II),
6299 type = S.Context.getObjCGCQualType(origType, GCAttr);
6304 ::new (S.Context) ObjCGCAttr(S.Context, attr, II), origType, type);
6304 ::new (S.Context) ObjCGCAttr(S.Context, attr, II), origType, type);
6380 return wrap(S.Context, Original, 0);
6454 A = createSimpleAttr<Ptr32Attr>(S.Context, PAttr);
6457 A = createSimpleAttr<Ptr64Attr>(S.Context, PAttr);
6460 A = createSimpleAttr<SPtrAttr>(S.Context, PAttr);
6463 A = createSimpleAttr<UPtrAttr>(S.Context, PAttr);
6587 if (auto existingNullability = desugared->getNullability(S.Context)) {
6645 createNullabilityAttr(S.Context, attr, nullability), type, type);
6658 createSimpleAttr<ObjCKindOfAttr>(S.Context, attr), type, type);
6678 QualType equivType = S.Context.getObjCObjectType(
6685 equivType = S.Context.getObjCObjectPointerType(equivType);
6686 if (auto nullability = type->getNullability(S.Context)) {
6691 Attr *A = createNullabilityAttr(S.Context, attr, *nullability);
6699 createSimpleAttr<ObjCKindOfAttr>(S.Context, attr), type, equivType);
6859 type = unwrapped.wrap(S, S.Context.adjustFunctionType(unwrapped.get(), EI));
6882 type = unwrapped.wrap(S, S.Context.adjustFunctionType(unwrapped.get(), EI));
6885 createSimpleAttr<NSReturnsRetainedAttr>(S.Context, attr),
6900 type = unwrapped.wrap(S, S.Context.adjustFunctionType(unwrapped.get(), EI));
6921 type = unwrapped.wrap(S, S.Context.adjustFunctionType(unwrapped.get(), EI));
6947 type = unwrapped.wrap(S, S.Context.adjustFunctionType(unwrapped.get(), EI));
6994 S, S.Context
7012 Attr *CCAttr = getCCTypeAttr(S.Context, attr);
7066 unwrapped.wrap(S, S.Context.adjustFunctionType(unwrapped.get(), EI));
7093 CallingConv ToCC = Context.getDefaultCallingConvention(IsVariadic, !IsStatic);
7100 if (Context.getTargetInfo().getCXXABI().isMicrosoft() && IsCtorOrDtor) {
7113 Context.getDefaultCallingConvention(IsVariadic, IsStatic);
7122 FT = Context.adjustFunctionType(FT, FT->getExtInfo().withCallingConv(ToCC));
7124 T = Context.getAdjustedType(T, Wrapped);
7213 llvm::Triple Triple = S.Context.getTargetInfo().getTriple();
7266 if (!S.Context.getTargetInfo().hasFeature("neon") &&
7267 !S.Context.getTargetInfo().hasFeature("mve")) {
7283 !numEltsExpr->isIntegerConstantExpr(numEltsInt, S.Context)) {
7298 unsigned typeSize = static_cast<unsigned>(S.Context.getTypeSize(CurType));
7307 CurType = S.Context.getVectorType(CurType, numElts, VecKind);
7361 CurType = S.Context.getWritePipeType(ElemType);
7494 T = State.getSema().Context.getAddrSpaceQualType(T, ImpAddr);
7502 createSimpleAttr<LifetimeBoundAttr>(State.getSema().Context, Attr),
7625 ASTContext &Ctx = state.getSema().Context;
7716 type = state.getSema().Context.getMacroQualifiedType(type, MacroII);
7937 if (auto *Source = Context.getExternalSource()) {
7999 if (Context.getTargetInfo().getCXXABI().isMicrosoft()) {
8053 if (auto *Source = Context.getExternalSource()) {
8131 << Context.getTagDeclType(Tag);
8187 QualType ElemType = Context.getBaseElementType(T);
8189 T->isLiteralType(Context))
8231 if (!I.getType()->isLiteralType(Context)) {
8238 if (!I->getType()->isLiteralType(Context) ||
8294 return Context.getElaboratedType(Keyword, NNS, T, OwnedTagDecl);
8308 return Context.getTypeOfExprType(E);
8316 return S.Context.DependentTy;
8357 return S.Context.getLValueReferenceType(T);
8370 case VK_XValue: T = S.Context.getRValueReferenceType(T); break;
8373 case VK_LValue: T = S.Context.getLValueReferenceType(T); break;
8386 E->HasSideEffects(Context, false)) {
8392 return Context.getDecltypeType(E, getDecltypeForExpr(*this, E));
8423 return Context.getUnaryTransformType(BaseType, Underlying,
8448 else if (!T.isTriviallyCopyableType(Context))
8461 return Context.getAtomicType(T);
tools/clang/lib/Sema/TreeTransform.h 600 return SemaRef.Context.getTrivialTypeSourceInfo(T,
897 return SemaRef.Context.getTypeDeclType(Typedef);
903 return SemaRef.Context.getMacroQualifiedType(T, MacroII);
908 return SemaRef.Context.getTypeDeclType(Record);
913 return SemaRef.Context.getTypeDeclType(Enum);
945 return SemaRef.Context.getAutoType(Deduced, Keyword,
953 return SemaRef.Context.getDeducedTemplateSpecializationType(
983 return SemaRef.Context.getElaboratedType(Keyword,
1014 return SemaRef.Context.getDependentTemplateSpecializationType(Keyword,
1028 return SemaRef.Context.getElaboratedType(Keyword,
1050 return SemaRef.Context.getDependentNameType(Keyword,
1140 QualType T = SemaRef.Context.getTypeDeclType(Tag);
1141 return SemaRef.Context.getElaboratedType(Keyword,
1214 return getSema().Context.getSubstTemplateTemplateParmPack(Param, ArgPack);
2056 return Owned(new (getSema().Context) CXXCatchStmt(CatchLoc, ExceptionDecl,
2458 return new (SemaRef.Context) ImplicitValueInitExpr(T);
2751 return CXXDefaultArgExpr::Create(getSema().Context, Loc, Param,
2762 return CXXDefaultInitExpr::Create(getSema().Context, Loc, Field,
2922 return new (getSema().Context) CXXInheritedCtorInitExpr(
3013 return SizeOfPackExpr::Create(SemaRef.Context, OperatorLoc, Pack, PackLoc,
3196 new (getSema().Context) ObjCPropertyRefExpr(Getter, Setter, T,
3208 DeclarationNameInfo NameInfo(&getSema().Context.Idents.get("isa"), IsaLoc);
3227 = SemaRef.Context.Idents.get("__builtin_shufflevector");
3228 TranslationUnitDecl *TUDecl = SemaRef.Context.getTranslationUnitDecl();
3234 Expr *Callee = new (SemaRef.Context)
3235 DeclRefExpr(SemaRef.Context, Builtin, false,
3236 SemaRef.Context.BuiltinFnTy, VK_RValue, BuiltinLoc);
3237 QualType CalleePtrTy = SemaRef.Context.getPointerType(Builtin->getType());
3243 SemaRef.Context, Callee, SubExprs, Builtin->getCallResultType(),
3698 SS.Extend(SemaRef.Context, NS, Q.getLocalBeginLoc(), Q.getLocalEndLoc());
3707 SS.Extend(SemaRef.Context, Alias, Q.getLocalBeginLoc(),
3715 SS.MakeGlobal(SemaRef.Context, Q.getBeginLoc());
3722 SS.MakeSuper(SemaRef.Context, RD, Q.getBeginLoc(), Q.getEndLoc());
3742 SS.Extend(SemaRef.Context, /*FIXME:*/SourceLocation(), TL,
3774 return SS.getWithLocInContext(SemaRef.Context);
3804 SemaRef.Context.DeclarationNames.getCXXDeductionGuideName(NewTemplate));
3817 NewCanTy = SemaRef.Context.getCanonicalType(NewTInfo->getType());
3825 NewCanTy = SemaRef.Context.getCanonicalType(NewT);
3829 = SemaRef.Context.DeclarationNames.getCXXSpecialName(Name.getNameKind(),
3944 SemaRef.Context.getTrivialTypeSourceInfo(Arg.getAsType(), Loc));
3953 Builder.MakeTrivial(SemaRef.Context, DTN->getQualifier(), Loc);
3955 Builder.MakeTrivial(SemaRef.Context, QTN->getQualifier(), Loc);
3959 Builder.getWithLocInContext(SemaRef.Context),
3963 Builder.getWithLocInContext(SemaRef.Context),
4245 TypeSourceInfo *DI = getSema().Context.getTrivialTypeSourceInfo(T,
4273 return TLB.getTypeSourceInfo(SemaRef.Context, Result);
4339 return TLB.getTypeSourceInfo(SemaRef.Context, Result);
4414 Replacement = SemaRef.Context.getQualifiedType(
4416 T = SemaRef.Context.getSubstTemplateTypeParmType(
4424 SemaRef.Context.getQualifiedType(Deduced.getUnqualifiedType(), Qs);
4425 T = SemaRef.Context.getAutoType(Deduced, AutoTy->getKeyword(),
4517 return TLB.getTypeSourceInfo(SemaRef.Context, Result);
4561 Result = SemaRef.Context.getDecayedType(OriginalType);
4571 PointeeType = SemaRef.Context.getAddrSpaceQualType(PointeeType,
4592 Result = SemaRef.Context.getObjCObjectPointerType(PointeeType);
5040 TypeSourceInfo *DI = getSema().Context.getTrivialTypeSourceInfo(
5127 NewDI = TLB.getTypeSourceInfo(SemaRef.Context, Result);
5136 ParmVarDecl *newParm = ParmVarDecl::Create(SemaRef.Context,
5347 NewType = getSema().Context.getPackExpansionType(NewType,
5539 U = SemaRef.Context.getPackExpansionType(U, NumExpansions);
5867 QualType T = SemaRef.Context.getTypeDeclType(cast<TypeDecl>(D));
5894 Replacement = SemaRef.Context.getCanonicalType(Replacement);
5896 = SemaRef.Context.getSubstTemplateTypeParmType(T->getReplacedParameter(),
6116 = getSema().Context.getDependentTemplateSpecializationType(
6125 NewTL.setQualifierLoc(SS.getWithLocInContext(SemaRef.Context));
6248 result = SemaRef.Context.getAttributedType(TL.getAttrKind(),
6543 QualType NewExpansionType = SemaRef.Context.getPackExpansionType(
6548 TypeArgBuilder.getTypeSourceInfo(SemaRef.Context, NewExpansionType));
6566 TypeArgBuilder.getTypeSourceInfo(SemaRef.Context, NewTypeArg));
6585 TypeArgBuilder.getTypeSourceInfo(SemaRef.Context, NewTypeArg));
6843 Then = new (getSema().Context) NullStmt(S->getThen()->getBeginLoc());
7734 return new (getSema().Context) NullStmt(S->getKeywordLoc());
7740 return new (getSema().Context) NullStmt(S->getKeywordLoc());
8801 SemaRef.Context, /*NamingClass=*/nullptr,
8802 ReductionIdScopeSpec.getWithLocInContext(SemaRef.Context),
8847 SemaRef.Context, /*NamingClass=*/nullptr,
8848 ReductionIdScopeSpec.getWithLocInContext(SemaRef.Context), NameInfo,
8892 SemaRef.Context, /*NamingClass=*/nullptr,
8893 ReductionIdScopeSpec.getWithLocInContext(SemaRef.Context), NameInfo,
9053 TT.getSema().Context, /*NamingClass=*/nullptr,
9054 MapperIdScopeSpec.getWithLocInContext(TT.getSema().Context),
10683 = SemaRef.Context.getBaseElementType(E->getAllocatedType());
10702 const ArrayType *ArrayT = SemaRef.Context.getAsArrayType(AllocType);
10707 ArraySize = IntegerLiteral::Create(SemaRef.Context, ConsArrayT->getSize(),
10708 SemaRef.Context.getSizeType(),
10752 QualType Destroyed = SemaRef.Context.getBaseElementType(
10822 = SemaRef.Context.getTrivialTypeSourceInfo(SemaRef.GetTypeFromParser(T),
10987 Args.push_back(TLB.getTypeSourceInfo(SemaRef.Context, To));
11038 Args.push_back(TLB.getTypeSourceInfo(SemaRef.Context, To));
11065 Args.push_back(TLB.getTypeSourceInfo(SemaRef.Context, To));
11092 Args.push_back(TLB.getTypeSourceInfo(SemaRef.Context, To));
11487 NewCallOpTSI = NewCallOpTLBuilder.getTypeSourceInfo(getSema().Context,
12014 ArgStorage = getSema().Context.getPackExpansionType(
12015 getSema().Context.getTypeDeclType(TTPD), None);
12021 VD, VD->getType().getNonLValueExprType(getSema().Context),
12026 ArgStorage = new (getSema().Context) PackExpansionExpr(
12027 getSema().Context.DependentTy, DRE.get(), E->getPackLoc(), None);
12635 SemaRef.Context.PseudoObjectTy,
12895 return SemaRef.Context.getObjCObjectPointerType(PointeeType);
12912 SemaRef.Context.UnsignedCharTy, SemaRef.Context.UnsignedShortTy,
12912 SemaRef.Context.UnsignedCharTy, SemaRef.Context.UnsignedShortTy,
12913 SemaRef.Context.UnsignedIntTy, SemaRef.Context.UnsignedLongTy,
12913 SemaRef.Context.UnsignedIntTy, SemaRef.Context.UnsignedLongTy,
12914 SemaRef.Context.UnsignedLongLongTy, SemaRef.Context.UnsignedInt128Ty
12914 SemaRef.Context.UnsignedLongLongTy, SemaRef.Context.UnsignedInt128Ty
12919 if (Size->getBitWidth() == SemaRef.Context.getIntWidth(Types[I])) {
12927 = IntegerLiteral::Create(SemaRef.Context, *Size, SizeType,
12993 return SemaRef.Context.getVectorType(ElementType, NumElements, VecKind);
13007 llvm::APInt numElements(SemaRef.Context.getIntWidth(SemaRef.Context.IntTy),
13007 llvm::APInt numElements(SemaRef.Context.getIntWidth(SemaRef.Context.IntTy),
13010 = IntegerLiteral::Create(SemaRef.Context, numElements, SemaRef.Context.IntTy,
13010 = IntegerLiteral::Create(SemaRef.Context, numElements, SemaRef.Context.IntTy,
13036 return SemaRef.Context.getFunctionNoProtoType(T);
13071 assert(getSema().Context.hasSameType(ThisT, T) &&
13088 return SemaRef.Context.getTypeDeclType(Ty);
13099 return SemaRef.Context.getTypeOfType(Underlying);
13142 return SemaRef.Context.getQualifiedTemplateName(SS.getScopeRep(), TemplateKW,
13335 DeclarationName Name(SemaRef.Context.DeclarationNames.getCXXDestructorName(
13336 SemaRef.Context.getCanonicalType(DestroyedType->getType())));
13349 SS.Extend(SemaRef.Context, SourceLocation(), ScopeType->getTypeLoc(),
tools/clang/lib/Serialization/ASTWriter.cpp 4315 if (!SemaRef.Context.getLangOpts().OpenCL)
4332 if (!SemaRef.Context.getLangOpts().OpenCL)
4365 if (!SemaRef.Context.getLangOpts().OpenCL)
4710 Context = &SemaRef.Context;
4750 ASTContext &Context = SemaRef.Context;