In the AST reader, factor out the mapping of local type IDs to global
type IDs into a single place, and make sure that all of the callers
use the appropriate functions to do the mapping. Since the mapping is
still the identity function, this is essentially a no-op.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135733 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Serialization/ASTReaderStmt.cpp b/lib/Serialization/ASTReaderStmt.cpp
index 962fd23..03ffaf4 100644
--- a/lib/Serialization/ASTReaderStmt.cpp
+++ b/lib/Serialization/ASTReaderStmt.cpp
@@ -305,7 +305,7 @@
void ASTStmtReader::VisitExpr(Expr *E) {
VisitStmt(E);
- E->setType(Reader.GetType(Record[Idx++]));
+ E->setType(Reader.readType(F, Record, Idx));
E->setTypeDependent(Record[Idx++]);
E->setValueDependent(Record[Idx++]);
E->setInstantiationDependent(Record[Idx++]);
@@ -540,8 +540,8 @@
void ASTStmtReader::VisitCompoundAssignOperator(CompoundAssignOperator *E) {
VisitBinaryOperator(E);
- E->setComputationLHSType(Reader.GetType(Record[Idx++]));
- E->setComputationResultType(Reader.GetType(Record[Idx++]));
+ E->setComputationLHSType(Reader.readType(F, Record, Idx));
+ E->setComputationResultType(Reader.readType(F, Record, Idx));
}
void ASTStmtReader::VisitConditionalOperator(ConditionalOperator *E) {
@@ -826,7 +826,7 @@
E->setBase(Reader.ReadSubExpr());
break;
case 1:
- E->setSuperReceiver(Reader.GetType(Record[Idx++]));
+ E->setSuperReceiver(Reader.readType(F, Record, Idx));
break;
case 2:
E->setClassReceiver(ReadDeclAs<ObjCInterfaceDecl>(Record, Idx));
@@ -852,7 +852,7 @@
case ObjCMessageExpr::SuperClass:
case ObjCMessageExpr::SuperInstance: {
- QualType T = Reader.GetType(Record[Idx++]);
+ QualType T = Reader.readType(F, Record, Idx);
SourceLocation SuperLoc = ReadSourceLocation(Record, Idx);
E->setSuper(SuperLoc, T, Kind == ObjCMessageExpr::SuperInstance);
break;
@@ -1155,7 +1155,7 @@
Record[Idx++]);
E->Base = Reader.ReadSubExpr();
- E->BaseType = Reader.GetType(Record[Idx++]);
+ E->BaseType = Reader.readType(F, Record, Idx);
E->IsArrow = Record[Idx++];
E->OperatorLoc = ReadSourceLocation(Record, Idx);
E->QualifierLoc = Reader.ReadNestedNameSpecifierLoc(F, Record, Idx);
@@ -1213,7 +1213,7 @@
E->IsArrow = Record[Idx++];
E->HasUnresolvedUsing = Record[Idx++];
E->Base = Reader.ReadSubExpr();
- E->BaseType = Reader.GetType(Record[Idx++]);
+ E->BaseType = Reader.readType(F, Record, Idx);
E->OperatorLoc = ReadSourceLocation(Record, Idx);
}
@@ -1620,7 +1620,7 @@
AccessSpecifier AS = (AccessSpecifier)Record[Idx++];
DeclAccessPair FoundDecl = DeclAccessPair::make(FoundD, AS);
- QualType T = GetType(Record[Idx++]);
+ QualType T = readType(F, Record, Idx);
ExprValueKind VK = static_cast<ExprValueKind>(Record[Idx++]);
ExprObjectKind OK = static_cast<ExprObjectKind>(Record[Idx++]);
Expr *Base = ReadSubExpr();