diff options
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/Analysis/LazyCallGraph.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/llvm/include/llvm/Analysis/LazyCallGraph.h b/llvm/include/llvm/Analysis/LazyCallGraph.h index 34d854c78fe..340ca491574 100644 --- a/llvm/include/llvm/Analysis/LazyCallGraph.h +++ b/llvm/include/llvm/Analysis/LazyCallGraph.h @@ -377,7 +377,23 @@ public: /// /// We use the name of the first function in the SCC to name the SCC for /// the purposes of debugging and logging. - StringRef getName() const { return begin()->getFunction().getName(); } + std::string getName() const { + std::string Name; + int i = 0; + for (Node &N : *this) { + if (i > 0) + Name += ", "; + // Elide the inner elements if there are too many. + if (i > 8) { + Name += "..., "; + Name += Nodes.back()->getFunction().getName().str(); + break; + } + Name += N.getFunction().getName().str(); + ++i; + } + return Name; + } }; /// A RefSCC of the call graph. |

