Skip to content

Commit 6f3d610

Browse files
committed
Switch up @objc enum printing
Now that all the raw values are computed up front, change the printer to instead require the expression not be implicit. Previously, a NULL element would appear instead.
1 parent 2fe3ce8 commit 6f3d610

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lib/PrintAsObjC/DeclAndTypePrinter.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -393,13 +393,12 @@ class DeclAndTypePrinter::Implementation
393393
os << " SWIFT_COMPILE_NAME(\"" << Elt->getName() << "\")";
394394
}
395395

396-
auto *RVE = Elt->getStructuralRawValueExpr();
397-
if (auto ILE = cast_or_null<IntegerLiteralExpr>(RVE)) {
398-
os << " = ";
399-
if (ILE->isNegative())
400-
os << "-";
401-
os << ILE->getDigitsText();
402-
}
396+
// Print the raw values, even the ones that we synthesize.
397+
auto *ILE = cast<IntegerLiteralExpr>(Elt->getStructuralRawValueExpr());
398+
os << " = ";
399+
if (ILE->isNegative())
400+
os << "-";
401+
os << ILE->getDigitsText();
403402
os << ",\n";
404403
}
405404
os << "};\n";

0 commit comments

Comments
 (0)