Skip to content

Commit ea5a41e

Browse files
committed
[ASTPrint] Only print CustomAttr arglist if PrintExprs enabled
The argument list is going to be mostly empty if PrintExprs is not enabled. Always trying to print the arguments also broke quite a few tests, because it would result in a mismatch between the swift interface before and after serialization, since CustomAttr arguments are not serialized.
1 parent 149828f commit ea5a41e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/AST/ASTPrinter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4851,8 +4851,8 @@ void CustomAttr::printCustomAttr(ASTPrinter &Printer, const PrintOptions &Option
48514851
else
48524852
getTypeRepr()->print(Printer, Options);
48534853
Printer.printNamePost(PrintNameContext::Attribute);
4854-
if (ArgumentList *args = getArgs()) {
4855-
PrintAST(Printer, Options).printArgumentList(args);
4854+
if (hasArgs() && Options.PrintExprs) {
4855+
PrintAST(Printer, Options).printArgumentList(argList);
48564856
}
48574857
}
48584858

0 commit comments

Comments
 (0)