diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.cpp')
| -rw-r--r-- | contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.cpp | 7 | 
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.cpp b/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.cpp index 35a830f416f6..9e6f1a537de3 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.cpp @@ -20,6 +20,8 @@  using namespace llvm; +PseudoProbeHandler::~PseudoProbeHandler() = default; +  void PseudoProbeHandler::emitPseudoProbe(uint64_t Guid, uint64_t Index,                                           uint64_t Type, uint64_t Attr,                                           const DILocation *DebugLoc) { @@ -35,7 +37,10 @@ void PseudoProbeHandler::emitPseudoProbe(uint64_t Guid, uint64_t Index,      auto Name = SP->getLinkageName();      if (Name.empty())        Name = SP->getName(); -    uint64_t CallerGuid = Function::getGUID(Name); +    // Use caching to avoid redundant md5 computation for build speed. +    uint64_t &CallerGuid = NameGuidMap[Name]; +    if (!CallerGuid) +      CallerGuid = Function::getGUID(Name);      uint64_t CallerProbeId = PseudoProbeDwarfDiscriminator::extractProbeIndex(          InlinedAt->getDiscriminator());      ReversedInlineStack.emplace_back(CallerGuid, CallerProbeId);  | 
