diff --git a/llvm/lib/Transforms/IPO/SampleContextTracker.cpp b/llvm/lib/Transforms/IPO/SampleContextTracker.cpp index 270ca56d04823..c8f203e8ce3ee 100644 --- a/llvm/lib/Transforms/IPO/SampleContextTracker.cpp +++ b/llvm/lib/Transforms/IPO/SampleContextTracker.cpp @@ -189,8 +189,9 @@ ContextTrieNode *ContextTrieNode::getOrCreateChildContext( if (!AllowCreate) return nullptr; - AllChildContext[Hash] = ContextTrieNode(this, CalleeName, nullptr, CallSite); - return &AllChildContext[Hash]; + ContextTrieNode &ACC = AllChildContext[Hash]; + ACC = ContextTrieNode(this, CalleeName, nullptr, CallSite); + return &ACC; } // Profiler tracker than manages profiles and its associated context