Skip to content

Commit 5e3da75

Browse files
authored
[Bounds-Safety][NFC] Clean up leading space emission for CountAttributedType (#87582)
Previously the leading space was added in each string constant. This patch moves the leading space out of the string constants and is instead explicitly added to add clarity to the code.
1 parent 66fed33 commit 5e3da75

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

clang/lib/AST/TypePrinter.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,14 +1746,15 @@ void TypePrinter::printPackExpansionAfter(const PackExpansionType *T,
17461746
static void printCountAttributedImpl(const CountAttributedType *T,
17471747
raw_ostream &OS,
17481748
const PrintingPolicy &Policy) {
1749+
OS << ' ';
17491750
if (T->isCountInBytes() && T->isOrNull())
1750-
OS << " __sized_by_or_null(";
1751+
OS << "__sized_by_or_null(";
17511752
else if (T->isCountInBytes())
1752-
OS << " __sized_by(";
1753+
OS << "__sized_by(";
17531754
else if (T->isOrNull())
1754-
OS << " __counted_by_or_null(";
1755+
OS << "__counted_by_or_null(";
17551756
else
1756-
OS << " __counted_by(";
1757+
OS << "__counted_by(";
17571758
if (T->getCountExpr())
17581759
T->getCountExpr()->printPretty(OS, nullptr, Policy);
17591760
OS << ')';

0 commit comments

Comments
 (0)