reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

References

tools/clang/lib/AST/ExprConstant.cpp
 1062     ASTContext &getCtx() const override { return Ctx; }
 1815     Val.printPretty(Out, Info.Ctx,
 1829     Arg.printPretty(Out, Info.Ctx, Param->getType());
 2075       APValue *V = Info.Ctx.getMaterializedTemporaryValue(MTE, false);
 2126   if (!E->isRValue() || E->getType()->isLiteralType(Info.Ctx))
 2222     LVal.setFrom(Info.Ctx, Value);
 2345   unsigned DestWidth = Info.Ctx.getIntWidth(DestType);
 2362   Result.convert(Info.Ctx.getFloatTypeSemantics(DestType),
 2370   unsigned DestWidth = Info.Ctx.getIntWidth(DestType);
 2383   Result = APFloat(Info.Ctx.getFloatTypeSemantics(DestType), 1);
 2404   unsigned NewBitWidth = FD->getBitWidthValue(Info.Ctx);
 2425     unsigned VecSize = Info.Ctx.getTypeSize(VecTy);
 2427     unsigned EltSize = Info.Ctx.getTypeSize(EltTy);
 2428     bool BigEndian = Info.Ctx.getTargetInfo().isBigEndian();
 2474       Info.Ctx.getDiagnostics().Report(E->getExprLoc(),
 2641     const ASTRecordLayout &Layout = Info.Ctx.getASTRecordLayout(RD);
 2659     RL = &Info.Ctx.getASTRecordLayout(Derived);
 2686   const ASTRecordLayout &Layout = Info.Ctx.getASTRecordLayout(DerivedDecl);
 2727     RL = &Info.Ctx.getASTRecordLayout(FD->getParent());
 2731   LVal.adjustOffset(Info.Ctx.toCharUnitsFromBits(RL->getFieldOffset(I)));
 2768   Size = Info.Ctx.getTypeSizeInChars(Type);
 2937     Info.Ctx.getObjCEncodingForType(ObjCEnc->getEncodedType(), Str);
 2946       Info.Ctx.getAsConstantArrayType(S->getType());
 2951   APSInt Value(S->getCharByteWidth() * Info.Ctx.getCharWidth(),
 2965   const ConstantArrayType *CAT = Info.Ctx.getAsConstantArrayType(
 2974   APSInt Value(S->getCharByteWidth() * Info.Ctx.getCharWidth(),
 3200       ObjType = Info.Ctx.getCanonicalType(ObjType);
 3261       const ConstantArrayType *CAT = Info.Ctx.getAsConstantArrayType(ObjType);
 3350       ObjType = getSubobjectType(ObjType, Info.Ctx.getRecordType(Base));
 3562       if (const VarDecl *VDef = VD->getDefinition(Info.Ctx))
 3612       } else if (BaseType.isConstQualified() && VD->hasDefinition(Info.Ctx)) {
 3618             VD->getType().isConstQualified() && !VD->hasDefinition(Info.Ctx)) {
 3679         BaseVal = Info.Ctx.getMaterializedTemporaryValue(MTE, false);
 3688             << Val.getAsString(Info.Ctx,
 3689                                Info.Ctx.getLValueReferenceType(LValType));
 3894     LVal.setFrom(Info.Ctx, Subobj);
 4041     LVal.setFrom(Info.Ctx, Subobj);
 4077   if (Object->getType()->isLiteralType(Info.Ctx))
 4428     APSInt LHS = CS->getLHS()->EvaluateKnownConstInt(Info.Ctx);
 4429     APSInt RHS = CS->getRHS() ? CS->getRHS()->EvaluateKnownConstInt(Info.Ctx)
 4905   if (!Info.Ctx.getLangOpts().CPlusPlus2a && isa<CXXMethodDecl>(Declaration) &&
 4986           Info.Ctx.getLValueReferenceType(This.Designator.getType(Info.Ctx));
 4986           Info.Ctx.getLValueReferenceType(This.Designator.getType(Info.Ctx));
 4988           << AK << Val.getAsString(Info.Ctx, StarThisType);
 5116   if (!Info.Ctx.hasSameUnqualifiedType(Callee->getReturnType(),
 5126       if (Next && !Info.Ctx.hasSameUnqualifiedType(
 5130     if (!Info.Ctx.hasSameUnqualifiedType(Found->getReturnType(),
 5154   LVal.setFrom(Info.Ctx, Result);
 5214   CanQualType CQT = Info.Ctx.getCanonicalType(Info.Ctx.getRecordType(C));
 5214   CanQualType CQT = Info.Ctx.getCanonicalType(Info.Ctx.getRecordType(C));
 5221       Ptr.setNull(Info.Ctx, E->getType());
 5239         << DiagKind << Ptr.Designator.getType(Info.Ctx)
 5240         << Info.Ctx.getRecordType(DynType->Type)
 5401     D.truncate(Info.Ctx, LHS.Base, LengthAndField.first);
 5499     RHS.setFrom(Info.Ctx, ArgValues[0]);
 5584     RHS.setFrom(Info.Ctx, ArgValues[0]);
 5596   const ASTRecordLayout &Layout = Info.Ctx.getASTRecordLayout(RD);
 5638       assert(Info.Ctx.hasSameType(BaseIt->getType(), BaseType) &&
 5676             *Value = getDefaultInitValue(Info.Ctx.getRecordType(CD));
 5756       << Printable.getAsString(Info.Ctx, Info.Ctx.getLValueReferenceType(T));
 5756       << Printable.getAsString(Info.Ctx, Info.Ctx.getLValueReferenceType(T));
 5762   OpaqueValueExpr LocE(CallLoc, Info.Ctx.IntTy, VK_RValue);
 5765   if (const ConstantArrayType *CAT = Info.Ctx.getAsConstantArrayType(T)) {
 5867   const ASTRecordLayout &Layout = Info.Ctx.getASTRecordLayout(RD);
 6004   if (ByteSize.getActiveBits() > ConstantArrayType::getMaxSizeBits(Info.Ctx)) {
 6006       Result.setNull(Info.Ctx, E->getType());
 6014   QualType AllocType = Info.Ctx.getConstantArrayType(ElemType, Size, nullptr,
 6045     return Pointer.toString(Info.Ctx, Info.Ctx.VoidPtrTy);
 6045     return Pointer.toString(Info.Ctx, Info.Ctx.VoidPtrTy);
 6183         Buffer(ObjectWidth, Info.Ctx.getTargetInfo().isLittleEndian()),
 6236     const ASTRecordLayout &Layout = Info.Ctx.getASTRecordLayout(RD);
 6261       assert(FieldOffsetBits % Info.Ctx.getCharWidth() == 0 &&
 6264           Info.Ctx.toCharUnitsFromBits(FieldOffsetBits) + Offset;
 6280     CharUnits ElemWidth = Info.Ctx.getTypeSizeInChars(CAT->getElementType());
 6303     CharUnits Width = Info.Ctx.getTypeSizeInChars(Ty);
 6318     CharUnits DstSize = Info.Ctx.getTypeSizeInChars(BCE->getType());
 6349       uint64_t NullValue = Info.Ctx.getTargetNullPointerValue(QualType(T, 0));
 6355     CharUnits SizeOf = Info.Ctx.getTypeSizeInChars(T);
 6368             << DisplayType << Info.Ctx.getLangOpts().CharIsSigned;
 6375     APSInt Val(SizeOf.getQuantity() * Info.Ctx.getCharWidth(), true);
 6385           Info.Ctx.getFloatTypeSemantics(QualType(T, 0));
 6394     const ASTRecordLayout &Layout = Info.Ctx.getASTRecordLayout(RD);
 6409             Info.Ctx.getASTRecordLayout(BaseDecl).getNonVirtualSize().isZero())
 6432       assert(FieldOffsetBits % Info.Ctx.getCharWidth() == 0);
 6435           CharUnits::fromQuantity(FieldOffsetBits / Info.Ctx.getCharWidth()) +
 6461     CharUnits ElementWidth = Info.Ctx.getTypeSizeInChars(Ty->getElementType());
 6577   assert(CHAR_BIT == 8 && Info.Ctx.getTargetInfo().getCharWidth() == 8 &&
 6582   if (!checkBitCastConstexprEligibility(&Info, Info.Ctx, BCE))
 6587   SourceLValue.setFrom(Info.Ctx, SourceValue);
 6745     if (!Info.Ctx.getLangOpts().CPlusPlus2a)
 6785                       getStorageType(Info.Ctx, E->getOpaqueValue()), false,
 6896       if (!Info.Ctx.hasSameFunctionTypeIgnoringExceptionSpec(
 6985                                Info.Ctx.getRecordType(DD->getParent()));
 7026     assert(!Info.Ctx.getLangOpts().CPlusPlus11 &&
 7167     if (Info.getLangOpts().MSVCCompat && !E->HasSideEffects(Info.Ctx))
 7203     Result.setFrom(this->Info.Ctx, V);
 7424         Result.setFrom(Info.Ctx, RVal);
 7483     Value = Info.Ctx.getMaterializedTemporaryValue(E, true);
 7542       TypeInfo = TypeInfoLValue(E->getTypeOperand(Info.Ctx).getTypePtr());
 7546     if (!Info.Ctx.getLangOpts().CPlusPlus2a) {
 7561         TypeInfoLValue(Info.Ctx.getRecordType(DynType->Type).getTypePtr());
 7820     Result.setFrom(Info.Ctx, V);
 7824     Result.setNull(Info.Ctx, E->getType());
 7879         Result.setFrom(Info.Ctx, RVal);
 7890         Info.Ctx, Info.CurrentCall->CurSourceLocExprScope.getDefaultExpr());
 7891     Result.setFrom(Info.Ctx, LValResult);
 7953           Info.Ctx.hasSameUnqualifiedType(Result.Designator.getType(Info.Ctx),
 7953           Info.Ctx.hasSameUnqualifiedType(Result.Designator.getType(Info.Ctx),
 8009       unsigned Size = Info.Ctx.getTypeSize(E->getType());
 8019       Result.setFrom(Info.Ctx, Value);
 8035     auto *AT = Info.Ctx.getAsArrayType(SubExpr->getType());
 8076       Info.Ctx.getLangOpts().getClangABICompat() <= LangOptions::ClangABI::Ver7;
 8082     return Info.Ctx.toCharUnitsFromBits(
 8083       Info.Ctx.getPreferredTypeAlign(T.getTypePtr()));
 8086     return Info.Ctx.getTypeAlignInChars(T.getTypePtr());
 8102     return Info.Ctx.getDeclAlign(DRE->getDecl(),
 8106     return Info.Ctx.getDeclAlign(ME->getMemberDecl(),
 8168         BaseAlignment = Info.Ctx.getDeclAlign(VD);
 8214         << (std::string("'") + Info.Ctx.BuiltinInfo.getName(BuiltinOp) + "'");
 8244     QualType CharTy = Result.Designator.getType(Info.Ctx);
 8248            Info.Ctx.hasSameUnqualifiedType(
 8257     if (IsRawByte && Info.Ctx.getTypeSizeInChars(CharTy) != CharUnits::One())
 8281       DesiredVal = Desired.trunc(Info.Ctx.getCharWidth()).getZExtValue();
 8318         << (std::string("'") + Info.Ctx.BuiltinInfo.getName(BuiltinOp) + "'");
 8362           << Val.getAsString(Info.Ctx, E->getArg(0)->getType());
 8371     QualType T = Dest.Designator.getType(Info.Ctx);
 8372     QualType SrcT = Src.Designator.getType(Info.Ctx);
 8373     if (!Info.Ctx.hasSameUnqualifiedType(T, SrcT)) {
 8381     if (!T.isTriviallyCopyableType(Info.Ctx)) {
 8387     uint64_t TSize = Info.Ctx.getTypeSizeInChars(T).getQuantity();
 8543     if (ConstantArrayType::getNumAddressingBits(Info.Ctx, AllocType,
 8545         ConstantArrayType::getMaxSizeBits(Info.Ctx)) {
 8558       auto *CAT = Info.Ctx.getAsConstantArrayType(Init->getType());
 8582     AllocType = Info.Ctx.getConstantArrayType(AllocType, ArrayBound, nullptr,
 8604         if (!Info.Ctx.hasSameUnqualifiedType(SubobjType, AllocType)) {
 8801   const ASTRecordLayout &Layout = Info.Ctx.getASTRecordLayout(RD);
 8901   const ASTRecordLayout &Layout = Info.Ctx.getASTRecordLayout(RD);
 8981     ImplicitValueInitExpr VIE(HaveInit ? Info.Ctx.IntTy : Field->getType());
 9067       Info.Ctx.getAsConstantArrayType(E->getSubExpr()->getType());
 9084       !Info.Ctx.hasSameType(Field->getType()->getPointeeType(),
 9096       Info.Ctx.hasSameType(Field->getType()->getPointeeType(),
 9104   } else if (Info.Ctx.hasSameType(Field->getType(), Info.Ctx.getSizeType()))
 9104   } else if (Info.Ctx.hasSameType(Field->getType(), Info.Ctx.getSizeType()))
 9294     unsigned EltSize = Info.Ctx.getTypeSize(EltTy);
 9295     bool BigEndian = Info.Ctx.getTargetInfo().isBigEndian();
 9298       const llvm::fltSemantics &Sem = Info.Ctx.getFloatTypeSemantics(EltTy);
 9360         sInt = Info.Ctx.MakeIntValue(0, EltTy);
 9369         f = APFloat::getZero(Info.Ctx.getFloatTypeSemantics(EltTy));
 9384     ZeroElement = APValue(Info.Ctx.MakeIntValue(0, EltTy));
 9387         APValue(APFloat::getZero(Info.Ctx.getFloatTypeSemantics(EltTy)));
 9420           Info.Ctx.getAsConstantArrayType(E->getType());
 9486   const ConstantArrayType *CAT = Info.Ctx.getAsConstantArrayType(
 9563                     getStorageType(Info.Ctx, E->getCommonExpr()), false,
 9601   if (const ConstantArrayType *CAT = Info.Ctx.getAsConstantArrayType(Type)) {
 9656     assert(SI.getBitWidth() == Info.Ctx.getIntWidth(E->getType()) &&
 9668     assert(I.getBitWidth() == Info.Ctx.getIntWidth(E->getType()) &&
 9682     Result = APValue(Info.Ctx.MakeIntValue(Value, E->getType()));
 9796         APFixedPoint(I, Info.Ctx.getFixedPointSemantics(E->getType())), E);
 9801         APFixedPoint(Value, Info.Ctx.getFixedPointSemantics(E->getType())), E);
 9810     assert(V.getWidth() == Info.Ctx.getIntWidth(E->getType()) &&
 9860       Info.Ctx, Info.CurrentCall->CurSourceLocExprScope.getDefaultExpr());
 9882     auto FXSema = Info.Ctx.getFixedPointSemantics(E->getType());
 9904                       == Info.Ctx.getIntWidth(E->getType()));
 9914         Val = Val.extOrTrunc(Info.Ctx.getIntWidth(E->getType()));
10383         getBytesReturnedByAllocSizeCall(Info.Ctx, LVal, APEndOffset))
10403   if (isUserWritingOffTheEnd(Info.Ctx, LVal)) {
10408         getBytesReturnedByAllocSizeCall(Info.Ctx, LVal, APEndOffset))
10461       LVal.setFrom(Info.Ctx, RVal);
10511         E->getArg(1)->EvaluateKnownConstInt(Info.Ctx).getZExtValue();
10518     if (E->getArg(0)->HasSideEffects(Info.Ctx))
10539     analyze_os_log::computeOSLogBufferLayout(Info.Ctx, E, Layout);
10583     if (Info.InConstantContext || Arg->HasSideEffects(Info.Ctx)) {
10610     int Operand = E->getArg(0)->EvaluateKnownConstInt(Info.Ctx).getZExtValue();
10611     Operand = Info.Ctx.getTargetInfo().getEHDataRegisterNumber(Operand);
10699         << (std::string("'") + Info.Ctx.BuiltinInfo.getName(BuiltinOp) + "'");
10723           Info.Ctx.hasSameUnqualifiedType(CharTy, Info.Ctx.CharTy)) {
10723           Info.Ctx.hasSameUnqualifiedType(CharTy, Info.Ctx.CharTy)) {
10760         << (std::string("'") + Info.Ctx.BuiltinInfo.getName(BuiltinOp) + "'");
10796     QualType CharTy1 = String1.Designator.getType(Info.Ctx);
10797     QualType CharTy2 = String2.Designator.getType(Info.Ctx);
10805            (Info.Ctx.hasSameUnqualifiedType(
10807             Info.Ctx.hasSameUnqualifiedType(CharTy1, CharTy2)));
10830       uint64_t CharTy1Width{Info.Ctx.getTypeSize(CharTy1)};
10831       CharUnits CharTy1Size = Info.Ctx.toCharUnitsFromBits(CharTy1Width);
10833       if (CharTy1Size != Info.Ctx.getTypeSizeInChars(CharTy2))
10924           Info.Ctx.getTargetInfo().getMaxAtomicInlineWidth();
10925       if (Size <= Info.Ctx.toCharUnitsFromBits(InlineWidthBits)) {
10928             E->getArg(1)->isNullPointerConstant(Info.Ctx,
10937             Info.Ctx.getTypeAlignInChars(PointeeType) >= Size) {
10993       uint64_t ResultSize = Info.Ctx.getTypeSize(ResultType);
11054       APSInt Temp = Result.extOrTrunc(Info.Ctx.getTypeSize(ResultType));
11354   APSInt Value(Info.Ctx.getIntWidth(E->getType()),
11447         Info.Ctx.CompCategories.getInfoForType(E->getType());
11471     APFixedPoint LHSFX(Info.Ctx.getFixedPointSemantics(LHSTy));
11472     APFixedPoint RHSFX(Info.Ctx.getFixedPointSemantics(RHSTy));
11593            isOnePastTheEndOfCompleteObject(Info.Ctx, RHSValue)) ||
11595            isOnePastTheEndOfCompleteObject(Info.Ctx, LHSValue)))
11664     unsigned PtrSize = Info.Ctx.getTypeSize(LHSTy);
11679       CharUnits Size = Info.Ctx.getTypeSizeInChars(BaseTy);
11751         Info.Ctx.CompCategories.getInfoForType(E->getType());
11885     APSInt Result = TrueResult.trunc(Info.Ctx.getIntWidth(E->getType()));
11942         Info.Ctx.toCharUnitsFromBits(
11943                     Info.Ctx.getOpenMPDefaultSimdAlign(E->getArgumentType()))
11965       const ArrayType *AT = Info.Ctx.getAsArrayType(CurrentType);
11969       CharUnits ElementSize = Info.Ctx.getTypeSizeInChars(CurrentType);
11981       const ASTRecordLayout &RL = Info.Ctx.getASTRecordLayout(RD);
11984       Result += Info.Ctx.toCharUnitsFromBits(RL.getFieldOffset(i));
12003       const ASTRecordLayout &RL = Info.Ctx.getASTRecordLayout(RD);
12139     APFixedPoint Src(Info.Ctx.getFixedPointSemantics(SrcType));
12144         Info.Ctx.getIntWidth(DestType),
12170         return Info.Ctx.getTypeSize(DestType) <= Info.Ctx.getTypeSize(SrcType);
12170         return Info.Ctx.getTypeSize(DestType) <= Info.Ctx.getTypeSize(SrcType);
12172       return Info.Ctx.getTypeSize(DestType) == Info.Ctx.getTypeSize(SrcType);
12172       return Info.Ctx.getTypeSize(DestType) == Info.Ctx.getTypeSize(SrcType);
12191       if (Info.Ctx.getTypeSize(DestType) != Info.Ctx.getTypeSize(SrcType))
12191       if (Info.Ctx.getTypeSize(DestType) != Info.Ctx.getTypeSize(SrcType))
12202     if (!V.toIntegralConstant(AsInt, SrcType, Info.Ctx))
12303   auto DestFXSema = Info.Ctx.getFixedPointSemantics(DestType);
12307     APFixedPoint Src(Info.Ctx.getFixedPointSemantics(SubExpr->getType()));
12323         Src, Info.Ctx.getFixedPointSemantics(DestType), &Overflowed);
12342       Info.Ctx.getFixedPointSemantics(E->getType());
12344   APFixedPoint LHSFX(Info.Ctx.getFixedPointSemantics(LHS->getType()));
12347   APFixedPoint RHSFX(Info.Ctx.getFixedPointSemantics(RHS->getType()));
12385     Result = APFloat::getZero(Info.Ctx.getFloatTypeSemantics(E->getType()));
12460       Info.Ctx.getFloatTypeSemantics(E->getType());
12469     if (!TryEvaluateBuiltinNaN(Info.Ctx, E->getType(), E->getArg(0),
12480     if (!TryEvaluateBuiltinNaN(Info.Ctx, E->getType(), E->getArg(0),
12536   const llvm::fltSemantics &Sem = Info.Ctx.getFloatTypeSemantics(E->getType());
12644     APFloat Zero = APFloat::getZero(Info.Ctx.getFloatTypeSemantics(ElemTy));
12649     APSInt Zero = Info.Ctx.MakeIntValue(0, ElemTy);
13385     auto &InterpCtx = Info.Ctx.getInterpContext();
13407     LV.setFrom(Info.Ctx, Result);
14385     auto &InterpCtx = Info.Ctx.getInterpContext();
14401   ImplicitValueInitExpr VIE(RD ? Info.Ctx.getRecordType(RD) : Info.Ctx.IntTy);
14401   ImplicitValueInitExpr VIE(RD ? Info.Ctx.getRecordType(RD) : Info.Ctx.IntTy);