Skip to content

Commit d96aebd

Browse files
authored
[AST] Mark two more dump() methods as LLVM_ATTRIBUTE_USED (#23873)
...so that they don't get dead-code-stripped and become unusable from the debugger.
1 parent b822353 commit d96aebd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

include/swift/AST/Pattern.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@ class alignas(8) Pattern {
221221

222222
void print(llvm::raw_ostream &OS,
223223
const PrintOptions &Options = PrintOptions()) const;
224-
void dump() const;
224+
LLVM_ATTRIBUTE_DEPRECATED(
225+
void dump() const LLVM_ATTRIBUTE_USED,
226+
"only for use within the debugger");
225227

226228
/// walk - This recursively walks the AST rooted at this pattern.
227229
Pattern *walk(ASTWalker &walker);

include/swift/AST/TypeRepr.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ class alignas(8) TypeRepr {
160160

161161
void print(raw_ostream &OS, const PrintOptions &Opts = PrintOptions()) const;
162162
void print(ASTPrinter &Printer, const PrintOptions &Opts) const;
163-
void dump() const;
163+
LLVM_ATTRIBUTE_DEPRECATED(
164+
void dump() const LLVM_ATTRIBUTE_USED,
165+
"only for use within the debugger");
164166

165167
/// Clone the given type representation.
166168
TypeRepr *clone(const ASTContext &ctx) const;

0 commit comments

Comments
 (0)