TypeSourceInfo *GetTypeSourceInfo(const RecordData &Record,
unsigned &Idx);
+ /// \brief Resolve and return the translation unit declaration.
+ TranslationUnitDecl *GetTranslationUnitDecl();
+
/// \brief Resolve a type ID into a type, potentially building a new
/// type.
QualType GetType(pch::TypeID ID);
PP->setExternalSource(this);
// Load the translation unit declaration
- ReadDeclRecord(DeclOffsets[0], 0);
+ GetTranslationUnitDecl();
// Load the special types.
Context->setBuiltinVaListType(
return GetDecl(ID);
}
+TranslationUnitDecl *PCHReader::GetTranslationUnitDecl() {
+ if (!DeclsLoaded[0])
+ ReadDeclRecord(DeclOffsets[0], 0);
+
+ return cast<TranslationUnitDecl>(DeclsLoaded[0]);
+}
+
Decl *PCHReader::GetDecl(pch::DeclID ID) {
if (ID == 0)
return 0;