[clang-tools-extra] [clangd] Prevent printing huge initializer lists in hover definitions (PR #79746)

Raoul Wols via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 10 12:12:55 PST 2024


================
@@ -1720,6 +1720,12 @@ void StmtPrinter::VisitInitListExpr(InitListExpr* Node) {
   OS << "{";
   for (unsigned i = 0, e = Node->getNumInits(); i != e; ++i) {
     if (i) OS << ", ";
+    // TODO: There is duplicated functionality in APValue::printPretty.
+    // Would be good to consolidate the two.
+    if (!Policy.EntireContentsOfLargeArray && i == 10) {
----------------
rwols wrote:

I reverted these changes in the clang namespace.

https://github.com/llvm/llvm-project/pull/79746


More information about the cfe-commits mailing list