@@ -263,7 +263,7 @@ bool CallStackTrie::buildMIBNodes(CallStackTrieNode *Node, LLVMContext &Ctx,
263263 if (hasSingleAllocType (Node->AllocTypes )) {
264264 // Because we only clone cold contexts (we don't clone for exposing NotCold
265265 // contexts as that is the default allocation behavior), we create MIB
266- // metadata for this context iff :
266+ // metadata for this context if any of the following are true :
267267 // 1) It is cold.
268268 // 2) The immediate callee is the deepest point where we have an ambiguous
269269 // allocation type (i.e. the other callers that are cold need to know
@@ -371,11 +371,15 @@ bool CallStackTrie::buildAndAttachMIBMetadata(CallBase *CI) {
371371 MIBCallStack.push_back (AllocStackId);
372372 std::vector<Metadata *> MIBNodes;
373373 assert (!Alloc->Callers .empty () && " addCallStack has not been called yet" );
374- // The last parameter is meant to say whether the callee of the given node
375- // has is the deepest point where we have ambiguous alloc types. Here the
376- // node being passed in is the alloc and it has no callees. So it's false.
374+ // The CalleeHasAmbiguousCallerContext flag is meant to say whether the
375+ // callee of the given node has more than one caller. Here the node being
376+ // passed in is the alloc and it has no callees. So it's false.
377+ // Similarly, the last parameter is meant to say whether the callee of the
378+ // given node is the deepest point where we have ambiguous alloc types, which
379+ // is also false as the alloc has no callees.
377380 bool DeepestAmbiguousAllocType = true ;
378- if (buildMIBNodes (Alloc, Ctx, MIBCallStack, MIBNodes, false ,
381+ if (buildMIBNodes (Alloc, Ctx, MIBCallStack, MIBNodes,
382+ /* CalleeHasAmbiguousCallerContext=*/ false ,
379383 DeepestAmbiguousAllocType)) {
380384 assert (MIBCallStack.size () == 1 &&
381385 " Should only be left with Alloc's location in stack" );
0 commit comments