[ast] Move printing code from ASTPrinter onto a helper on BuiltinType and have ASTPrinter call that instead.

This commit is contained in:
Michael Gottesman
2019-07-10 20:47:15 -07:00
parent 918a224d48
commit f952ff0ee4
8 changed files with 278 additions and 164 deletions

View File

@@ -56,7 +56,7 @@ _swift_mangleSimpleClass(const char *module, const char *class_) {
size_t moduleLength = strlen(module);
size_t classLength = strlen(class_);
char *value = nullptr;
if (strcmp(module, swift::STDLIB_NAME) == 0) {
if (swift::STDLIB_NAME.compare(module) == 0) {
int result = asprintf(&value, "_TtCs%zu%s", classLength, class_);
assert(result > 0);
(void)result;
@@ -75,7 +75,7 @@ _swift_mangleSimpleProtocol(const char *module, const char *protocol) {
size_t moduleLength = strlen(module);
size_t protocolLength = strlen(protocol);
char *value = nullptr;
if (strcmp(module, swift::STDLIB_NAME) == 0) {
if (swift::STDLIB_NAME.compare(module) == 0) {
int result = asprintf(&value, "_TtPs%zu%s_", protocolLength, protocol);
assert(result > 0);
(void)result;