[llvm] [DFAJumpThreading] Pretty print anonymous blocks (PR #162607)
Hongyu Chen via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 9 00:49:58 PDT 2025
================
@@ -381,17 +382,18 @@ typedef DenseMap<BasicBlock *, CloneList> DuplicateBlockMap;
// information is needed when restoring SSA form after cloning blocks.
typedef MapVector<Instruction *, std::vector<Instruction *>> DefMap;
+static inline std::string getBlockName(const BasicBlock *BB) {
+ std::string BBName;
+ raw_string_ostream Stream(BBName);
+ if (BB->hasName())
+ Stream << BB->getName();
+ else
+ BB->printAsOperand(Stream, false);
+ return BBName;
+}
----------------
XChy wrote:
Thanks, I didn't find such a method.
https://github.com/llvm/llvm-project/pull/162607
More information about the llvm-commits
mailing list