Merge pull request #33541 from varungandhi-apple/vg-clang-types-in-sil-setup

Setup code for Clang types in SIL.
This commit is contained in:
Varun Gandhi
2020-08-28 14:34:27 -07:00
committed by GitHub
15 changed files with 167 additions and 97 deletions

View File

@@ -3629,7 +3629,7 @@ void printCType(ASTContext &Ctx, ASTPrinter &Printer, ExtInfo &info) {
auto *cml = Ctx.getClangModuleLoader();
SmallString<64> buf;
llvm::raw_svector_ostream os(buf);
info.getClangTypeInfo().getValue().printType(cml, os);
info.getClangTypeInfo().printType(cml, os);
Printer << ", cType: " << QuotedString(os.str());
}
@@ -4065,7 +4065,7 @@ public:
case SILFunctionType::Representation::CFunctionPointer:
Printer << "c";
// [TODO: Clang-type-plumbing] Remove the second check.
if (printNameOnly || !info.getClangTypeInfo().hasValue())
if (printNameOnly || info.getClangTypeInfo().empty())
break;
printCType(Ctx, Printer, info);
break;
@@ -4131,7 +4131,7 @@ public:
case SILFunctionType::Representation::CFunctionPointer:
Printer << "c";
// [TODO: Clang-type-plumbing] Remove the second check.
if (printNameOnly || !info.getClangTypeInfo().hasValue())
if (printNameOnly || info.getClangTypeInfo().empty())
break;
printCType(Ctx, Printer, info);
break;