Skip to content

Commit 0d27475

Browse files
committed
[stdlib] [reflection] Fix printing, remove & from
1 parent dd7d173 commit 0d27475

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

include/swift/Demangling/Demangler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class NodeFactory {
133133
size_t ObjectSize = NumObjects * sizeof(T);
134134
CurPtr = align(CurPtr, alignof(T));
135135
#ifdef NODE_FACTORY_DEBUGGING
136-
fprintf(stderr, "%salloc%zu, CurPtr = %p\n", indent().c_str(), ObjectSize, (void *)CurPtr)
136+
fprintf(stderr, "%salloc %zu, CurPtr = %p\n", indent().c_str(), ObjectSize, (void *)CurPtr)
137137
allocatedMemory += ObjectSize;
138138
#endif
139139

stdlib/public/Reflection/MetadataSource.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@ class PrintMetadataSource
2222
FILE *file;
2323
unsigned Indent;
2424

25-
FILE * &indent(unsigned Amount) {
25+
FILE * indent(unsigned Amount) {
2626
for (unsigned i = 0; i < Amount; ++i)
2727
fprintf(file, " ");
2828
return file;
2929
}
3030

31-
FILE * &printHeader(std::string Name) {
31+
FILE * printHeader(std::string Name) {
3232
fprintf(indent(Indent), "(%s", Name.c_str());
3333
return file;
3434
}
3535

36-
FILE * &printField(std::string name, std::string value) {
36+
FILE * printField(std::string name, std::string value) {
3737
if (!name.empty())
3838
fprintf(file, " %s=%s", name.c_str(), value.c_str());
3939
else

stdlib/public/Reflection/TypeLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class PrintTypeInfo {
7575
printField("alignment", std::to_string(TI.getAlignment()));
7676
printField("stride", std::to_string(TI.getStride()));
7777
printField("num_extra_inhabitants", std::to_string(TI.getNumExtraInhabitants()));
78-
printField("bitwise_takable", TI.isBitwiseTakable() ? "1" : "0");
78+
printField("bitwise_takable", TI.isBitwiseTakable() ? "true" : "false");
7979
}
8080

8181
void printFields(const RecordTypeInfo &TI) {

stdlib/public/Reflection/TypeRefBuilder.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,10 @@ void TypeRefBuilder::dumpBuiltinTypeSection(FILE *file) {
402402
auto typeName = nodeToString(typeNode);
403403

404404
fprintf(file, "\n- %s:\n", typeName.c_str());
405-
fprintf(file, "Size: %s\n", std::to_string(descriptor->Size).c_str());
406-
fprintf(file, "Alignment: %s:\n", std::to_string(descriptor->getAlignment()).c_str());
407-
fprintf(file, "Stride: %s:\n", std::to_string(descriptor->Stride).c_str());
408-
fprintf(file, "NumExtraInhabitants: %s:\n", std::to_string(descriptor->NumExtraInhabitants).c_str());
405+
fprintf(file, "Size: %u\n", descriptor->Size);
406+
fprintf(file, "Alignment: %u:\n", descriptor->getAlignment());
407+
fprintf(file, "Stride: %u:\n", descriptor->Stride);
408+
fprintf(file, "NumExtraInhabitants: %u:\n", descriptor->NumExtraInhabitants);
409409
fprintf(file, "BitwiseTakable: %d:\n", descriptor->isBitwiseTakable());
410410
}
411411
}

0 commit comments

Comments
 (0)