13#ifndef LLVM_CLANG_SERIALIZATION_ASTREADER_H
14#define LLVM_CLANG_SERIALIZATION_ASTREADER_H
37#include "llvm/ADT/ArrayRef.h"
38#include "llvm/ADT/DenseMap.h"
39#include "llvm/ADT/DenseSet.h"
40#include "llvm/ADT/IntrusiveRefCntPtr.h"
41#include "llvm/ADT/MapVector.h"
42#include "llvm/ADT/PagedVector.h"
43#include "llvm/ADT/STLExtras.h"
44#include "llvm/ADT/SetVector.h"
45#include "llvm/ADT/SmallPtrSet.h"
46#include "llvm/ADT/SmallVector.h"
47#include "llvm/ADT/StringMap.h"
48#include "llvm/ADT/StringRef.h"
49#include "llvm/ADT/iterator.h"
50#include "llvm/ADT/iterator_range.h"
51#include "llvm/Bitstream/BitstreamReader.h"
52#include "llvm/Support/MemoryBuffer.h"
53#include "llvm/Support/SaveAndRestore.h"
54#include "llvm/Support/Timer.h"
55#include "llvm/Support/VersionTuple.h"
136 StringRef ModuleFilename,
bool Complain,
137 bool AllowCompatibleDifferences) {
145 StringRef ModuleFilename,
bool Complain,
146 bool AllowCompatibleDifferences) {
155 StringRef ModuleFilename,
bool Complain,
156 bool AllowCompatibleDifferences) {
165 StringRef ModuleFilename,
bool Complain) {
187 StringRef ModuleFilename,
188 StringRef ContextHash,
bool Complain) {
215 StringRef ModuleFilename,
216 bool ReadMacros,
bool Complain,
217 std::string &SuggestedPredefines) {
244 bool isOverridden,
bool isExplicitModule) {
255 StringRef Filename,
bool isSystem,
256 bool isOverridden, time_t StoredTime,
257 bool isExplicitModule) {
267 virtual void visitImport(StringRef ModuleName, StringRef Filename) {}
276 std::unique_ptr<ASTReaderListener> First;
277 std::unique_ptr<ASTReaderListener> Second;
282 std::unique_ptr<ASTReaderListener> Second)
283 : First(
std::move(First)), Second(
std::move(Second)) {}
285 std::unique_ptr<ASTReaderListener>
takeFirst() {
return std::move(First); }
286 std::unique_ptr<ASTReaderListener>
takeSecond() {
return std::move(Second); }
292 StringRef ModuleFilename,
bool Complain,
293 bool AllowCompatibleDifferences)
override;
295 StringRef ModuleFilename,
bool Complain,
296 bool AllowCompatibleDifferences)
override;
298 StringRef ModuleFilename,
bool Complain,
299 bool AllowCompatibleDifferences)
override;
301 StringRef ModuleFilename,
bool Complain)
override;
303 bool Complain)
override;
306 StringRef ModuleFilename, StringRef ContextHash,
307 bool Complain)
override;
309 StringRef ModuleFilename,
bool ReadMacros,
311 std::string &SuggestedPredefines)
override;
319 bool isOverridden,
bool isExplicitModule)
override;
332 : PP(PP), Reader(Reader) {}
335 StringRef ModuleFilename,
bool Complain,
336 bool AllowCompatibleDifferences)
override;
338 StringRef ModuleFilename,
bool Complain,
339 bool AllowCompatibleDifferences)
override;
341 StringRef ModuleFilename,
bool Complain,
342 bool AllowCompatibleDifferences)
override;
344 StringRef ModuleFilename,
bool Complain)
override;
346 StringRef ModuleFilename,
bool ReadMacros,
348 std::string &SuggestedPredefines)
override;
350 StringRef ModuleFilename, StringRef ContextHash,
351 bool Complain)
override;
366 StringRef ModuleFilename,
bool ReadMacros,
368 std::string &SuggestedPredefines)
override;
371namespace serialization {
373class ReadMethodPoolVisitor;
482 std::unique_ptr<ASTReaderListener> Listener;
487 bool OwnsDeserializationListener =
false;
499 Sema *SemaObj =
nullptr;
522 llvm::StringMap<std::shared_ptr<ModuleFileExtension>> ModuleFileExtensions;
525 std::unique_ptr<llvm::Timer> ReadTimer;
528 std::optional<llvm::TimeRegion> ReadTimeRegion;
535 std::optional<ModuleKind> CurrentDeserializingModuleKind;
538 std::unique_ptr<GlobalModuleIndex> GlobalIndex;
547 using GlobalSLocOffsetMapType =
552 GlobalSLocOffsetMapType GlobalSLocOffsetMap;
558 llvm::PagedVector<QualType> TypesLoaded;
564 llvm::PagedVector<Decl *> DeclsLoaded;
566 using FileOffset = std::pair<ModuleFile *, uint64_t>;
568 using DeclUpdateOffsetsMap = llvm::DenseMap<GlobalDeclID, FileOffsetsTy>;
572 DeclUpdateOffsetsMap DeclUpdateOffsets;
574 using DelayedNamespaceOffsetMapTy =
575 llvm::DenseMap<GlobalDeclID, LookupBlockOffsets>;
585 DelayedNamespaceOffsetMapTy DelayedNamespaceOffsetMap;
601 llvm::DenseMap<GlobalDeclID, SmallVector<GlobalDeclID, 4>> RelatedDeclsMap;
603 struct PendingUpdateRecord {
611 : D(D), ID(ID), JustLoaded(JustLoaded) {}
618 enum class PendingFakeDefinitionKind { NotFake, Fake, FakeLoaded };
622 llvm::DenseMap<void *, PendingFakeDefinitionKind> PendingFakeDefinitionData;
628 llvm::SmallMapVector<Decl *, FunctionDecl *, 4> PendingExceptionSpecUpdates;
633 llvm::SmallMapVector<FunctionDecl *, QualType, 4> PendingDeducedTypeUpdates;
641 llvm::DenseMap<std::pair<DeclContext *, IdentifierInfo *>, NamedDecl *>
642 ImportedTypedefNamesForLinkage;
646 llvm::DenseMap<Decl*, llvm::SmallVector<NamedDecl*, 2>>
647 AnonymousDeclarationsForMerging;
650 llvm::DenseMap<std::pair<const Decl *, unsigned>, NamedDecl *>
651 LambdaDeclarationsForMerging;
655 using LETemporaryKey = std::pair<Decl *, unsigned>;
658 llvm::DenseMap<LETemporaryKey, LifetimeExtendedTemporaryDecl *>
659 LETemporaryForMerging;
661 struct FileDeclsInfo {
665 FileDeclsInfo() =
default;
668 : Mod(Mod), Decls(Decls) {}
672 llvm::DenseMap<FileID, FileDeclsInfo> FileDeclIDs;
676 using LexicalContents = ArrayRef<serialization::unaligned_decl_id_t>;
679 llvm::DenseMap<const DeclContext*, std::pair<ModuleFile*, LexicalContents>>
683 std::vector<std::pair<ModuleFile*, LexicalContents>> TULexicalDecls;
686 llvm::DenseMap<
const DeclContext *,
687 serialization::reader::DeclContextLookupTable> Lookups;
688 llvm::DenseMap<
const DeclContext *,
689 serialization::reader::ModuleLocalLookupTable>
691 llvm::DenseMap<
const DeclContext *,
692 serialization::reader::DeclContextLookupTable>
695 using SpecLookupTableTy =
696 llvm::DenseMap<
const Decl *,
697 serialization::reader::LazySpecializationInfoLookupTable>;
699 SpecLookupTableTy SpecializationsLookups;
701 SpecLookupTableTy PartialSpecializationsLookups;
703 bool LoadExternalSpecializationsImpl(SpecLookupTableTy &SpecLookups,
705 bool LoadExternalSpecializationsImpl(SpecLookupTableTy &SpecLookups,
707 ArrayRef<TemplateArgument> TemplateArgs);
715 const unsigned char *Data;
717 using DeclContextVisibleUpdates = SmallVector<UpdateData, 1>;
721 llvm::DenseMap<GlobalDeclID, DeclContextVisibleUpdates> PendingVisibleUpdates;
722 llvm::DenseMap<GlobalDeclID, DeclContextVisibleUpdates>
723 PendingModuleLocalVisibleUpdates;
724 llvm::DenseMap<GlobalDeclID, DeclContextVisibleUpdates> TULocalUpdates;
726 using SpecializationsUpdate = SmallVector<UpdateData, 1>;
727 using SpecializationsUpdateMap =
728 llvm::DenseMap<GlobalDeclID, SpecializationsUpdate>;
729 SpecializationsUpdateMap PendingSpecializationsUpdates;
730 SpecializationsUpdateMap PendingPartialSpecializationsUpdates;
734 llvm::SmallPtrSet<Decl *, 4> PendingDefinitions;
736 using PendingBodiesMap =
738 llvm::SmallDenseMap<Decl *, unsigned, 4>,
739 SmallVector<std::pair<Decl *, uint64_t>, 4>>;
742 PendingBodiesMap PendingBodies;
746 llvm::SetVector<NamedDecl *> PendingMergedDefinitionsToDeduplicate;
751 llvm::SmallVector<std::pair<Decl *, Decl *>>
752 PendingWarningForDuplicatedDefsInModuleUnits;
755 bool ReadLexicalDeclContextStorage(
ModuleFile &M,
756 llvm::BitstreamCursor &Cursor,
757 uint64_t Offset, DeclContext *DC);
759 enum class VisibleDeclContextStorageKind {
766 bool ReadVisibleDeclContextStorage(
ModuleFile &M,
767 llvm::BitstreamCursor &Cursor,
768 uint64_t Offset, GlobalDeclID ID,
769 VisibleDeclContextStorageKind VisibleKind);
771 bool ReadSpecializations(
ModuleFile &M, llvm::BitstreamCursor &Cursor,
772 uint64_t Offset, Decl *D,
bool IsPartial);
773 void AddSpecializations(
const Decl *D,
const unsigned char *
Data,
782 std::vector<IdentifierInfo *> IdentifiersLoaded;
790 std::vector<MacroInfo *> MacrosLoaded;
792 using LoadedMacroInfo =
793 std::pair<IdentifierInfo *, serialization::SubmoduleID>;
798 llvm::DenseSet<LoadedMacroInfo> LoadedUndefs;
804 SmallVector<Module *, 2> SubmodulesLoaded;
806 using GlobalSubmoduleMapType =
807 ContinuousRangeMap<serialization::SubmoduleID, ModuleFile *, 4>;
812 GlobalSubmoduleMapType GlobalSubmoduleMap;
815 using HiddenNames = SmallVector<Decl *, 2>;
816 using HiddenNamesMapType = llvm::DenseMap<Module *, HiddenNames>;
820 HiddenNamesMapType HiddenNamesMap;
823 struct UnresolvedModuleRef {
831 enum { Import, Export, Conflict, Affecting } Kind;
837 LLVM_PREFERRED_TYPE(
bool)
838 unsigned IsWildcard : 1;
846 SmallVector<UnresolvedModuleRef, 2> UnresolvedModuleRefs;
853 SmallVector<Selector, 16> SelectorsLoaded;
855 using GlobalSelectorMapType =
856 ContinuousRangeMap<serialization::SelectorID, ModuleFile *, 4>;
860 GlobalSelectorMapType GlobalSelectorMap;
864 llvm::DenseMap<Selector, unsigned> SelectorGeneration;
868 llvm::DenseMap<Selector, bool> SelectorOutOfDate;
870 struct PendingMacroInfo {
875 PendingMacroInfo(
ModuleFile *M, uint32_t MacroDirectivesOffset)
876 : M(M), MacroDirectivesOffset(MacroDirectivesOffset) {}
879 using PendingMacroIDsMap =
880 llvm::MapVector<IdentifierInfo *, SmallVector<PendingMacroInfo, 2>>;
884 PendingMacroIDsMap PendingMacroIDs;
886 using GlobalPreprocessedEntityMapType =
887 ContinuousRangeMap<unsigned, ModuleFile *, 4>;
892 GlobalPreprocessedEntityMapType GlobalPreprocessedEntityMap;
894 using GlobalSkippedRangeMapType =
895 ContinuousRangeMap<unsigned, ModuleFile *, 4>;
899 GlobalSkippedRangeMapType GlobalSkippedRangeMap;
911 SmallVector<GlobalDeclID, 16> EagerlyDeserializedDecls;
916 SmallVector<GlobalDeclID, 16> VTablesToEmit;
923 SmallVector<GlobalDeclID, 16> TentativeDefinitions;
935 SmallVector<VTableUse> VTableUses;
943 struct PendingInstantiation {
947 SmallVector<PendingInstantiation, 64> PendingInstantiations;
957 SmallVector<GlobalDeclID, 16> UnusedFileScopedDecls;
961 SmallVector<GlobalDeclID, 4> DelegatingCtorDecls;
965 SmallVector<serialization::SelectorID, 64> ReferencedSelectorsData;
969 SmallVector<serialization::IdentifierID, 64> WeakUndeclaredIdentifiers;
974 SmallVector<GlobalDeclID, 4> ExtVectorDecls;
985 SmallVector<GlobalDeclID, 16> UnusedLocalTypedefNameCandidates;
989 unsigned ForceHostDeviceDepth = 0;
994 SmallVector<GlobalDeclID, 4> SemaDeclRefs;
999 SmallVector<serialization::TypeID, 16> SpecialTypes;
1005 SmallVector<GlobalDeclID, 4> CUDASpecialDeclRefs;
1008 SmallVector<uint64_t, 1> FPPragmaOptions;
1011 SourceLocation OptimizeOffPragmaLocation;
1014 int PragmaMSStructState = -1;
1017 int PragmaMSPointersToMembersState = -1;
1018 SourceLocation PointersToMembersPragmaLocation;
1021 std::optional<FPOptionsOverride> FpPragmaCurrentValue;
1022 SourceLocation FpPragmaCurrentLocation;
1023 struct FpPragmaStackEntry {
1024 FPOptionsOverride Value;
1025 SourceLocation Location;
1026 SourceLocation PushLocation;
1027 StringRef SlotLabel;
1029 llvm::SmallVector<FpPragmaStackEntry, 2> FpPragmaStack;
1030 llvm::SmallVector<std::string, 2> FpPragmaStrings;
1033 std::optional<Sema::AlignPackInfo> PragmaAlignPackCurrentValue;
1034 SourceLocation PragmaAlignPackCurrentLocation;
1035 struct PragmaAlignPackStackEntry {
1036 Sema::AlignPackInfo Value;
1037 SourceLocation Location;
1038 SourceLocation PushLocation;
1039 StringRef SlotLabel;
1041 llvm::SmallVector<PragmaAlignPackStackEntry, 2> PragmaAlignPackStack;
1042 llvm::SmallVector<std::string, 2> PragmaAlignPackStrings;
1045 OpenCLOptions OpenCLExtensions;
1048 llvm::DenseMap<const Type *, std::set<std::string>> OpenCLTypeExtMap;
1051 llvm::DenseMap<const Decl *, std::set<std::string>> OpenCLDeclExtMap;
1054 SmallVector<GlobalDeclID, 4> KnownNamespaces;
1058 struct UndefinedButUsedDecl {
1062 SmallVector<UndefinedButUsedDecl, 8> UndefinedButUsed;
1065 SmallVector<uint64_t, 8> DelayedDeleteExprs;
1068 SmallVector<std::pair<ModuleFile *, SmallVector<uint64_t, 1>>, 4>
1069 LateParsedTemplates;
1074 llvm::SmallSetVector<GlobalDeclID, 4> DeclsToCheckForDeferredDiags;
1077 SmallVector<GlobalDeclID> DeclsWithEffectsToVerify;
1080 SmallVector<bool, 3> RISCVVecIntrinsicPragma;
1083 struct ImportedSubmodule {
1085 SourceLocation ImportLoc;
1088 : ID(ID), ImportLoc(ImportLoc) {}
1095 SmallVector<ImportedSubmodule, 2> PendingImportedModules;
1099 SmallVector<ImportedSubmodule, 2> PendingImportedModulesSema;
1104 std::string isysroot;
1111 bool AllowASTWithCompilerErrors;
1115 bool AllowConfigurationMismatch;
1118 bool ValidateSystemInputs;
1121 bool ForceValidateUserInputs;
1124 bool ValidateASTInputFilesContent;
1127 bool UseGlobalIndex;
1130 bool TriedLoadingGlobalIndex =
false;
1133 bool ProcessingUpdateRecords =
false;
1135 using SwitchCaseMapTy = llvm::DenseMap<unsigned, SwitchCase *>;
1141 SwitchCaseMapTy SwitchCaseStmts;
1143 SwitchCaseMapTy *CurrSwitchCaseStmts;
1147 unsigned NumSLocEntriesRead = 0;
1150 unsigned TotalNumSLocEntries = 0;
1154 unsigned NumStatementsRead = 0;
1158 unsigned TotalNumStatements = 0;
1161 unsigned NumMacrosRead = 0;
1164 unsigned TotalNumMacros = 0;
1167 unsigned NumIdentifierLookups = 0;
1170 unsigned NumIdentifierLookupHits = 0;
1173 unsigned NumSelectorsRead = 0;
1176 unsigned NumMethodPoolEntriesRead = 0;
1180 unsigned NumMethodPoolLookups = 0;
1184 unsigned NumMethodPoolHits = 0;
1188 unsigned NumMethodPoolTableLookups = 0;
1192 unsigned NumMethodPoolTableHits = 0;
1195 unsigned TotalNumMethodPoolEntries = 0;
1198 unsigned NumLexicalDeclContextsRead = 0, TotalLexicalDeclContexts = 0;
1201 unsigned NumVisibleDeclContextsRead = 0, TotalVisibleDeclContexts = 0;
1204 unsigned NumModuleLocalVisibleDeclContexts = 0,
1205 TotalModuleLocalVisibleDeclContexts = 0;
1208 unsigned NumTULocalVisibleDeclContexts = 0,
1209 TotalTULocalVisibleDeclContexts = 0;
1212 uint64_t TotalModulesSizeInBits = 0;
1215 unsigned NumCurrentElementsDeserializing = 0;
1221 bool CanPassDeclsToConsumer =
true;
1228 llvm::MapVector<IdentifierInfo *, SmallVector<GlobalDeclID, 4>>
1229 PendingIdentifierInfos;
1233 llvm::SmallMapVector<const IdentifierInfo *, SmallVector<NamedDecl *, 2>, 16>
1234 PendingFakeLookupResults;
1238 llvm::DenseMap<const IdentifierInfo *, unsigned> IdentifierGeneration;
1246 std::deque<Decl *> PotentiallyInterestingDecls;
1251 SmallVector<std::pair<FunctionDecl *, serialization::TypeID>, 16>
1252 PendingDeducedFunctionTypes;
1257 SmallVector<std::pair<VarDecl *, serialization::TypeID>, 16>
1258 PendingDeducedVarTypes;
1263 SmallVector<std::pair<Decl *, uint64_t>, 16> PendingDeclChains;
1267 SmallVector<Decl *, 16> PendingIncompleteDeclChains;
1271 struct PendingDeclContextInfo {
1273 GlobalDeclID SemaDC;
1274 GlobalDeclID LexicalDC;
1282 std::deque<PendingDeclContextInfo> PendingDeclContextInfos;
1284 template <
typename DeclTy>
1285 using DuplicateObjCDecls = std::pair<DeclTy *, DeclTy *>;
1291 llvm::SmallMapVector<DuplicateObjCDecls<ObjCCategoryDecl>,
1292 llvm::SmallVector<DuplicateObjCDecls<ObjCIvarDecl>, 4>,
1294 PendingObjCExtensionIvarRedeclarations;
1299 SmallVector<std::pair<CXXRecordDecl*, Decl*>, 4> PendingAddedClassMembers;
1307 llvm::SmallVector<NamedDecl *, 16> PendingOdrMergeChecks;
1309 using DataPointers =
1310 std::pair<CXXRecordDecl *, struct CXXRecordDecl::DefinitionData *>;
1311 using ObjCInterfaceDataPointers =
1312 std::pair<ObjCInterfaceDecl *,
1313 struct ObjCInterfaceDecl::DefinitionData *>;
1314 using ObjCProtocolDataPointers =
1315 std::pair<ObjCProtocolDecl *, struct ObjCProtocolDecl::DefinitionData *>;
1318 llvm::SmallDenseMap<CXXRecordDecl *, llvm::SmallVector<DataPointers, 2>, 2>
1319 PendingOdrMergeFailures;
1322 llvm::SmallDenseMap<RecordDecl *, llvm::SmallVector<RecordDecl *, 2>, 2>
1323 PendingRecordOdrMergeFailures;
1326 llvm::SmallDenseMap<FunctionDecl *, llvm::SmallVector<FunctionDecl *, 2>, 2>
1327 PendingFunctionOdrMergeFailures;
1330 llvm::SmallDenseMap<EnumDecl *, llvm::SmallVector<EnumDecl *, 2>, 2>
1331 PendingEnumOdrMergeFailures;
1334 llvm::SmallDenseMap<ObjCInterfaceDecl *,
1335 llvm::SmallVector<ObjCInterfaceDataPointers, 2>, 2>
1336 PendingObjCInterfaceOdrMergeFailures;
1339 llvm::SmallDenseMap<ObjCProtocolDecl *,
1340 llvm::SmallVector<ObjCProtocolDataPointers, 2>, 2>
1341 PendingObjCProtocolOdrMergeFailures;
1344 llvm::SmallPtrSet<DeclContext*, 2> DiagnosedOdrMergeFailures;
1348 llvm::SmallPtrSet<ObjCCategoryDecl *, 16> CategoriesDeserialized;
1353 SmallVector<ObjCInterfaceDecl *, 16> ObjCClassesLoaded;
1355 using KeyDeclsMap = llvm::DenseMap<Decl *, SmallVector<GlobalDeclID, 2>>;
1362 KeyDeclsMap KeyDecls;
1367 llvm::DenseMap<DeclContext *, DeclContext *> MergedDeclContexts;
1371 llvm::DenseMap<EnumDecl *, EnumDecl *> EnumDefinitions;
1375 llvm::DenseMap<RecordDecl *, RecordDecl *> RecordDefinitions;
1378 SmallVector<Stmt *, 16> StmtStack;
1382 Read_None, Read_Decl, Read_Type, Read_Stmt
1386 ReadingKind ReadingKind = Read_None;
1389 class ReadingKindTracker {
1391 enum ReadingKind PrevKind;
1394 ReadingKindTracker(
enum ReadingKind newKind,
ASTReader &reader)
1395 : Reader(reader), PrevKind(Reader.ReadingKind) {
1396 Reader.ReadingKind = newKind;
1399 ReadingKindTracker(
const ReadingKindTracker &) =
delete;
1400 ReadingKindTracker &operator=(
const ReadingKindTracker &) =
delete;
1401 ~ReadingKindTracker() { Reader.ReadingKind = PrevKind; }
1405 class ProcessingUpdatesRAIIObj {
1410 ProcessingUpdatesRAIIObj(
ASTReader &reader)
1411 : Reader(reader), PrevState(Reader.ProcessingUpdateRecords) {
1412 Reader.ProcessingUpdateRecords =
true;
1415 ProcessingUpdatesRAIIObj(
const ProcessingUpdatesRAIIObj &) =
delete;
1416 ProcessingUpdatesRAIIObj &
1417 operator=(
const ProcessingUpdatesRAIIObj &) =
delete;
1418 ~ProcessingUpdatesRAIIObj() { Reader.ProcessingUpdateRecords = PrevState; }
1429 std::string SuggestedPredefines;
1431 llvm::DenseMap<const Decl *, bool> DefinitionSource;
1435 llvm::DenseSet<const FunctionDecl *> ThisDeclarationWasADefinitionSet;
1437 bool shouldDisableValidationForFile(
const serialization::ModuleFile &M)
const;
1443 serialization::InputFileInfo getInputFileInfo(
ModuleFile &F,
unsigned ID);
1447 serialization::InputFile getInputFile(
ModuleFile &F,
unsigned ID,
1448 bool Complain =
true);
1451 SmallString<0> PathBuf;
1454 class TemporarilyOwnedStringRef {
1456 llvm::SaveAndRestore<SmallString<0>> UnderlyingBuffer;
1459 TemporarilyOwnedStringRef(StringRef S, SmallString<0> &UnderlyingBuffer)
1460 : String(S), UnderlyingBuffer(UnderlyingBuffer, {}) {}
1463 const StringRef *operator->() const & {
return &String; }
1464 const StringRef &operator*() const & {
return String; }
1467 const StringRef *operator->() && =
delete;
1468 const StringRef &operator*() && =
delete;
1477 static TemporarilyOwnedStringRef
1481 static TemporarilyOwnedStringRef
1501 auto I = KeyDecls.find(D);
1502 if (I == KeyDecls.end() || I->second.empty())
1511 template <
typename Fn>
1517 auto It = KeyDecls.find(
const_cast<Decl*
>(D));
1518 if (It != KeyDecls.end())
1519 for (
auto ID : It->second)
1555 off_t ExpectedSize, time_t ExpectedModTime,
1557 unsigned ClientLoadCapabilities);
1563 unsigned ClientLoadCapabilities);
1565 ReadOptionsBlock(llvm::BitstreamCursor &Stream, StringRef Filename,
1566 unsigned ClientLoadCapabilities,
1567 bool AllowCompatibleConfigurationMismatch,
1569 std::string &SuggestedPredefines);
1576 unsigned ClientLoadCapabilities);
1579 ModuleFile *F, llvm::StringRef StreamData, StringRef Filename,
1580 unsigned ClientLoadCapabilities,
1582 bool ValidateDiagnosticOptions);
1584 llvm::Error ReadASTBlock(
ModuleFile &F,
unsigned ClientLoadCapabilities);
1585 llvm::Error ReadExtensionBlock(
ModuleFile &F);
1586 void ReadModuleOffsetMap(
ModuleFile &F)
const;
1588 llvm::Error ReadSourceManagerBlock(
ModuleFile &F);
1595 using RelocationResult = std::pair<std::optional<Module *>,
bool>;
1603 RelocationResult getModuleForRelocationChecks(
ModuleFile &F,
1604 bool DirectoryCheck =
false);
1607 unsigned ClientLoadCapabilities);
1608 llvm::Error ReadSubmoduleBlock(
ModuleFile &F,
1609 unsigned ClientLoadCapabilities);
1611 StringRef ModuleFilename,
bool Complain,
1613 bool AllowCompatibleDifferences);
1615 StringRef ModuleFilename,
bool Complain,
1617 bool AllowCompatibleDifferences);
1619 StringRef ModuleFilename,
bool Complain,
1621 bool AllowCompatibleDifferences);
1623 StringRef ModuleFilename,
bool Complain,
1625 static bool ParseFileSystemOptions(
const RecordData &
Record,
bool Complain,
1628 StringRef ModuleFilename,
bool Complain,
1630 static bool ParseHeaderSearchPaths(
const RecordData &
Record,
bool Complain,
1633 StringRef ModuleFilename,
bool Complain,
1635 std::string &SuggestedPredefines);
1637 struct RecordLocation {
1641 RecordLocation(
ModuleFile *M, uint64_t O) : F(M), Offset(O) {}
1646 void LoadedDecl(
unsigned Index, Decl *D);
1647 Decl *ReadDeclRecord(GlobalDeclID ID);
1648 void markIncompleteDeclChain(Decl *D);
1653 Decl *getMostRecentExistingDecl(Decl *D);
1655 RecordLocation DeclCursorForID(GlobalDeclID ID, SourceLocation &Location);
1656 void loadDeclUpdateRecords(PendingUpdateRecord &
Record);
1657 void loadPendingDeclChain(Decl *D, uint64_t LocalOffset);
1658 void loadObjCCategories(GlobalDeclID ID, ObjCInterfaceDecl *D,
1659 unsigned PreviousGeneration = 0);
1661 RecordLocation getLocalBitOffset(uint64_t GlobalOffset);
1666 unsigned findPreprocessedEntity(SourceLocation Loc,
bool EndsAfter)
const;
1674 unsigned findNextPreprocessedEntity(
1679 std::pair<ModuleFile *, unsigned>
1680 getModulePreprocessedEntity(
unsigned GlobalIndex);
1684 llvm::iterator_range<PreprocessingRecord::iterator>
1685 getModulePreprocessedEntities(
ModuleFile &Mod)
const;
1687 bool canRecoverFromOutOfDate(StringRef ModuleFileName,
1688 unsigned ClientLoadCapabilities);
1692 :
public llvm::iterator_adaptor_base<
1693 ModuleDeclIterator, const serialization::unaligned_decl_id_t *,
1694 std::random_access_iterator_tag, const Decl *, ptrdiff_t,
1695 const Decl *, const Decl *> {
1704 : iterator_adaptor_base(Pos), Reader(Reader), Mod(Mod) {}
1708 return Reader->GetDecl(Reader->getGlobalDeclID(*Mod, ID));
1714 assert(Reader == RHS.Reader && Mod == RHS.Mod);
1719 llvm::iterator_range<ModuleDeclIterator>
1723 bool isConsumerInterestedIn(
Decl *D);
1724 void PassInterestingDeclsToConsumer();
1725 void PassInterestingDeclToConsumer(
Decl *D);
1728 void finishPendingActions();
1729 void diagnoseOdrViolations();
1736 PendingDeclContextInfo Info = { D, SemaDC, LexicalDC };
1737 PendingDeclContextInfos.push_back(Info);
1744 void Error(StringRef Msg)
const;
1745 void Error(
unsigned DiagID, StringRef Arg1 = StringRef(),
1746 StringRef Arg2 = StringRef(), StringRef Arg3 = StringRef())
const;
1747 void Error(llvm::Error &&Err)
const;
1750 unsigned translateGlobalDeclIDToIndex(GlobalDeclID ID)
const;
1754 std::pair<ModuleFile *, unsigned>
1759 std::pair<ModuleFile *, unsigned>
1762 unsigned translatePreprocessedEntityIDToIndex(
1767 std::pair<ModuleFile *, unsigned>
1813 ASTReader(Preprocessor &PP, ModuleCache &ModCache, ASTContext *Context,
1814 const PCHContainerReader &PCHContainerRdr,
1815 const CodeGenOptions &CodeGenOpts,
1816 ArrayRef<std::shared_ptr<ModuleFileExtension>> Extensions,
1817 StringRef isysroot =
"",
1820 bool AllowASTWithCompilerErrors =
false,
1821 bool AllowConfigurationMismatch =
false,
1822 bool ValidateSystemInputs =
false,
1823 bool ForceValidateUserInputs =
true,
1824 bool ValidateASTInputFilesContent =
false,
1825 bool UseGlobalIndex =
true,
1826 std::unique_ptr<llvm::Timer> ReadTimer = {});
1890 unsigned ClientLoadCapabilities,
1915 return std::move(Listener);
1920 this->Listener = std::move(Listener);
1928 L = std::make_unique<ChainedASTReaderListener>(std::move(L),
1929 std::move(Listener));
1930 Listener = std::move(L);
1936 bool Chained =
false;
1941 auto Old = Reader.takeListener();
1944 L = std::make_unique<ChainedASTReaderListener>(std::move(L),
1947 Reader.setListener(std::move(L));
1951 auto New = Reader.takeListener();
1960 bool TakeOwnership =
false);
1964 return DeserializationListener;
1993 std::unique_ptr<llvm::MemoryBuffer> Buffer) {
1994 ModuleMgr.addInMemoryBuffer(
FileName, std::move(Buffer));
2014 return ModuleMgr.getPrimaryModule().OriginalSourceFileName;
2041 StringRef SpecificModuleCachePath,
2042 bool RequireStrictOptionMatches =
false);
2057 std::pair<unsigned, unsigned>
2075 return TotalNumSLocEntries;
2080 return static_cast<unsigned>(IdentifiersLoaded.size());
2085 return static_cast<unsigned>(MacrosLoaded.size());
2090 return static_cast<unsigned>(TypesLoaded.size());
2095 return static_cast<unsigned>(DeclsLoaded.size());
2100 return static_cast<unsigned>(SubmodulesLoaded.size());
2105 return static_cast<unsigned>(SelectorsLoaded.size());
2112 for (
const auto &M : ModuleMgr)
2113 Result += M.NumPreprocessedEntities;
2131 if (Idx >=
Record.size())
2207 template <
typename T>
2231 uint64_t *StartOfBlockOffset =
nullptr);
2261 llvm::function_ref<
bool(
Decl::Kind)> IsKindWeWant,
2330 llvm::MapVector<NamedDecl *, SourceLocation> &
Undefined)
override;
2357 SmallVectorImpl<std::pair<IdentifierInfo *, WeakInfo>> &WeakIDs)
override;
2366 llvm::MapVector<
const FunctionDecl *, std::unique_ptr<LateParsedTemplate>>
2386 llvm::function_ref<
void()> Fn);
2433 unsigned LocalID)
const;
2474 unsigned LocalID)
const;
2488 std::pair<SourceLocation, unsigned>
2496 ReadModuleOffsetMap(MF);
2502 assert(!SourceMgr.isLoadedSourceLocation(Loc) &&
2503 "Run out source location space");
2533 unsigned &Idx)
const {
2539 assert(FID.ID >= 0 &&
"Reading non-local FileID.");
2550 const StringRef Blob);
2564 unsigned &Idx, StringRef &Blob);
2580 assert(ReadingKind == Read_Stmt &&
2581 "Should be called only during statement reading!");
2584 assert(!StmtStack.empty() &&
"Read too many sub-statements!");
2585 return StmtStack.pop_back_val();
2609 uint32_t MacroDirectivesOffset);
2625 assert(ContextObj &&
"requested AST context when not loading AST");
2672 bool IncludeSystem,
bool Complain,
2674 bool isSystem)> Visitor);
2687 constexpr static uint32_t BitsIndexUpbound = 32;
2699 CurrentBitsIndex = 0;
2702 void advance(uint32_t BitsWidth) { CurrentBitsIndex += BitsWidth; }
2706 return Value & (1 << CurrentBitsIndex++);
2711 assert(Width < BitsIndexUpbound);
2712 uint32_t Ret = (Value >> CurrentBitsIndex) & ((1 << Width) - 1);
2713 CurrentBitsIndex += Width;
2718 return CurrentBitsIndex + Width < BitsIndexUpbound;
2722 bool isValid()
const {
return CurrentBitsIndex < BitsIndexUpbound; }
2725 uint32_t CurrentBitsIndex = ~0;
Defines the Diagnostic-related interfaces.
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
llvm::MachO::Record Record
Defines the clang::OpenCLOptions class.
Defines the clang::SourceLocation class and associated facilities.
Defines a utilitiy for warning once when close to out of stack space.
C Language Family Type Representation.
Defines version macros and version-related utility functions for Clang.
ASTConsumer - This is an abstract interface that should be implemented by clients that read ASTs.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
const LangOptions & getLangOpts() const
Abstract interface for callback invocations by the ASTReader.
virtual void visitModuleFile(ModuleFileName Filename, serialization::ModuleKind Kind)
This is called for each AST file loaded.
virtual bool ReadHeaderSearchOptions(const HeaderSearchOptions &HSOpts, StringRef ModuleFilename, StringRef ContextHash, bool Complain)
Receives the header search options.
virtual void ReadModuleMapFile(StringRef ModuleMapPath)
virtual bool needsInputFileVisitation()
Returns true if this ASTReaderListener wants to receive the input files of the AST file via visitInpu...
virtual bool ReadDiagnosticOptions(DiagnosticOptions &DiagOpts, StringRef ModuleFilename, bool Complain)
Receives the diagnostic options.
virtual bool ReadTargetOptions(const TargetOptions &TargetOpts, StringRef ModuleFilename, bool Complain, bool AllowCompatibleDifferences)
Receives the target options.
virtual bool visitInputFile(StringRef Filename, bool isSystem, bool isOverridden, bool isExplicitModule)
if needsInputFileVisitation returns true, this is called for each non-system input file of the AST Fi...
virtual bool ReadHeaderSearchPaths(const HeaderSearchOptions &HSOpts, bool Complain)
Receives the header search paths.
virtual bool ReadFileSystemOptions(const FileSystemOptions &FSOpts, bool Complain)
Receives the file system options.
virtual ~ASTReaderListener()
virtual bool ReadPreprocessorOptions(const PreprocessorOptions &PPOpts, StringRef ModuleFilename, bool ReadMacros, bool Complain, std::string &SuggestedPredefines)
Receives the preprocessor options.
virtual void readModuleFileExtension(const ModuleFileExtensionMetadata &Metadata)
Indicates that a particular module file extension has been read.
virtual bool ReadLanguageOptions(const LangOptions &LangOpts, StringRef ModuleFilename, bool Complain, bool AllowCompatibleDifferences)
Receives the language options.
virtual bool visitInputFileAsRequested(StringRef FilenameAsRequested, StringRef Filename, bool isSystem, bool isOverridden, time_t StoredTime, bool isExplicitModule)
Similiar to member function of visitInputFile but should be defined when there is a distinction betwe...
virtual void visitImport(StringRef ModuleName, StringRef Filename)
If needsImportVisitation returns true, this is called for each AST file imported by this AST file.
virtual bool needsImportVisitation() const
Returns true if this ASTReaderListener wants to receive the imports of the AST file via visitImport,...
virtual bool ReadFullVersionInformation(StringRef FullVersion)
Receives the full Clang version information.
virtual void ReadModuleName(StringRef ModuleName)
virtual void ReadCounter(const serialization::ModuleFile &M, uint32_t Value)
Receives COUNTER value.
virtual bool needsSystemInputFileVisitation()
Returns true if this ASTReaderListener wants to receive the system input files of the AST file via vi...
virtual bool ReadCodeGenOptions(const CodeGenOptions &CGOpts, StringRef ModuleFilename, bool Complain, bool AllowCompatibleDifferences)
Receives the codegen options.
ListenerScope(ASTReader &Reader, std::unique_ptr< ASTReaderListener > L)
value_type operator*() const
value_type operator->() const
bool operator==(const ModuleDeclIterator &RHS) const
ModuleDeclIterator(ASTReader *Reader, ModuleFile *Mod, const serialization::unaligned_decl_id_t *Pos)
Reads an AST files chain containing the contents of a translation unit.
std::optional< bool > isPreprocessedEntityInFileID(unsigned Index, FileID FID) override
Optionally returns true or false if the preallocated preprocessed entity with index Index came from f...
PreprocessedEntity * ReadPreprocessedEntity(unsigned Index) override
Read a preallocated preprocessed entity from the external source.
void markIdentifierUpToDate(const IdentifierInfo *II)
Note that this identifier is up-to-date.
void visitTopLevelModuleMaps(serialization::ModuleFile &MF, llvm::function_ref< void(FileEntryRef)> Visitor)
Visit all the top-level module maps loaded when building the given module file.
void setDeserializationListener(ASTDeserializationListener *Listener, bool TakeOwnership=false)
Set the AST deserialization listener.
SmallVectorImpl< uint64_t > RecordDataImpl
serialization::SubmoduleID getGlobalSubmoduleID(ModuleFile &M, unsigned LocalID) const
Retrieve the global submodule ID given a module and its local ID number.
ExtKind hasExternalDefinitions(const Decl *D) override
IdentifierTable & getIdentifierTable()
Retrieve the identifier table associated with the preprocessor.
SourceLocationEncoding::RawLocEncoding RawLocEncoding
ModuleManager & getModuleManager()
Retrieve the module manager.
ASTReader & operator=(const ASTReader &)=delete
bool isDeclIDFromModule(GlobalDeclID ID, ModuleFile &M) const
Returns true if global DeclID ID originated from module M.
friend class ASTIdentifierIterator
bool ReadSLocEntry(int ID) override
Read the source location entry with index ID.
void RecordSwitchCaseID(SwitchCase *SC, unsigned ID)
Record that the given ID maps to the given switch-case statement.
DiagnosticBuilder Diag(unsigned DiagID) const
Report a diagnostic.
unsigned getTotalNumPreprocessedEntities() const
Returns the number of preprocessed entities known to the AST reader.
ASTContext & getContext()
Retrieve the AST context that this AST reader supplements.
Decl * ReadDecl(ModuleFile &F, const RecordDataImpl &R, unsigned &I)
Reads a declaration from the given position in a record in the given module.
ModuleManager::ModuleIterator ModuleIterator
static std::string ReadString(const RecordDataImpl &Record, unsigned &Idx)
void ReadDeclsToCheckForDeferredDiags(llvm::SmallSetVector< Decl *, 4 > &Decls) override
Read the set of decls to be checked for deferred diags.
void InitializeSema(Sema &S) override
Initialize the semantic source with the Sema instance being used to perform semantic analysis on the ...
LoadFailureCapabilities
Flags that indicate what kind of AST loading failures the client of the AST reader can directly handl...
@ ARR_Missing
The client can handle an AST file that cannot load because it is missing.
@ ARR_None
The client can't handle any AST loading failures.
@ ARR_ConfigurationMismatch
The client can handle an AST file that cannot load because it's compiled configuration doesn't match ...
@ ARR_OutOfDate
The client can handle an AST file that cannot load because it is out-of-date relative to its input fi...
@ ARR_TreatModuleWithErrorsAsOutOfDate
If a module file is marked with errors treat it as out-of-date so the caller can rebuild it.
@ ARR_VersionMismatch
The client can handle an AST file that cannot load because it was built with a different version of C...
void ReadMismatchingDeleteExpressions(llvm::MapVector< FieldDecl *, llvm::SmallVector< std::pair< SourceLocation, bool >, 4 > > &Exprs) override
void FindFileRegionDecls(FileID File, unsigned Offset, unsigned Length, SmallVectorImpl< Decl * > &Decls) override
Get the decls that are contained in a file in the Offset/Length range.
std::string ReadPathBlob(StringRef BaseDirectory, const RecordData &Record, unsigned &Idx, StringRef &Blob)
SourceRange ReadSkippedRange(unsigned Index) override
Read a preallocated skipped range from the external source.
serialization::TypeID getGlobalTypeID(ModuleFile &F, serialization::LocalTypeID LocalID) const
Map a local type ID within a given AST file into a global type ID.
const std::string & getSuggestedPredefines()
Returns the suggested contents of the predefines buffer, which contains a (typically-empty) subset of...
void dump()
Dump information about the AST reader to standard error.
MacroInfo * ReadMacroRecord(ModuleFile &F, uint64_t Offset)
Reads the macro record located at the given offset.
SmallVector< std::pair< llvm::BitstreamCursor, serialization::ModuleFile * >, 8 > CommentsCursors
Cursors for comments blocks.
Selector getLocalSelector(ModuleFile &M, unsigned LocalID)
Retrieve a selector from the given module with its local ID number.
void FindExternalLexicalDecls(const DeclContext *DC, llvm::function_ref< bool(Decl::Kind)> IsKindWeWant, SmallVectorImpl< Decl * > &Decls) override
Read all of the declarations lexically stored in a declaration context.
ModuleFile * getOwningModuleFile(const Decl *D) const
Retrieve the module file that owns the given declaration, or NULL if the declaration is not from a mo...
std::optional< ASTSourceDescriptor > getSourceDescriptor(unsigned ID) override
Return a descriptor for the corresponding module.
const serialization::reader::DeclContextLookupTable * getLoadedLookupTables(DeclContext *Primary) const
Get the loaded lookup tables for Primary, if any.
T * ReadDeclAs(ModuleFile &F, const RecordDataImpl &R, unsigned &I)
Reads a declaration from the given position in a record in the given module.
QualType getLocalType(ModuleFile &F, serialization::LocalTypeID LocalID)
Resolve a local type ID within a given AST file into a type.
void ClearSwitchCaseIDs()
Sema::AlignPackInfo ReadAlignPackInfo(uint32_t Raw) const
Read a AlignPackInfo from raw form.
QualType readType(ModuleFile &F, const RecordData &Record, unsigned &Idx)
Read a type from the current position in the given record, which was read from the given AST file.
void SetGloballyVisibleDecls(IdentifierInfo *II, const SmallVectorImpl< GlobalDeclID > &DeclIDs, SmallVectorImpl< Decl * > *Decls=nullptr)
Set the globally-visible declarations associated with the given identifier.
serialization::ModuleKind ModuleKind
bool loadGlobalIndex()
Attempts to load the global index.
void ReadComments() override
Loads comments ranges.
SourceManager & getSourceManager() const
const serialization::reader::ModuleLocalLookupTable * getModuleLocalLookupTables(DeclContext *Primary) const
SourceLocation getSourceLocationForDeclID(GlobalDeclID ID)
Returns the source location for the decl ID.
const CodeGenOptions & getCodeGenOpts() const
void makeModuleVisible(Module *Mod, Module::NameVisibilityKind NameVisibility, SourceLocation ImportLoc)
Make the entities in the given module and any of its (non-explicit) submodules visible to name lookup...
unsigned getTotalNumSubmodules() const
Returns the number of submodules known.
ASTReader(const ASTReader &)=delete
SourceRange ReadSourceRange(ModuleFile &F, const RecordData &Record, unsigned &Idx)
Read a source range.
bool LoadExternalSpecializations(const Decl *D, bool OnlyPartial) override
Load all the external specializations for the Decl.
ASTReadResult ReadASTCore(ModuleFileName FileName, ModuleKind Type, SourceLocation ImportLoc, ModuleFile *ImportedBy, SmallVectorImpl< ImportedModule > &Loaded, off_t ExpectedSize, time_t ExpectedModTime, ASTFileSignature ExpectedSignature, unsigned ClientLoadCapabilities)
void finalizeForWriting()
Finalizes the AST reader's state before writing an AST file to disk.
Sema * getSema()
Retrieve the semantic analysis object used to analyze the translation unit in which the precompiled h...
static std::string ResolveImportedPathAndAllocate(SmallString< 0 > &Buf, StringRef Path, ModuleFile &ModF)
Resolve Path in the context of module file M.
friend class ASTDeclMerger
Types of AST files.
static StringRef ReadStringBlob(const RecordDataImpl &Record, unsigned &Idx, StringRef &Blob)
unsigned getTotalNumIdentifiers() const
Returns the number of identifiers found in the chain.
CXXCtorInitializer ** GetExternalCXXCtorInitializers(uint64_t Offset) override
Read the contents of a CXXCtorInitializer array.
void visitInputFileInfos(serialization::ModuleFile &MF, bool IncludeSystem, llvm::function_ref< void(const serialization::InputFileInfo &IFI, bool IsSystem)> Visitor)
Visit all the input file infos of the given module file.
const ModuleManager & getModuleManager() const
unsigned getTotalNumSLocs() const
Returns the number of source locations found in the chain.
void StartTranslationUnit(ASTConsumer *Consumer) override
Function that will be invoked when we begin parsing a new translation unit involving this external AS...
LocalDeclID mapGlobalIDToModuleFileGlobalID(ModuleFile &M, GlobalDeclID GlobalID)
Map a global declaration ID into the declaration ID used to refer to this declaration within the give...
void resolvePendingMacro(IdentifierInfo *II, const PendingMacroInfo &PMInfo)
void ReadTentativeDefinitions(SmallVectorImpl< VarDecl * > &TentativeDefs) override
Read the set of tentative definitions known to the external Sema source.
Decl * GetExternalDecl(GlobalDeclID ID) override
Resolve a declaration ID into a declaration, potentially building a new declaration.
serialization::MacroID ReadMacroID(ModuleFile &F, const RecordDataImpl &Record, unsigned &Idx)
Reads a macro ID from the given position in a record in the given module.
GlobalDeclID ReadDeclID(ModuleFile &F, const RecordDataImpl &Record, unsigned &Idx)
Reads a declaration ID from the given position in a record in the given module.
llvm::Expected< SourceLocation::UIntTy > readSLocOffset(ModuleFile *F, unsigned Index)
Try to read the offset of the SLocEntry at the given index in the given module file.
void forEachImportedKeyDecl(const Decl *D, Fn Visit)
Run a callback on each imported key declaration of D.
bool haveUnloadedSpecializations(const Decl *D) const
If we have any unloaded specialization for D.
friend class TypeLocReader
friend class PCHValidator
Stmt * ReadSubStmt()
Reads a sub-statement operand during statement reading.
void CompleteRedeclChain(const Decl *D) override
If any redeclarations of D have been imported since it was last checked, this digs out those redeclar...
Expr * ReadSubExpr()
Reads a sub-expression operand during statement reading.
SourceLocation TranslateSourceLocation(ModuleFile &ModuleFile, SourceLocation Loc) const
Translate a source location from another module file's source location space into ours.
static llvm::Error ReadBlockAbbrevs(llvm::BitstreamCursor &Cursor, unsigned BlockID, uint64_t *StartOfBlockOffset=nullptr)
ReadBlockAbbrevs - Enter a subblock of the specified BlockID with the specified cursor.
void SetIdentifierInfo(serialization::IdentifierID ID, IdentifierInfo *II)
std::pair< unsigned, unsigned > findPreprocessedEntitiesInRange(SourceRange Range) override
Returns a pair of [Begin, End) indices of preallocated preprocessed entities that Range encompasses.
IdentifierInfo * get(StringRef Name) override
Retrieve the IdentifierInfo for the named identifier.
IdentifierInfo * getLocalIdentifier(ModuleFile &M, uint64_t LocalID)
void visitInputFiles(serialization::ModuleFile &MF, bool IncludeSystem, bool Complain, llvm::function_ref< void(const serialization::InputFile &IF, bool isSystem)> Visitor)
Visit all the input files of the given module file.
Module * getModule(unsigned ID) override
Retrieve the module that corresponds to the given module ID.
friend class ASTDeclReader
llvm::iterator_range< ModuleDeclIterator > getModuleFileLevelDecls(ModuleFile &Mod)
Stmt * GetExternalDeclStmt(uint64_t Offset) override
Resolve the offset of a statement into a statement.
Selector GetExternalSelector(serialization::SelectorID ID) override
Resolve a selector ID into a selector.
unsigned getTotalNumSelectors() const
Returns the number of selectors found in the chain.
MacroInfo * getMacro(serialization::MacroID ID)
Retrieve the macro with the given ID.
void ReadUndefinedButUsed(llvm::MapVector< NamedDecl *, SourceLocation > &Undefined) override
Load the set of used but not defined functions or variables with internal linkage,...
void ReadDelegatingConstructors(SmallVectorImpl< CXXConstructorDecl * > &Decls) override
Read the set of delegating constructors known to the external Sema source.
unsigned getTotalNumTypes() const
Returns the number of types found in the chain.
QualType GetType(serialization::TypeID ID)
Resolve a type ID into a type, potentially building a new type.
void addPendingMacro(IdentifierInfo *II, ModuleFile *M, uint32_t MacroDirectivesOffset)
Add a macro to deserialize its macro directive history.
GlobalDeclID getGlobalDeclID(ModuleFile &F, LocalDeclID LocalID) const
Map from a local declaration ID within a given module to a global declaration ID.
Expr * ReadExpr(ModuleFile &F)
Reads an expression.
void ReadWeakUndeclaredIdentifiers(SmallVectorImpl< std::pair< IdentifierInfo *, WeakInfo > > &WeakIDs) override
Read the set of weak, undeclared identifiers known to the external Sema source.
void completeVisibleDeclsMap(const DeclContext *DC) override
Load all external visible decls in the given DeclContext.
void AssignedLambdaNumbering(CXXRecordDecl *Lambda) override
Notify the external source that a lambda was assigned a mangling number.
void ReadUnusedLocalTypedefNameCandidates(llvm::SmallSetVector< const TypedefNameDecl *, 4 > &Decls) override
Read the set of potentially unused typedefs known to the source.
IdentifierResolver & getIdResolver()
Get the identifier resolver used for name lookup / updates in the translation unit scope.
static bool readASTFileControlBlock(StringRef Filename, FileManager &FileMgr, const ModuleCache &ModCache, const PCHContainerReader &PCHContainerRdr, bool FindModuleFileExtensions, ASTReaderListener &Listener, bool ValidateDiagnosticOptions, unsigned ClientLoadCapabilities=ARR_ConfigurationMismatch|ARR_OutOfDate)
Read the control block for the named AST file.
void ReadExtVectorDecls(SmallVectorImpl< TypedefNameDecl * > &Decls) override
Read the set of ext_vector type declarations known to the external Sema source.
SmallVector< GlobalDeclID, 16 > PreloadedDeclIDs
std::pair< SourceLocation, StringRef > getModuleImportLoc(int ID) override
Retrieve the module import location and module name for the given source manager entry ID.
void ReadUnusedFileScopedDecls(SmallVectorImpl< const DeclaratorDecl * > &Decls) override
Read the set of unused file-scope declarations known to the external Sema source.
void ReadReferencedSelectors(SmallVectorImpl< std::pair< Selector, SourceLocation > > &Sels) override
Read the set of referenced selectors known to the external Sema source.
Selector DecodeSelector(serialization::SelectorID Idx)
StringRef getOriginalSourceFile()
Retrieve the name of the original source file name for the primary module file.
std::string ReadPath(ModuleFile &F, const RecordData &Record, unsigned &Idx)
ASTDeserializationListener * getDeserializationListener()
Get the AST deserialization listener.
void addListener(std::unique_ptr< ASTReaderListener > L)
Add an AST callback listener.
unsigned getModuleFileID(ModuleFile *M)
Get an ID for the given module file.
Decl * getKeyDeclaration(Decl *D)
Returns the first key declaration for the given declaration.
bool FindExternalVisibleDeclsByName(const DeclContext *DC, DeclarationName Name, const DeclContext *OriginalDC) override
Finds all the visible declarations with a given name.
void setListener(std::unique_ptr< ASTReaderListener > Listener)
Set the AST callbacks listener.
Selector ReadSelector(ModuleFile &M, const RecordData &Record, unsigned &Idx)
ModuleManager::ModuleReverseIterator ModuleReverseIterator
IdentifierInfo * DecodeIdentifierInfo(serialization::IdentifierID ID)
ASTReadResult
The result of reading the control block of an AST file, which can fail for various reasons.
@ Success
The control block was read successfully.
@ ConfigurationMismatch
The AST file was written with a different language/target configuration.
@ OutOfDate
The AST file is out-of-date relative to its input files, and needs to be regenerated.
@ Failure
The AST file itself appears corrupted.
@ VersionMismatch
The AST file was written by a different version of Clang.
@ HadErrors
The AST file has errors.
@ Missing
The AST file was missing.
void addInMemoryBuffer(StringRef &FileName, std::unique_ptr< llvm::MemoryBuffer > Buffer)
Add in-memory (virtual file) buffer.
static VersionTuple ReadVersionTuple(const RecordData &Record, unsigned &Idx)
Read a version tuple.
SmallString< 0 > & getPathBuf()
Get the buffer for resolving paths.
Token ReadToken(ModuleFile &M, const RecordDataImpl &Record, unsigned &Idx)
Reads a token out of a record.
SwitchCase * getSwitchCaseWithID(unsigned ID)
Retrieve the switch-case statement with the given ID.
serialization::IdentifierID getGlobalIdentifierID(ModuleFile &M, uint64_t LocalID)
FileID TranslateFileID(ModuleFile &F, FileID FID) const
Translate a FileID from another module file's FileID space into ours.
void ReadLateParsedTemplates(llvm::MapVector< const FunctionDecl *, std::unique_ptr< LateParsedTemplate > > &LPTMap) override
Read the set of late parsed template functions for this source.
IdentifierIterator * getIdentifiers() override
Retrieve an iterator into the set of all identifiers in all loaded AST files.
serialization::ModuleManager ModuleManager
void ReadUsedVTables(SmallVectorImpl< ExternalVTableUse > &VTables) override
Read the set of used vtables known to the external Sema source.
bool isGlobalIndexUnavailable() const
Determine whether we tried to load the global index, but failed, e.g., because it is out-of-date or d...
uint32_t GetNumExternalSelectors() override
Returns the number of selectors known to the external AST source.
static TemporarilyOwnedStringRef ResolveImportedPath(SmallString< 0 > &Buf, StringRef Path, ModuleFile &ModF)
Resolve Path in the context of module file M.
void updateOutOfDateSelector(Selector Sel) override
Load the contents of the global method pool for a given selector if necessary.
Decl * GetExistingDecl(GlobalDeclID ID)
Resolve a declaration ID into a declaration.
Stmt * ReadStmt(ModuleFile &F)
Reads a statement.
static llvm::BitVector ReadBitVector(const RecordData &Record, const StringRef Blob)
ModuleFile * getLocalModuleFile(ModuleFile &M, unsigned ID) const
Retrieve the module file with a given local ID within the specified ModuleFile.
SourceLocation ReadSourceLocation(ModuleFile &ModuleFile, const RecordDataImpl &Record, unsigned &Idx)
Read a source location.
ASTReader(Preprocessor &PP, ModuleCache &ModCache, ASTContext *Context, const PCHContainerReader &PCHContainerRdr, const CodeGenOptions &CodeGenOpts, ArrayRef< std::shared_ptr< ModuleFileExtension > > Extensions, StringRef isysroot="", DisableValidationForModuleKind DisableValidationKind=DisableValidationForModuleKind::None, bool AllowASTWithCompilerErrors=false, bool AllowConfigurationMismatch=false, bool ValidateSystemInputs=false, bool ForceValidateUserInputs=true, bool ValidateASTInputFilesContent=false, bool UseGlobalIndex=true, std::unique_ptr< llvm::Timer > ReadTimer={})
Load the AST file and validate its contents against the given Preprocessor.
void ForgetSema() override
Inform the semantic consumer that Sema is no longer available.
DiagnosticsEngine & getDiags() const
void LoadSelector(Selector Sel)
Load a selector from disk, registering its ID if it exists.
void ReadPragmaDiagnosticMappings(DiagnosticsEngine &Diag)
void makeNamesVisible(const HiddenNames &Names, Module *Owner)
Make the names within this set of hidden names visible.
void UpdateSema()
Update the state of Sema after loading some additional modules.
Decl * GetDecl(GlobalDeclID ID)
Resolve a declaration ID into a declaration, potentially building a new declaration.
Decl * GetLocalDecl(ModuleFile &F, LocalDeclID LocalID)
Reads a declaration with the given local ID in the given module.
bool isProcessingUpdateRecords()
T * GetLocalDeclAs(ModuleFile &F, LocalDeclID LocalID)
Reads a declaration with the given local ID in the given module.
int getSLocEntryID(SourceLocation::UIntTy SLocOffset) override
Get the index ID for the loaded SourceLocation offset.
SourceLocation ReadSourceLocation(ModuleFile &MF, RawLocEncoding Raw) const
Read a source location from raw form.
void ReadPendingInstantiations(SmallVectorImpl< std::pair< ValueDecl *, SourceLocation > > &Pending) override
Read the set of pending instantiations known to the external Sema source.
Preprocessor & getPreprocessor() const
Retrieve the preprocessor.
serialization::reader::LazySpecializationInfoLookupTable * getLoadedSpecializationsLookupTables(const Decl *D, bool IsPartial)
Get the loaded specializations lookup tables for D, if any.
CXXTemporary * ReadCXXTemporary(ModuleFile &F, const RecordData &Record, unsigned &Idx)
void ReadKnownNamespaces(SmallVectorImpl< NamespaceDecl * > &Namespaces) override
Load the set of namespaces that are known to the external source, which will be used during typo corr...
const Decl * getKeyDeclaration(const Decl *D)
ModuleManager::ModuleConstIterator ModuleConstIterator
std::pair< SourceLocation, unsigned > ReadUntranslatedSourceLocation(RawLocEncoding Raw) const
Read a source location from raw form and return it in its originating module file's source location s...
Module * getSubmodule(serialization::SubmoduleID GlobalID)
Retrieve the submodule that corresponds to a global submodule ID.
void PrintStats() override
Print some statistics about AST usage.
static bool isAcceptableASTFile(StringRef Filename, FileManager &FileMgr, const ModuleCache &ModCache, const PCHContainerReader &PCHContainerRdr, const LangOptions &LangOpts, const CodeGenOptions &CGOpts, const TargetOptions &TargetOpts, const PreprocessorOptions &PPOpts, const HeaderSearchOptions &HSOpts, StringRef SpecificModuleCachePath, bool RequireStrictOptionMatches=false)
Determine whether the given AST file is acceptable to load into a translation unit with the given lan...
void mergeDefinitionVisibility(NamedDecl *Def, NamedDecl *MergedDef)
Note that MergedDef is a redefinition of the canonical definition Def, so Def should be visible whene...
serialization::SelectorID getGlobalSelectorID(ModuleFile &M, unsigned LocalID) const
Retrieve the global selector ID that corresponds to this the local selector ID in a given module.
void runWithSufficientStackSpace(SourceLocation Loc, llvm::function_ref< void()> Fn)
friend class ASTRecordReader
SmallVector< uint64_t, 64 > RecordData
unsigned getTotalNumMacros() const
Returns the number of macros found in the chain.
FileID ReadFileID(ModuleFile &F, const RecordDataImpl &Record, unsigned &Idx) const
Read a FileID.
void StartedDeserializing() override
Notify ASTReader that we started deserialization of a decl or type so until FinishedDeserializing is ...
serialization::MacroID getGlobalMacroID(ModuleFile &M, serialization::MacroID LocalID)
Retrieve the global macro ID corresponding to the given local ID within the given module file.
void ReadMethodPool(Selector Sel) override
Load the contents of the global method pool for a given selector.
void InitializeContext()
Initializes the ASTContext.
CXXBaseSpecifier * GetExternalCXXBaseSpecifiers(uint64_t Offset) override
Resolve the offset of a set of C++ base specifiers in the decl stream into an array of specifiers.
std::unique_ptr< ASTReaderListener > takeListener()
Take the AST callbacks listener.
const serialization::reader::DeclContextLookupTable * getTULocalLookupTables(DeclContext *Primary) const
void resetForReload()
Reset reader for a reload try.
FileManager & getFileManager() const
unsigned getTotalNumDecls() const
Returns the number of declarations found in the chain.
bool wasThisDeclarationADefinition(const FunctionDecl *FD) override
True if this function declaration was a definition before in its own module.
void FinishedDeserializing() override
Notify ASTReader that we finished the deserialization of a decl or type.
IdentifierInfo * readIdentifier(ModuleFile &M, const RecordData &Record, unsigned &Idx)
void updateOutOfDateIdentifier(const IdentifierInfo &II) override
Update an out-of-date identifier.
ASTReadResult ReadAST(ModuleFileName FileName, ModuleKind Type, SourceLocation ImportLoc, unsigned ClientLoadCapabilities, ModuleFile **NewLoadedModuleFile=nullptr)
Load the AST file designated by the given file name.
void ReadDefinedMacros() override
Read the set of macros defined by this external macro source.
GlobalModuleIndex * getGlobalIndex()
Return global module index.
IdentifierInfo * GetIdentifier(serialization::IdentifierID ID) override
Return the identifier associated with the given ID number.
HeaderFileInfo GetHeaderFileInfo(FileEntryRef FE) override
Read the header file information for the given file entry.
serialization::ModuleFile ModuleFile
bool hasGlobalIndex() const
Determine whether this AST reader has a global index.
serialization::PreprocessedEntityID getGlobalPreprocessedEntityID(ModuleFile &M, serialization::PreprocessedEntityID LocalID) const
Determine the global preprocessed entity ID that corresponds to the given local ID within the given m...
An object for streaming information from a record.
BitsUnpacker operator=(const BitsUnpacker &)=delete
uint32_t getNextBits(uint32_t Width)
void advance(uint32_t BitsWidth)
bool canGetNextNBits(uint32_t Width) const
BitsUnpacker(BitsUnpacker &&)=delete
BitsUnpacker(const BitsUnpacker &)=delete
void updateValue(uint32_t V)
BitsUnpacker operator=(BitsUnpacker &&)=delete
Represents a base class of a C++ class.
Represents a C++ base or member initializer.
Represents a C++ struct/union/class.
Represents a C++ temporary.
Simple wrapper class for chaining listeners.
void ReadCounter(const serialization::ModuleFile &M, uint32_t Value) override
Receives COUNTER value.
bool visitInputFile(StringRef Filename, bool isSystem, bool isOverridden, bool isExplicitModule) override
if needsInputFileVisitation returns true, this is called for each non-system input file of the AST Fi...
bool ReadCodeGenOptions(const CodeGenOptions &CGOpts, StringRef ModuleFilename, bool Complain, bool AllowCompatibleDifferences) override
Receives the codegen options.
void visitModuleFile(ModuleFileName Filename, serialization::ModuleKind Kind) override
This is called for each AST file loaded.
std::unique_ptr< ASTReaderListener > takeSecond()
bool ReadFullVersionInformation(StringRef FullVersion) override
Receives the full Clang version information.
bool ReadHeaderSearchOptions(const HeaderSearchOptions &HSOpts, StringRef ModuleFilename, StringRef ContextHash, bool Complain) override
Receives the header search options.
bool ReadFileSystemOptions(const FileSystemOptions &FSOpts, bool Complain) override
Receives the file system options.
std::unique_ptr< ASTReaderListener > takeFirst()
void ReadModuleMapFile(StringRef ModuleMapPath) override
bool ReadLanguageOptions(const LangOptions &LangOpts, StringRef ModuleFilename, bool Complain, bool AllowCompatibleDifferences) override
Receives the language options.
bool ReadTargetOptions(const TargetOptions &TargetOpts, StringRef ModuleFilename, bool Complain, bool AllowCompatibleDifferences) override
Receives the target options.
void ReadModuleName(StringRef ModuleName) override
bool needsInputFileVisitation() override
Returns true if this ASTReaderListener wants to receive the input files of the AST file via visitInpu...
bool ReadPreprocessorOptions(const PreprocessorOptions &PPOpts, StringRef ModuleFilename, bool ReadMacros, bool Complain, std::string &SuggestedPredefines) override
Receives the preprocessor options.
ChainedASTReaderListener(std::unique_ptr< ASTReaderListener > First, std::unique_ptr< ASTReaderListener > Second)
Takes ownership of First and Second.
void readModuleFileExtension(const ModuleFileExtensionMetadata &Metadata) override
Indicates that a particular module file extension has been read.
bool needsSystemInputFileVisitation() override
Returns true if this ASTReaderListener wants to receive the system input files of the AST file via vi...
bool ReadDiagnosticOptions(DiagnosticOptions &DiagOpts, StringRef ModuleFilename, bool Complain) override
Receives the diagnostic options.
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
A map from continuous integer ranges to some value, with a very specialized interface.
typename Representation::const_iterator const_iterator
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Decl - This represents one declaration (or definition), e.g.
bool isFromGlobalModule() const
Whether this declaration comes from global module.
ASTContext & getASTContext() const LLVM_READONLY
Kind
Lists the kind of concrete classes of Decl.
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
bool isFromHeaderUnit() const
Whether this declaration comes from a header unit.
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
The name of a declaration.
Represents a ValueDecl that came out of a declarator.
A little helper class used to produce diagnostics.
Options for controlling the compiler diagnostics engine.
Concrete class used by the front-end to report problems and issues.
This represents one expression.
RAII class for safely pairing a StartedDeserializing call with FinishedDeserializing.
MemoryBufferSizes getMemoryBufferSizes() const
Return the amount of memory used by memory buffers, breaking down by heap-backed versus mmap'ed memor...
An abstract class that should be subclassed by any external source of preprocessing record entries.
Abstract interface for external sources of preprocessor information.
External source of source location entries.
ExternalSemaSource()=default
Represents a member of a struct/union/class.
A reference to a FileEntry that includes the name of the file as it was accessed by the FileManager's...
Cached information about one file (either on disk or in the virtual file system).
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Implements support for file system lookup, file system caching, and directory search management.
Keeps track of options that affect how file operations are performed.
Represents a function declaration or definition.
A global index for a set of module files, providing information about the identifiers within those mo...
Provides lookups to, and iteration over, IdentiferInfo objects.
One of these records is kept for each identifier that is lexed.
An iterator that walks over all of the known identifiers in the lookup table.
IdentifierResolver - Keeps track of shadowed decls on enclosing scopes.
Implements an efficient mapping from strings to IdentifierInfo nodes.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
static LocalDeclID get(ASTReader &Reader, serialization::ModuleFile &MF, DeclID ID)
Encapsulates the data about a macro definition (e.g.
The module cache used for compiling modules implicitly.
Identifies a module file to be loaded.
Describes a module or submodule.
NameVisibilityKind
Describes the visibility of the various names within a particular module.
This represents a decl that may have a name.
Represent a C++ namespace.
ObjCCategoryDecl - Represents a category declaration.
Represents an ObjC class declaration.
This abstract interface provides operations for unwrapping containers for serialized ASTs (precompile...
bool ReadDiagnosticOptions(DiagnosticOptions &DiagOpts, StringRef ModuleFilename, bool Complain) override
Receives the diagnostic options.
bool ReadLanguageOptions(const LangOptions &LangOpts, StringRef ModuleFilename, bool Complain, bool AllowCompatibleDifferences) override
Receives the language options.
PCHValidator(Preprocessor &PP, ASTReader &Reader)
void ReadCounter(const serialization::ModuleFile &M, uint32_t Value) override
Receives COUNTER value.
bool ReadPreprocessorOptions(const PreprocessorOptions &PPOpts, StringRef ModuleFilename, bool ReadMacros, bool Complain, std::string &SuggestedPredefines) override
Receives the preprocessor options.
bool ReadHeaderSearchOptions(const HeaderSearchOptions &HSOpts, StringRef ModuleFilename, StringRef ContextHash, bool Complain) override
Receives the header search options.
bool ReadCodeGenOptions(const CodeGenOptions &CGOpts, StringRef ModuleFilename, bool Complain, bool AllowCompatibleDifferences) override
Receives the codegen options.
bool ReadTargetOptions(const TargetOptions &TargetOpts, StringRef ModuleFilename, bool Complain, bool AllowCompatibleDifferences) override
Receives the target options.
Base class that describes a preprocessed entity, which may be a preprocessor directive or macro expan...
PreprocessorOptions - This class is used for passing the various options used in preprocessor initial...
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
A (possibly-)qualified type.
Smart pointer class that efficiently represents Objective-C method names.
static AlignPackInfo getFromRawEncoding(unsigned Encoding)
Sema - This implements semantic analysis and AST building for C.
SimpleASTReaderListener(Preprocessor &PP)
bool ReadPreprocessorOptions(const PreprocessorOptions &PPOpts, StringRef ModuleFilename, bool ReadMacros, bool Complain, std::string &SuggestedPredefines) override
Receives the preprocessor options.
static std::pair< SourceLocation, unsigned > decode(RawLocEncoding)
Encodes a location in the source.
SourceLocation getLocWithOffset(IntTy Offset) const
Return a source location with the specified offset from this SourceLocation.
This class handles loading and caching of source files into memory.
A trivial tuple used to represent a source range.
Stmt - This represents one statement.
Options for controlling the target.
Token - This structure provides full information about a lexed token.
The base class of the type hierarchy.
Base class for declarations which introduce a typedef-name.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Represents a variable declaration or definition.
Information about a module that has been loaded by the ASTReader.
int SLocEntryBaseID
The base ID in the source manager's view of this module.
StringRef ModuleOffsetMap
The module offset map data for this file.
llvm::SmallVector< ModuleFile *, 16 > TransitiveImports
List of modules which this modules dependent on.
Manages the set of modules loaded by an AST reader.
llvm::pointee_iterator< SmallVectorImpl< std::unique_ptr< ModuleFile > >::iterator > ModuleIterator
llvm::pointee_iterator< SmallVectorImpl< std::unique_ptr< ModuleFile > >::const_iterator > ModuleConstIterator
llvm::pointee_iterator< SmallVectorImpl< std::unique_ptr< ModuleFile > >::reverse_iterator > ModuleReverseIterator
Class that performs lookup for an identifier stored in an AST file.
std::variant< struct RequiresDecl, struct HeaderDecl, struct UmbrellaDirDecl, struct ModuleDecl, struct ExcludeDecl, struct ExportDecl, struct ExportAsDecl, struct ExternModuleDecl, struct UseDecl, struct LinkDecl, struct ConfigMacrosDecl, struct ConflictDecl > Decl
All declarations that can appear in a module declaration.
uint32_t SelectorID
An ID number that refers to an ObjC selector in an AST file.
uint64_t PreprocessedEntityID
An ID number that refers to an entity in the detailed preprocessing record.
llvm::support::detail::packed_endian_specific_integral< serialization::DeclID, llvm::endianness::native, llvm::support::unaligned > unaligned_decl_id_t
uint64_t MacroID
An ID number that refers to a macro in an AST file.
uint64_t TypeID
An ID number that refers to a type in an AST file.
ModuleKind
Specifies the kind of module that has been loaded.
uint32_t SubmoduleID
An ID number that refers to a submodule in a module file.
TypeID LocalTypeID
Same with TypeID except that the LocalTypeID is only meaningful with the corresponding ModuleFile.
uint64_t IdentifierID
An ID number that refers to an identifier in an AST file.
The JSON file list parser is used to communicate input to InstallAPI.
nullptr
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
@ Module
Module linkage, which indicates that the entity can be referred to from other translation units withi...
PredefinedDeclIDs
Predefined declaration IDs.
@ Result
The result type of a method or function.
DisableValidationForModuleKind
Whether to disable the normal validation performed on precompiled headers and module files when they ...
@ None
Perform validation, don't disable it.
bool shouldSkipCheckingODR(const Decl *D)
std::string getClangFullRepositoryVersion()
Retrieves the full repository version that is an amalgamation of the information in getClangRepositor...
UnsignedOrNone getPrimaryModuleHash(const Module *M)
Calculate a hash value for the primary module name of the given module.
The signature of a module, which is a hash of the AST content.
ImportedModule(ModuleFile *Mod, ModuleFile *ImportedBy, SourceLocation ImportLoc)
uint64_t ModuleLocalOffset