@@ -504,7 +504,7 @@ class ASTReader
504
504
static_assert (std::is_same_v<serialization::DeclID, Decl::DeclID>);
505
505
506
506
using GlobalDeclMapType =
507
- ContinuousRangeMap<serialization::DeclID , ModuleFile *, 4 >;
507
+ ContinuousRangeMap<serialization::GlobalDeclID , ModuleFile *, 4 >;
508
508
509
509
// / Mapping from global declaration IDs to the module in which the
510
510
// / declaration resides.
@@ -513,14 +513,14 @@ class ASTReader
513
513
using FileOffset = std::pair<ModuleFile *, uint64_t >;
514
514
using FileOffsetsTy = SmallVector<FileOffset, 2 >;
515
515
using DeclUpdateOffsetsMap =
516
- llvm::DenseMap<serialization::DeclID , FileOffsetsTy>;
516
+ llvm::DenseMap<serialization::GlobalDeclID , FileOffsetsTy>;
517
517
518
518
// / Declarations that have modifications residing in a later file
519
519
// / in the chain.
520
520
DeclUpdateOffsetsMap DeclUpdateOffsets;
521
521
522
522
using DelayedNamespaceOffsetMapTy = llvm::DenseMap<
523
- serialization::DeclID ,
523
+ serialization::GlobalDeclID ,
524
524
std::pair</* LexicalOffset*/ uint64_t , /* VisibleOffset*/ uint64_t >>;
525
525
526
526
// / Mapping from global declaration IDs to the lexical and visible block
@@ -635,7 +635,7 @@ class ASTReader
635
635
636
636
// / Updates to the visible declarations of declaration contexts that
637
637
// / haven't been loaded yet.
638
- llvm::DenseMap<serialization::DeclID , DeclContextVisibleUpdates>
638
+ llvm::DenseMap<serialization::GlobalDeclID , DeclContextVisibleUpdates>
639
639
PendingVisibleUpdates;
640
640
641
641
// / The set of C++ or Objective-C classes that have forward
@@ -662,7 +662,8 @@ class ASTReader
662
662
// / Read the record that describes the visible contents of a DC.
663
663
bool ReadVisibleDeclContextStorage (ModuleFile &M,
664
664
llvm::BitstreamCursor &Cursor,
665
- uint64_t Offset, serialization::DeclID ID);
665
+ uint64_t Offset,
666
+ serialization::GlobalDeclID ID);
666
667
667
668
// / A vector containing identifiers that have already been
668
669
// / loaded.
@@ -815,29 +816,38 @@ class ASTReader
815
816
// / This contains the data loaded from all EAGERLY_DESERIALIZED_DECLS blocks
816
817
// / in the chain. The referenced declarations are deserialized and passed to
817
818
// / the consumer eagerly.
818
- SmallVector<serialization::DeclID , 16 > EagerlyDeserializedDecls;
819
+ SmallVector<serialization::GlobalDeclID , 16 > EagerlyDeserializedDecls;
819
820
820
821
// / The IDs of all tentative definitions stored in the chain.
821
822
// /
822
823
// / Sema keeps track of all tentative definitions in a TU because it has to
823
824
// / complete them and pass them on to CodeGen. Thus, tentative definitions in
824
825
// / the PCH chain must be eagerly deserialized.
825
- SmallVector<serialization::DeclID , 16 > TentativeDefinitions;
826
+ SmallVector<serialization::GlobalDeclID , 16 > TentativeDefinitions;
826
827
827
828
// / The IDs of all CXXRecordDecls stored in the chain whose VTables are
828
829
// / used.
829
830
// /
830
831
// / CodeGen has to emit VTables for these records, so they have to be eagerly
831
832
// / deserialized.
832
- SmallVector<serialization::DeclID, 64 > VTableUses;
833
+ struct VTableUse {
834
+ serialization::GlobalDeclID ID;
835
+ SourceLocation::UIntTy RawLoc;
836
+ bool Used;
837
+ };
838
+ SmallVector<VTableUse> VTableUses;
833
839
834
840
// / A snapshot of the pending instantiations in the chain.
835
841
// /
836
842
// / This record tracks the instantiations that Sema has to perform at the
837
843
// / end of the TU. It consists of a pair of values for every pending
838
844
// / instantiation where the first value is the ID of the decl and the second
839
845
// / is the instantiation location.
840
- SmallVector<serialization::DeclID, 64 > PendingInstantiations;
846
+ struct PendingInstantiation {
847
+ serialization::GlobalDeclID ID;
848
+ SourceLocation::UIntTy RawLoc;
849
+ };
850
+ SmallVector<PendingInstantiation, 64 > PendingInstantiations;
841
851
842
852
// @}
843
853
@@ -847,11 +857,11 @@ class ASTReader
847
857
848
858
// / A snapshot of Sema's unused file-scoped variable tracking, for
849
859
// / generating warnings.
850
- SmallVector<serialization::DeclID , 16 > UnusedFileScopedDecls;
860
+ SmallVector<serialization::GlobalDeclID , 16 > UnusedFileScopedDecls;
851
861
852
862
// / A list of all the delegating constructors we've seen, to diagnose
853
863
// / cycles.
854
- SmallVector<serialization::DeclID , 4 > DelegatingCtorDecls;
864
+ SmallVector<serialization::GlobalDeclID , 4 > DelegatingCtorDecls;
855
865
856
866
// / Method selectors used in a @selector expression. Used for
857
867
// / implementation of -Wselector.
@@ -864,7 +874,7 @@ class ASTReader
864
874
// / The IDs of type aliases for ext_vectors that exist in the chain.
865
875
// /
866
876
// / Used by Sema for finding sugared names for ext_vectors in diagnostics.
867
- SmallVector<serialization::DeclID , 4 > ExtVectorDecls;
877
+ SmallVector<serialization::GlobalDeclID , 4 > ExtVectorDecls;
868
878
869
879
// @}
870
880
@@ -875,7 +885,7 @@ class ASTReader
875
885
// / The IDs of all potentially unused typedef names in the chain.
876
886
// /
877
887
// / Sema tracks these to emit warnings.
878
- SmallVector<serialization::DeclID , 16 > UnusedLocalTypedefNameCandidates;
888
+ SmallVector<serialization::GlobalDeclID , 16 > UnusedLocalTypedefNameCandidates;
879
889
880
890
// / Our current depth in #pragma cuda force_host_device begin/end
881
891
// / macros.
@@ -884,7 +894,7 @@ class ASTReader
884
894
// / The IDs of the declarations Sema stores directly.
885
895
// /
886
896
// / Sema tracks a few important decls, such as namespace std, directly.
887
- SmallVector<serialization::DeclID , 4 > SemaDeclRefs;
897
+ SmallVector<serialization::GlobalDeclID , 4 > SemaDeclRefs;
888
898
889
899
// / The IDs of the types ASTContext stores directly.
890
900
// /
@@ -895,7 +905,7 @@ class ASTReader
895
905
// /
896
906
// / The AST context tracks a few important decls, currently cudaConfigureCall,
897
907
// / directly.
898
- SmallVector<serialization::DeclID , 2 > CUDASpecialDeclRefs;
908
+ SmallVector<serialization::GlobalDeclID , 2 > CUDASpecialDeclRefs;
899
909
900
910
// / The floating point pragma option settings.
901
911
SmallVector<uint64_t , 1 > FPPragmaOptions;
@@ -944,11 +954,15 @@ class ASTReader
944
954
llvm::DenseMap<const Decl *, std::set<std::string>> OpenCLDeclExtMap;
945
955
946
956
// / A list of the namespaces we've seen.
947
- SmallVector<serialization::DeclID , 4 > KnownNamespaces;
957
+ SmallVector<serialization::GlobalDeclID , 4 > KnownNamespaces;
948
958
949
959
// / A list of undefined decls with internal linkage followed by the
950
960
// / SourceLocation of a matching ODR-use.
951
- SmallVector<serialization::DeclID, 8 > UndefinedButUsed;
961
+ struct UndefinedButUsedDecl {
962
+ serialization::GlobalDeclID ID;
963
+ SourceLocation::UIntTy RawLoc;
964
+ };
965
+ SmallVector<UndefinedButUsedDecl, 8 > UndefinedButUsed;
952
966
953
967
// / Delete expressions to analyze at the end of translation unit.
954
968
SmallVector<uint64_t , 8 > DelayedDeleteExprs;
@@ -960,7 +974,8 @@ class ASTReader
960
974
// / The IDs of all decls to be checked for deferred diags.
961
975
// /
962
976
// / Sema tracks these to emit deferred diags.
963
- llvm::SmallSetVector<serialization::DeclID, 4 > DeclsToCheckForDeferredDiags;
977
+ llvm::SmallSetVector<serialization::GlobalDeclID, 4 >
978
+ DeclsToCheckForDeferredDiags;
964
979
965
980
private:
966
981
struct ImportedSubmodule {
@@ -1097,7 +1112,7 @@ class ASTReader
1097
1112
// /
1098
1113
// / The declarations on the identifier chain for these identifiers will be
1099
1114
// / loaded once the recursive loading has completed.
1100
- llvm::MapVector<IdentifierInfo *, SmallVector<serialization::DeclID , 4 >>
1115
+ llvm::MapVector<IdentifierInfo *, SmallVector<serialization::GlobalDeclID , 4 >>
1101
1116
PendingIdentifierInfos;
1102
1117
1103
1118
// / The set of lookup results that we have faked in order to support
@@ -1225,7 +1240,7 @@ class ASTReader
1225
1240
SmallVector<ObjCInterfaceDecl *, 16 > ObjCClassesLoaded;
1226
1241
1227
1242
using KeyDeclsMap =
1228
- llvm::DenseMap<Decl *, SmallVector<serialization::DeclID , 2 >>;
1243
+ llvm::DenseMap<Decl *, SmallVector<serialization::GlobalDeclID , 2 >>;
1229
1244
1230
1245
// / A mapping from canonical declarations to the set of global
1231
1246
// / declaration IDs for key declaration that have been merged with that
@@ -1434,15 +1449,15 @@ class ASTReader
1434
1449
QualType readTypeRecord (unsigned Index);
1435
1450
RecordLocation TypeCursorForIndex (unsigned Index);
1436
1451
void LoadedDecl (unsigned Index, Decl *D);
1437
- Decl *ReadDeclRecord (serialization::DeclID ID);
1452
+ Decl *ReadDeclRecord (serialization::GlobalDeclID ID);
1438
1453
void markIncompleteDeclChain (Decl *D);
1439
1454
1440
1455
// / Returns the most recent declaration of a declaration (which must be
1441
1456
// / of a redeclarable kind) that is either local or has already been loaded
1442
1457
// / merged into its redecl chain.
1443
1458
Decl *getMostRecentExistingDecl (Decl *D);
1444
1459
1445
- RecordLocation DeclCursorForID (serialization::DeclID ID,
1460
+ RecordLocation DeclCursorForID (serialization::GlobalDeclID ID,
1446
1461
SourceLocation &Location);
1447
1462
void loadDeclUpdateRecords (PendingUpdateRecord &Record);
1448
1463
void loadPendingDeclChain (Decl *D, uint64_t LocalOffset);
@@ -1901,8 +1916,8 @@ class ASTReader
1901
1916
1902
1917
// / Map from a local declaration ID within a given module to a
1903
1918
// / global declaration ID.
1904
- serialization::DeclID getGlobalDeclID (ModuleFile &F,
1905
- serialization::LocalDeclID LocalID) const ;
1919
+ serialization::GlobalDeclID
1920
+ getGlobalDeclID (ModuleFile &F, serialization::LocalDeclID LocalID) const ;
1906
1921
1907
1922
// / Returns true if global DeclID \p ID originated from module \p M.
1908
1923
bool isDeclIDFromModule (serialization::GlobalDeclID ID, ModuleFile &M) const ;
@@ -1916,12 +1931,12 @@ class ASTReader
1916
1931
1917
1932
// / Resolve a declaration ID into a declaration, potentially
1918
1933
// / building a new declaration.
1919
- Decl *GetDecl (serialization::DeclID ID);
1920
- Decl *GetExternalDecl (serialization ::DeclID ID) override ;
1934
+ Decl *GetDecl (serialization::GlobalDeclID ID);
1935
+ Decl *GetExternalDecl (Decl ::DeclID ID) override ;
1921
1936
1922
1937
// / Resolve a declaration ID into a declaration. Return 0 if it's not
1923
1938
// / been loaded yet.
1924
- Decl *GetExistingDecl (serialization::DeclID ID);
1939
+ Decl *GetExistingDecl (serialization::GlobalDeclID ID);
1925
1940
1926
1941
// / Reads a declaration with the given local ID in the given module.
1927
1942
Decl *GetLocalDecl (ModuleFile &F, serialization::LocalDeclID LocalID) {
@@ -1943,14 +1958,14 @@ class ASTReader
1943
1958
// / module file.
1944
1959
serialization::DeclID
1945
1960
mapGlobalIDToModuleFileGlobalID (ModuleFile &M,
1946
- serialization::DeclID GlobalID);
1961
+ serialization::GlobalDeclID GlobalID);
1947
1962
1948
1963
// / Reads a declaration ID from the given position in a record in the
1949
1964
// / given module.
1950
1965
// /
1951
1966
// / \returns The declaration ID read from the record, adjusted to a global ID.
1952
- serialization::DeclID ReadDeclID (ModuleFile &F, const RecordData &Record,
1953
- unsigned &Idx);
1967
+ serialization::GlobalDeclID
1968
+ ReadDeclID (ModuleFile &F, const RecordData &Record, unsigned &Idx);
1954
1969
1955
1970
// / Reads a declaration from the given position in a record in the
1956
1971
// / given module.
@@ -2124,10 +2139,10 @@ class ASTReader
2124
2139
void LoadSelector (Selector Sel);
2125
2140
2126
2141
void SetIdentifierInfo (unsigned ID, IdentifierInfo *II);
2127
- void
2128
- SetGloballyVisibleDecls ( IdentifierInfo *II,
2129
- const SmallVectorImpl<serialization::DeclID > &DeclIDs,
2130
- SmallVectorImpl<Decl *> *Decls = nullptr );
2142
+ void SetGloballyVisibleDecls (
2143
+ IdentifierInfo *II,
2144
+ const SmallVectorImpl<serialization::GlobalDeclID > &DeclIDs,
2145
+ SmallVectorImpl<Decl *> *Decls = nullptr );
2131
2146
2132
2147
// / Report a diagnostic.
2133
2148
DiagnosticBuilder Diag (unsigned DiagID) const ;
@@ -2368,7 +2383,7 @@ class ASTReader
2368
2383
2369
2384
// Contains the IDs for declarations that were requested before we have
2370
2385
// access to a Sema object.
2371
- SmallVector<uint64_t , 16 > PreloadedDeclIDs;
2386
+ SmallVector<serialization::GlobalDeclID , 16 > PreloadedDeclIDs;
2372
2387
2373
2388
// / Retrieve the semantic analysis object used to analyze the
2374
2389
// / translation unit in which the precompiled header is being
0 commit comments