[PATCH] D99441: [CSSPGO][NFC] Fix a debug dump issue.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 26 16:07:26 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG12ac0403b1d9: [CSSPGO][NFC] Fix a debug dump issue. (authored by hoy).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99441/new/

https://reviews.llvm.org/D99441

Files:
  llvm/lib/Transforms/IPO/SampleContextTracker.cpp


Index: llvm/lib/Transforms/IPO/SampleContextTracker.cpp
===================================================================
--- llvm/lib/Transforms/IPO/SampleContextTracker.cpp
+++ llvm/lib/Transforms/IPO/SampleContextTracker.cpp
@@ -542,8 +542,11 @@
   } else {
     // Destination node exists, merge samples for the context tree
     mergeContextNode(FromNode, *ToNode, ContextStrToRemove);
-    LLVM_DEBUG(dbgs() << "  Context promoted and merged to: "
-                      << ToNode->getFunctionSamples()->getContext() << "\n");
+    LLVM_DEBUG({
+      if (ToNode->getFunctionSamples())
+        dbgs() << "  Context promoted and merged to: "
+               << ToNode->getFunctionSamples()->getContext() << "\n";
+    });
 
     // Recursively promote and merge children
     for (auto &It : FromNode.getAllChildContext()) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99441.333651.patch
Type: text/x-patch
Size: 833 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210326/214af41d/attachment.bin>


More information about the llvm-commits mailing list