[TextAPI] Fix & Add tests for tbd files version 3.

- There was a simple typo in TextStub code that prevented version 3 files to be read.
- Included a version 3 unit test to handle the differences in the format.
- Also a typo in Error.h inside the comments.

https://reviews.llvm.org/D66041

This patch is from Cyndy Ishida <cyndy_ishida@apple.com>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368630 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Juergen Ributzka
2019-08-12 23:01:07 +00:00
parent cf1063f8cb
commit 95e7e916d4
4 changed files with 443 additions and 6 deletions
+4 -4
View File
@@ -534,9 +534,9 @@ template <> struct MappingTraits<const InterfaceFile *> {
// prope file type when reading.
if (!IO.outputting()) {
if (IO.mapTag("!tapi-tbd-v2", false))
Ctx->FileKind = FileType::TBD_V2;
else if (IO.mapTag("!tapi-tbd-v3", false))
if (IO.mapTag("!tapi-tbd-v3", false))
Ctx->FileKind = FileType::TBD_V3;
else if (IO.mapTag("!tapi-tbd-v2", false))
Ctx->FileKind = FileType::TBD_V2;
else if (IO.mapTag("!tapi-tbd-v1", false) ||
IO.mapTag("tag:yaml.org,2002:map", false))
@@ -547,7 +547,7 @@ template <> struct MappingTraits<const InterfaceFile *> {
}
}
// Set file tyoe when writing.
// Set file type when writing.
if (IO.outputting()) {
switch (Ctx->FileKind) {
default: