Merge pull request #39627 from CodaFi/the-replacements

Suggest Replacement Types for Invalid Placeholders
This commit is contained in:
Robert Widmann
2021-11-10 16:23:29 -08:00
committed by GitHub
18 changed files with 276 additions and 133 deletions

View File

@@ -4295,6 +4295,13 @@ public:
}
void visitPlaceholderType(const PlaceholderType *) {
// If for some reason we have a placeholder type while compiling with
// errors, just serialize an ErrorType and continue.
if (S.getASTContext().LangOpts.AllowModuleWithCompilerErrors) {
visitErrorType(
cast<ErrorType>(ErrorType::get(S.getASTContext()).getPointer()));
return;
}
llvm_unreachable("should not serialize a PlaceholderType");
}