Fix a regression of a previous commit of mine (rdar://8158953).
Some of the invariant checks for creating Record/Enum types don't hold true during PCH reading.
Introduce more suitable ASTContext::getRecordType() and getEnumType().
llvm-svn: 107598
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp
index 27ca86f..aaa80fe 100644
--- a/clang/lib/Frontend/PCHReader.cpp
+++ b/clang/lib/Frontend/PCHReader.cpp
@@ -2149,14 +2149,14 @@
Error("incorrect encoding of record type");
return QualType();
}
- return Context->getTypeDeclType(cast<RecordDecl>(GetDecl(Record[0])));
+ return Context->getRecordType(cast<RecordDecl>(GetDecl(Record[0])));
case pch::TYPE_ENUM:
if (Record.size() != 1) {
Error("incorrect encoding of enum type");
return QualType();
}
- return Context->getTypeDeclType(cast<EnumDecl>(GetDecl(Record[0])));
+ return Context->getEnumType(cast<EnumDecl>(GetDecl(Record[0])));
case pch::TYPE_ELABORATED: {
unsigned Idx = 0;