Skip to content

[Support] Ensure complete type DelimitedScope #127459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions llvm/include/llvm/Support/ScopedPrinter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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(); }
Expand Down