void AllocaRegion::ProfileRegion(llvm::FoldingSetNodeID& ID, const Expr *Ex, unsigned cnt, const MemRegion *) { ID.AddInteger((unsigned) AllocaRegionKind); ID.AddPointer(Ex); ID.AddInteger(cnt); }
/// Uniquing for the LayoutConstraintInfo. void LayoutConstraintInfo::Profile(llvm::FoldingSetNodeID &ID, LayoutConstraintKind Kind, unsigned SizeInBits, unsigned Alignment) { ID.AddInteger((unsigned)Kind); ID.AddInteger(SizeInBits); ID.AddInteger(Alignment); }
void AllocaRegion::ProfileRegion(llvm::FoldingSetNodeID& ID, const Expr *Ex, unsigned cnt, const MemRegion *superRegion) { ID.AddInteger(static_cast<unsigned>(AllocaRegionKind)); ID.AddPointer(Ex); ID.AddInteger(cnt); ID.AddPointer(superRegion); }
void ConstraintLocator::Profile(llvm::FoldingSetNodeID &id, Expr *anchor, ArrayRef<PathElement> path) { id.AddPointer(anchor); id.AddInteger(path.size()); for (auto elt : path) { id.AddInteger(elt.getKind()); switch (elt.getKind()) { case GenericParameter: id.AddPointer(elt.getGenericParameter()); break; case Requirement: id.AddPointer(elt.getRequirement()); break; case Witness: id.AddPointer(elt.getWitness()); break; case ApplyArgument: case ApplyFunction: case FunctionArgument: case FunctionResult: case OptionalPayload: case Member: case MemberRefBase: case UnresolvedMember: case SubscriptMember: case ConstructorMember: case LValueConversion: case RValueAdjustment: case ClosureResult: case ParentType: case InstanceType: case SequenceIteratorProtocol: case GeneratorElementType: case AutoclosureResult: case GenericArgument: case NamedTupleElement: case TupleElement: case ApplyArgToParam: case OpenedGeneric: case KeyPathComponent: case ConditionalRequirement: case TypeParameterRequirement: case ImplicitlyUnwrappedDisjunctionChoice: case DynamicLookupResult: case ContextualType: case SynthesizedArgument: if (unsigned numValues = numNumericValuesInPathElement(elt.getKind())) { id.AddInteger(elt.getValue()); if (numValues > 1) id.AddInteger(elt.getValue2()); } break; } } }
void ConstraintLocator::Profile(llvm::FoldingSetNodeID &id, Expr *anchor, ArrayRef<PathElement> path) { id.AddPointer(anchor); id.AddInteger(path.size()); for (auto elt : path) { id.AddInteger(elt.getKind()); switch (elt.getKind()) { case Archetype: id.AddPointer(elt.getArchetype()->getCanonicalType().getPointer()); break; case Requirement: id.AddPointer(elt.getRequirement()); break; case Witness: id.AddPointer(elt.getWitness()); break; case AssociatedType: id.AddPointer(elt.getAssociatedType()); break; case ApplyArgument: case ApplyFunction: case FunctionArgument: case FunctionResult: case Member: case MemberRefBase: case UnresolvedMember: case SubscriptIndex: case SubscriptMember: case SubscriptResult: case ConstructorMember: case RvalueAdjustment: case ClosureResult: case ParentType: case InstanceType: case SequenceIteratorProtocol: case GeneratorElementType: case ArrayElementType: case ScalarToTuple: case Load: case GenericArgument: case InterpolationArgument: case NamedTupleElement: case TupleElement: case ApplyArgToParam: case OpenedGeneric: if (unsigned numValues = numNumericValuesInPathElement(elt.getKind())) { id.AddInteger(elt.getValue()); if (numValues > 1) id.AddInteger(elt.getValue2()); } break; } } }
void PathDiagnosticPiece::Profile(llvm::FoldingSetNodeID &ID) const { ID.AddInteger((unsigned) getKind()); ID.AddString(str); // FIXME: Add profiling support for code hints. ID.AddInteger((unsigned) getDisplayHint()); for (range_iterator I = ranges_begin(), E = ranges_end(); I != E; ++I) { ID.AddInteger(I->getBegin().getRawEncoding()); ID.AddInteger(I->getEnd().getRawEncoding()); } }
void PathDiagnosticPiece::Profile(llvm::FoldingSetNodeID &ID) const { ID.AddInteger((unsigned) getKind()); ID.AddString(str); // FIXME: Add profiling support for code hints. ID.AddInteger((unsigned) getDisplayHint()); ArrayRef<SourceRange> Ranges = getRanges(); for (const auto &I : Ranges) { ID.AddInteger(I.getBegin().getRawEncoding()); ID.AddInteger(I.getEnd().getRawEncoding()); } }
void BlockDataRegion::ProfileRegion(llvm::FoldingSetNodeID& ID, const BlockTextRegion *BC, const LocationContext *LC, unsigned BlkCount, const MemRegion *sReg) { ID.AddInteger(MemRegion::BlockDataRegionKind); ID.AddPointer(BC); ID.AddPointer(LC); ID.AddInteger(BlkCount); ID.AddPointer(sReg); }
void TemplateArgument::Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) const { ID.AddInteger(getKind()); switch (getKind()) { case Null: break; case Type: getAsType().Profile(ID); break; case NullPtr: getNullPtrType().Profile(ID); break; case Declaration: ID.AddPointer(getAsDecl()? getAsDecl()->getCanonicalDecl() : 0); break; case Template: case TemplateExpansion: { TemplateName Template = getAsTemplateOrTemplatePattern(); if (TemplateTemplateParmDecl *TTP = dyn_cast_or_null<TemplateTemplateParmDecl>( Template.getAsTemplateDecl())) { ID.AddBoolean(true); ID.AddInteger(TTP->getDepth()); ID.AddInteger(TTP->getPosition()); ID.AddBoolean(TTP->isParameterPack()); } else { ID.AddBoolean(false); ID.AddPointer(Context.getCanonicalTemplateName(Template) .getAsVoidPointer()); } break; } case Integral: getAsIntegral().Profile(ID); getIntegralType().Profile(ID); break; case Expression: getAsExpr()->Profile(ID, Context, true); break; case Pack: ID.AddInteger(Args.NumArgs); for (unsigned I = 0; I != Args.NumArgs; ++I) Args.Args[I].Profile(ID, Context); } }
void ObjCStringRegion::ProfileRegion(llvm::FoldingSetNodeID& ID, const ObjCStringLiteral* Str, const MemRegion* superRegion) { ID.AddInteger((unsigned) ObjCStringRegionKind); ID.AddPointer(Str); ID.AddPointer(superRegion); }
void StringRegion::ProfileRegion(llvm::FoldingSetNodeID& ID, const StringLiteral* Str, const MemRegion* superRegion) { ID.AddInteger(static_cast<unsigned>(StringRegionKind)); ID.AddPointer(Str); ID.AddPointer(superRegion); }
void CompoundLiteralRegion::ProfileRegion(llvm::FoldingSetNodeID& ID, const CompoundLiteralExpr *CL, const MemRegion* superRegion) { ID.AddInteger((unsigned) CompoundLiteralRegionKind); ID.AddPointer(CL); ID.AddPointer(superRegion); }
void CXXThisRegion::ProfileRegion(llvm::FoldingSetNodeID &ID, const PointerType *PT, const MemRegion *sRegion) { ID.AddInteger((unsigned) CXXThisRegionKind); ID.AddPointer(PT); ID.AddPointer(sRegion); }
void LocationContext::Profile(llvm::FoldingSetNodeID &ID, ContextKind k, AnalysisContext *ctx, const LocationContext *parent) { ID.AddInteger(k); ID.AddPointer(ctx); ID.AddPointer(parent); }
void BlockTextRegion::ProfileRegion(llvm::FoldingSetNodeID& ID, const BlockDecl *BD, CanQualType, const AnalysisDeclContext *AC, const MemRegion*) { ID.AddInteger(MemRegion::BlockTextRegionKind); ID.AddPointer(BD); }
void ElementRegion::ProfileRegion(llvm::FoldingSetNodeID& ID, QualType ElementType, SVal Idx, const MemRegion* superRegion) { ID.AddInteger(MemRegion::ElementRegionKind); ID.Add(ElementType); ID.AddPointer(superRegion); Idx.Profile(ID); }
void LocationContext::ProfileCommon(llvm::FoldingSetNodeID &ID, ContextKind ck, AnalysisDeclContext *ctx, const LocationContext *parent, const void *data) { ID.AddInteger(ck); ID.AddPointer(ctx); ID.AddPointer(parent); ID.AddPointer(data); }
void PathDiagnosticLocation::Profile(llvm::FoldingSetNodeID &ID) const { ID.AddInteger((unsigned) K); switch (K) { case RangeK: ID.AddInteger(R.getBegin().getRawEncoding()); ID.AddInteger(R.getEnd().getRawEncoding()); break; case SingleLocK: ID.AddInteger(R.getBegin().getRawEncoding()); break; case StmtK: ID.Add(S); break; case DeclK: ID.Add(D); break; } return; }
void PathDiagnostic::Profile(llvm::FoldingSetNodeID &ID) const { ID.AddInteger(Size); ID.AddString(BugType); ID.AddString(Desc); ID.AddString(Category); for (const_iterator I = begin(), E = end(); I != E; ++I) ID.Add(*I); for (meta_iterator I = meta_begin(), E = meta_end(); I != E; ++I) ID.AddString(*I); }
void Inst::Profile(llvm::FoldingSetNodeID &ID) const { ID.AddInteger(K); ID.AddInteger(Width); switch (K) { case Const: case UntypedConst: Val.Profile(ID); return; case Var: assert(0 && "Var instructions should not be in FoldingSet"); case Phi: ID.AddPointer(B); break; default: break; } for (auto Op : Ops) ID.AddPointer(Op); }
void RawSyntax::Profile(llvm::FoldingSetNodeID &ID, tok TokKind, OwnedString Text, ArrayRef<TriviaPiece> LeadingTrivia, ArrayRef<TriviaPiece> TrailingTrivia) { ID.AddInteger(unsigned(TokKind)); switch (TokKind) { #define TOKEN_DEFAULT(NAME) case tok::NAME: #define PUNCTUATOR(NAME, X) TOKEN_DEFAULT(NAME) #define KEYWORD(KW) TOKEN_DEFAULT(kw_##KW) #define POUND_KEYWORD(KW) TOKEN_DEFAULT(pound_##KW) #include "swift/Syntax/TokenKinds.def" break; default: ID.AddString(Text.str()); break; } for (auto &Piece : LeadingTrivia) Piece.Profile(ID); for (auto &Piece : TrailingTrivia) Piece.Profile(ID); }
void MemSpaceRegion::Profile(llvm::FoldingSetNodeID& ID) const { ID.AddInteger((unsigned)getKind()); }
void FunctionTextRegion::ProfileRegion(llvm::FoldingSetNodeID& ID, const NamedDecl *FD, const MemRegion*) { ID.AddInteger(MemRegion::FunctionTextRegionKind); ID.AddPointer(FD); }
void SymbolicRegion::ProfileRegion(llvm::FoldingSetNodeID& ID, SymbolRef sym, const MemRegion *sreg) { ID.AddInteger((unsigned) MemRegion::SymbolicRegionKind); ID.Add(sym); ID.AddPointer(sreg); }
void DeclRegion::ProfileRegion(llvm::FoldingSetNodeID& ID, const Decl *D, const MemRegion* superRegion, Kind k) { ID.AddInteger((unsigned) k); ID.AddPointer(D); ID.AddPointer(superRegion); }
void MemSpaceRegion::Profile(llvm::FoldingSetNodeID &ID) const { ID.AddInteger(static_cast<unsigned>(getKind())); }
void StaticGlobalSpaceRegion::Profile(llvm::FoldingSetNodeID &ID) const { ID.AddInteger((unsigned)getKind()); ID.AddPointer(getCodeRegion()); }
void PathDiagnosticLocation::Profile(llvm::FoldingSetNodeID &ID) const { ID.AddInteger(Range.getBegin().getRawEncoding()); ID.AddInteger(Range.getEnd().getRawEncoding()); ID.AddInteger(Loc.getRawEncoding()); return; }
static void Profile(llvm::FoldingSetNodeID &ID, keyword_iterator ArgTys, unsigned NumArgs) { ID.AddInteger(NumArgs); for (unsigned i = 0; i != NumArgs; ++i) ID.AddPointer(ArgTys[i]); }
void StackSpaceRegion::Profile(llvm::FoldingSetNodeID &ID) const { ID.AddInteger((unsigned)getKind()); ID.AddPointer(getStackFrame()); }