[llvm-branch-commits] [llvm] release/20.x: [Support] Ensure complete type DelimitedScope (#127459) (PR #128686)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Feb 25 02:02:19 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-support

Author: None (llvmbot)

<details>
<summary>Changes</summary>

Backport e65d3882af6fcc15342451ad4f9494b1ba6b9b9d

Requested by: @<!-- -->hahnjo

---
Full diff: https://github.com/llvm/llvm-project/pull/128686.diff


1 Files Affected:

- (modified) llvm/include/llvm/Support/ScopedPrinter.h (+7-9) 


``````````diff
diff --git a/llvm/include/llvm/Support/ScopedPrinter.h b/llvm/include/llvm/Support/ScopedPrinter.h
index 419ab97366796..506b40a09ed78 100644
--- a/llvm/include/llvm/Support/ScopedPrinter.h
+++ b/llvm/include/llvm/Support/ScopedPrinter.h
@@ -539,7 +539,13 @@ ScopedPrinter::printHex<support::ulittle16_t>(StringRef Label,
   startLine() << Label << ": " << hex(Value) << "\n";
 }
 
-struct DelimitedScope;
+struct DelimitedScope {
+  DelimitedScope(ScopedPrinter &W) : W(&W) {}
+  DelimitedScope() : W(nullptr) {}
+  virtual ~DelimitedScope() = default;
+  virtual void setPrinter(ScopedPrinter &W) = 0;
+  ScopedPrinter *W;
+};
 
 class JSONScopedPrinter : public ScopedPrinter {
 private:
@@ -838,14 +844,6 @@ class JSONScopedPrinter : public ScopedPrinter {
   }
 };
 
-struct DelimitedScope {
-  DelimitedScope(ScopedPrinter &W) : W(&W) {}
-  DelimitedScope() : W(nullptr) {}
-  virtual ~DelimitedScope() = default;
-  virtual void setPrinter(ScopedPrinter &W) = 0;
-  ScopedPrinter *W;
-};
-
 struct DictScope : DelimitedScope {
   explicit DictScope() = default;
   explicit DictScope(ScopedPrinter &W) : DelimitedScope(W) { W.objectBegin(); }

``````````

</details>


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


More information about the llvm-branch-commits mailing list