[clang] 8af8602 - [NFC] [Serialization] Unify how LocalDeclID can be created
Chuanqi Xu via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 19 00:18:33 PDT 2024
Author: Chuanqi Xu
Date: 2024-06-19T15:18:01+08:00
New Revision: 8af86025af2456c70c84aec309cca9a069124671
URL: https://github.com/llvm/llvm-project/commit/8af86025af2456c70c84aec309cca9a069124671
DIFF: https://github.com/llvm/llvm-project/commit/8af86025af2456c70c84aec309cca9a069124671.diff
LOG: [NFC] [Serialization] Unify how LocalDeclID can be created
Now we can create a LocalDeclID directly with an integer without
verifying. It may be hard to refactor if we want to change the way we
serialize DeclIDs (See https://github.com/llvm/llvm-project/pull/95897).
Also it is hard for us to debug if someday someone construct a
LocalDeclID with an incorrect value.
So in this patch, I tried to unify the way we can construct a
LocalDeclID in ASTReader, where we will construct the LocalDeclID from
the serialized data. Also, now we can verify the constructed LocalDeclID
sooner in the new interface.
Added:
Modified:
clang/include/clang/AST/ASTUnresolvedSet.h
clang/include/clang/AST/DeclID.h
clang/include/clang/Serialization/ASTBitCodes.h
clang/include/clang/Serialization/ASTReader.h
clang/include/clang/Serialization/ASTWriter.h
clang/lib/AST/DeclBase.cpp
clang/lib/AST/DeclTemplate.cpp
clang/lib/Frontend/ASTUnit.cpp
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/ASTReaderDecl.cpp
clang/lib/Serialization/ASTWriter.cpp
clang/lib/Serialization/ASTWriterDecl.cpp
clang/utils/TableGen/ClangAttrEmitter.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/AST/ASTUnresolvedSet.h b/clang/include/clang/AST/ASTUnresolvedSet.h
index dcce3bc63df25..3838dcb61ee0e 100644
--- a/clang/include/clang/AST/ASTUnresolvedSet.h
+++ b/clang/include/clang/AST/ASTUnresolvedSet.h
@@ -58,7 +58,7 @@ class ASTUnresolvedSet {
}
void addLazyDecl(ASTContext &C, GlobalDeclID ID, AccessSpecifier AS) {
- Decls.push_back(DeclAccessPair::makeLazy(ID.get(), AS), C);
+ Decls.push_back(DeclAccessPair::makeLazy(ID.getRawValue(), AS), C);
}
/// Replaces the given declaration with the new one, once.
diff --git a/clang/include/clang/AST/DeclID.h b/clang/include/clang/AST/DeclID.h
index 8ee645ec0ecdd..e8f4860e13f1f 100644
--- a/clang/include/clang/AST/DeclID.h
+++ b/clang/include/clang/AST/DeclID.h
@@ -116,12 +116,8 @@ class DeclIDBase {
DeclIDBase() : ID(PREDEF_DECL_NULL_ID) {}
explicit DeclIDBase(DeclID ID) : ID(ID) {}
- explicit DeclIDBase(unsigned LocalID, unsigned ModuleFileIndex) {
- ID = (DeclID)LocalID | ((DeclID)ModuleFileIndex << 32);
- }
-
public:
- DeclID get() const { return ID; }
+ DeclID getRawValue() const { return ID; }
explicit operator DeclID() const { return ID; }
@@ -135,12 +131,33 @@ class DeclIDBase {
unsigned getLocalDeclIndex() const;
+ // The DeclID may be compared with predefined decl ID.
+ friend bool operator==(const DeclIDBase &LHS, const DeclID &RHS) {
+ return LHS.ID == RHS;
+ }
+ friend bool operator!=(const DeclIDBase &LHS, const DeclID &RHS) {
+ return !operator==(LHS, RHS);
+ }
+ friend bool operator<(const DeclIDBase &LHS, const DeclID &RHS) {
+ return LHS.ID < RHS;
+ }
+ friend bool operator<=(const DeclIDBase &LHS, const DeclID &RHS) {
+ return LHS.ID <= RHS;
+ }
+ friend bool operator>(const DeclIDBase &LHS, const DeclID &RHS) {
+ return LHS.ID > RHS;
+ }
+ friend bool operator>=(const DeclIDBase &LHS, const DeclID &RHS) {
+ return LHS.ID >= RHS;
+ }
+
friend bool operator==(const DeclIDBase &LHS, const DeclIDBase &RHS) {
return LHS.ID == RHS.ID;
}
friend bool operator!=(const DeclIDBase &LHS, const DeclIDBase &RHS) {
return LHS.ID != RHS.ID;
}
+
// We may sort the decl ID.
friend bool operator<(const DeclIDBase &LHS, const DeclIDBase &RHS) {
return LHS.ID < RHS.ID;
@@ -159,16 +176,27 @@ class DeclIDBase {
DeclID ID;
};
+class ASTWriter;
+class ASTReader;
+namespace serialization {
+class ModuleFile;
+} // namespace serialization
+
class LocalDeclID : public DeclIDBase {
using Base = DeclIDBase;
-public:
- LocalDeclID() : Base() {}
LocalDeclID(PredefinedDeclIDs ID) : Base(ID) {}
explicit LocalDeclID(DeclID ID) : Base(ID) {}
- explicit LocalDeclID(unsigned LocalID, unsigned ModuleFileIndex)
- : Base(LocalID, ModuleFileIndex) {}
+ // Every Decl ID is a local decl ID to the module being writing in ASTWriter.
+ friend class ASTWriter;
+ friend class GlobalDeclID;
+
+public:
+ LocalDeclID() : Base() {}
+
+ static LocalDeclID get(ASTReader &Reader, serialization::ModuleFile &MF,
+ DeclID ID);
LocalDeclID &operator++() {
++ID;
@@ -189,8 +217,8 @@ class GlobalDeclID : public DeclIDBase {
GlobalDeclID() : Base() {}
explicit GlobalDeclID(DeclID ID) : Base(ID) {}
- explicit GlobalDeclID(unsigned LocalID, unsigned ModuleFileIndex)
- : Base(LocalID, ModuleFileIndex) {}
+ explicit GlobalDeclID(unsigned ModuleFileIndex, unsigned LocalID)
+ : Base((DeclID)ModuleFileIndex << 32 | (DeclID)LocalID) {}
// For DeclIDIterator<GlobalDeclID> to be able to convert a GlobalDeclID
// to a LocalDeclID.
@@ -235,7 +263,7 @@ template <> struct DenseMapInfo<clang::GlobalDeclID> {
// In GlobalDeclID's case, it is pretty common that the lower 32 bits can
// be same.
// FIXME: Remove this when we fix the underlying issue.
- return llvm::hash_value(Key.get());
+ return llvm::hash_value(Key.getRawValue());
}
static bool isEqual(const GlobalDeclID &L, const GlobalDeclID &R) {
diff --git a/clang/include/clang/Serialization/ASTBitCodes.h b/clang/include/clang/Serialization/ASTBitCodes.h
index 24e616f76b9af..9f0f900a02914 100644
--- a/clang/include/clang/Serialization/ASTBitCodes.h
+++ b/clang/include/clang/Serialization/ASTBitCodes.h
@@ -2004,9 +2004,9 @@ struct ObjCCategoriesInfo {
ObjCCategoriesInfo() = default;
ObjCCategoriesInfo(LocalDeclID ID, unsigned Offset)
- : DefinitionID(ID.get()), Offset(Offset) {}
+ : DefinitionID(ID.getRawValue()), Offset(Offset) {}
- LocalDeclID getDefinitionID() const { return LocalDeclID(DefinitionID); }
+ DeclID getDefinitionID() const { return DefinitionID; }
friend bool operator<(const ObjCCategoriesInfo &X,
const ObjCCategoriesInfo &Y) {
diff --git a/clang/include/clang/Serialization/ASTReader.h b/clang/include/clang/Serialization/ASTReader.h
index 08f302c01f538..480f852e3bf07 100644
--- a/clang/include/clang/Serialization/ASTReader.h
+++ b/clang/include/clang/Serialization/ASTReader.h
@@ -375,6 +375,7 @@ class ASTReader
friend class serialization::reader::ASTIdentifierLookupTrait;
friend class serialization::ReadMethodPoolVisitor;
friend class TypeLocReader;
+ friend class LocalDeclID;
using RecordData = SmallVector<uint64_t, 64>;
using RecordDataImpl = SmallVectorImpl<uint64_t>;
@@ -1501,7 +1502,8 @@ class ASTReader
: iterator_adaptor_base(Pos), Reader(Reader), Mod(Mod) {}
value_type operator*() const {
- return Reader->GetDecl(Reader->getGlobalDeclID(*Mod, (LocalDeclID)*I));
+ LocalDeclID ID = LocalDeclID::get(*Reader, *Mod, *I);
+ return Reader->GetDecl(Reader->getGlobalDeclID(*Mod, ID));
}
value_type operator->() const { return **this; }
@@ -1955,12 +1957,12 @@ class ASTReader
/// given module.
///
/// \returns The declaration ID read from the record, adjusted to a global ID.
- GlobalDeclID ReadDeclID(ModuleFile &F, const RecordData &Record,
+ GlobalDeclID ReadDeclID(ModuleFile &F, const RecordDataImpl &Record,
unsigned &Idx);
/// Reads a declaration from the given position in a record in the
/// given module.
- Decl *ReadDecl(ModuleFile &F, const RecordData &R, unsigned &I) {
+ Decl *ReadDecl(ModuleFile &F, const RecordDataImpl &R, unsigned &I) {
return GetDecl(ReadDeclID(F, R, I));
}
@@ -1969,8 +1971,8 @@ class ASTReader
///
/// \returns The declaration read from this location, casted to the given
/// result type.
- template<typename T>
- T *ReadDeclAs(ModuleFile &F, const RecordData &R, unsigned &I) {
+ template <typename T>
+ T *ReadDeclAs(ModuleFile &F, const RecordDataImpl &R, unsigned &I) {
return cast_or_null<T>(GetDecl(ReadDeclID(F, R, I)));
}
diff --git a/clang/include/clang/Serialization/ASTWriter.h b/clang/include/clang/Serialization/ASTWriter.h
index e66b675510179..ce79c75dc2911 100644
--- a/clang/include/clang/Serialization/ASTWriter.h
+++ b/clang/include/clang/Serialization/ASTWriter.h
@@ -729,8 +729,7 @@ class ASTWriter : public ASTDeserializationListener,
if (D->isFromASTFile())
return false;
auto I = DeclIDs.find(D);
- return (I == DeclIDs.end() ||
- I->second.get() >= clang::NUM_PREDEF_DECL_IDS);
+ return (I == DeclIDs.end() || I->second >= clang::NUM_PREDEF_DECL_IDS);
};
/// Emit a reference to a declaration.
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index 129ec675ee399..98c55d6f4eba4 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/lib/AST/DeclBase.cpp
@@ -80,7 +80,7 @@ void *Decl::operator new(std::size_t Size, const ASTContext &Context,
uint64_t *PrefixPtr = (uint64_t *)Result - 1;
- *PrefixPtr = ID.get();
+ *PrefixPtr = ID.getRawValue();
// We leave the upper 16 bits to store the module IDs. 48 bits should be
// sufficient to store a declaration ID.
diff --git a/clang/lib/AST/DeclTemplate.cpp b/clang/lib/AST/DeclTemplate.cpp
index d952f7e181848..722c7fcf0b0df 100644
--- a/clang/lib/AST/DeclTemplate.cpp
+++ b/clang/lib/AST/DeclTemplate.cpp
@@ -339,7 +339,7 @@ void RedeclarableTemplateDecl::loadLazySpecializationsImpl() const {
ASTContext &Context = getASTContext();
GlobalDeclID *Specs = CommonBasePtr->LazySpecializations;
CommonBasePtr->LazySpecializations = nullptr;
- unsigned SpecSize = (*Specs++).get();
+ unsigned SpecSize = (*Specs++).getRawValue();
for (unsigned I = 0; I != SpecSize; ++I)
(void)Context.getExternalSource()->GetExternalDecl(Specs[I]);
}
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index 8d24d5d422520..67d4c07d1ce39 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -1473,7 +1473,7 @@ void ASTUnit::RealizeTopLevelDeclsFromPreamble() {
for (const auto TopLevelDecl : TopLevelDeclsInPreamble) {
// Resolve the declaration ID to an actual declaration, possibly
// deserializing the declaration in the process.
- if (Decl *D = Reader->GetDecl(Reader->getGlobalDeclID(MF, TopLevelDecl)))
+ if (Decl *D = Reader->GetLocalDecl(MF, TopLevelDecl))
Resolved.push_back(D);
}
TopLevelDeclsInPreamble.clear();
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 0810d720bb4e0..973475cf56b8c 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -908,6 +908,40 @@ unsigned ASTSelectorLookupTrait::ComputeHash(Selector Sel) {
return serialization::ComputeHash(Sel);
}
+LocalDeclID LocalDeclID::get(ASTReader &Reader, ModuleFile &MF, DeclID Value) {
+ LocalDeclID ID(Value);
+#ifndef NDEBUG
+ if (!MF.ModuleOffsetMap.empty())
+ Reader.ReadModuleOffsetMap(MF);
+
+ unsigned ModuleFileIndex = ID.getModuleFileIndex();
+ unsigned LocalDeclID = ID.getLocalDeclIndex();
+
+ assert(ModuleFileIndex <= MF.TransitiveImports.size());
+
+ ModuleFile *OwningModuleFile =
+ ModuleFileIndex == 0 ? &MF : MF.TransitiveImports[ModuleFileIndex - 1];
+ assert(OwningModuleFile);
+
+ unsigned LocalNumDecls = OwningModuleFile->LocalNumDecls;
+
+ if (!ModuleFileIndex)
+ LocalNumDecls += NUM_PREDEF_DECL_IDS;
+
+ assert(LocalDeclID < LocalNumDecls);
+#endif
+ (void)Reader;
+ (void)MF;
+ return ID;
+}
+
+static LocalDeclID getLocalDeclID(ASTReader &Reader, ModuleFile &MF,
+ unsigned ModuleFileIndex,
+ unsigned LocalDeclID) {
+ DeclID Value = (DeclID)ModuleFileIndex << 32 | (DeclID)LocalDeclID;
+ return LocalDeclID::get(Reader, MF, Value);
+}
+
std::pair<unsigned, unsigned>
ASTSelectorLookupTrait::ReadKeyDataLength(const unsigned char*& d) {
return readULEBKeyDataLength(d);
@@ -958,16 +992,18 @@ ASTSelectorLookupTrait::ReadData(Selector, const unsigned char* d,
// Load instance methods
for (unsigned I = 0; I != NumInstanceMethods; ++I) {
if (ObjCMethodDecl *Method = Reader.GetLocalDeclAs<ObjCMethodDecl>(
- F,
- LocalDeclID(endian::readNext<DeclID, llvm::endianness::little>(d))))
+ F, LocalDeclID::get(
+ Reader, F,
+ endian::readNext<DeclID, llvm::endianness::little>(d))))
Result.Instance.push_back(Method);
}
// Load factory methods
for (unsigned I = 0; I != NumFactoryMethods; ++I) {
if (ObjCMethodDecl *Method = Reader.GetLocalDeclAs<ObjCMethodDecl>(
- F,
- LocalDeclID(endian::readNext<DeclID, llvm::endianness::little>(d))))
+ F, LocalDeclID::get(
+ Reader, F,
+ endian::readNext<DeclID, llvm::endianness::little>(d))))
Result.Factory.push_back(Method);
}
@@ -1097,8 +1133,9 @@ IdentifierInfo *ASTIdentifierLookupTrait::ReadData(const internal_key_type& k,
SmallVector<GlobalDeclID, 4> DeclIDs;
for (; DataLen > 0; DataLen -= sizeof(DeclID))
DeclIDs.push_back(Reader.getGlobalDeclID(
- F,
- LocalDeclID(endian::readNext<DeclID, llvm::endianness::little>(d))));
+ F, LocalDeclID::get(
+ Reader, F,
+ endian::readNext<DeclID, llvm::endianness::little>(d))));
Reader.SetGloballyVisibleDecls(II, DeclIDs);
}
@@ -1219,8 +1256,9 @@ void ASTDeclContextNameLookupTrait::ReadDataInto(internal_key_type,
using namespace llvm::support;
for (unsigned NumDecls = DataLen / sizeof(DeclID); NumDecls; --NumDecls) {
- LocalDeclID LocalID(endian::readNext<DeclID, llvm::endianness::little>(d));
- Val.insert(Reader.getGlobalDeclID(F, LocalID));
+ LocalDeclID ID = LocalDeclID::get(
+ Reader, F, endian::readNext<DeclID, llvm::endianness::little>(d));
+ Val.insert(Reader.getGlobalDeclID(F, ID));
}
}
@@ -3457,9 +3495,8 @@ llvm::Error ASTReader::ReadASTBlock(ModuleFile &F,
case EAGERLY_DESERIALIZED_DECLS:
// FIXME: Skip reading this record if our ASTConsumer doesn't care
// about "interesting" decls (for instance, if we're building a module).
- for (unsigned I = 0, N = Record.size(); I != N; ++I)
- EagerlyDeserializedDecls.push_back(
- getGlobalDeclID(F, LocalDeclID(Record[I])));
+ for (unsigned I = 0, N = Record.size(); I != N; /*in loop*/)
+ EagerlyDeserializedDecls.push_back(ReadDeclID(F, Record, I));
break;
case MODULAR_CODEGEN_DECLS:
@@ -3467,9 +3504,8 @@ llvm::Error ASTReader::ReadASTBlock(ModuleFile &F,
// them (ie: if we're not codegenerating this module).
if (F.Kind == MK_MainFile ||
getContext().getLangOpts().BuildingPCHWithObjectFile)
- for (unsigned I = 0, N = Record.size(); I != N; ++I)
- EagerlyDeserializedDecls.push_back(
- getGlobalDeclID(F, LocalDeclID(Record[I])));
+ for (unsigned I = 0, N = Record.size(); I != N; /*in loop*/)
+ EagerlyDeserializedDecls.push_back(ReadDeclID(F, Record, I));
break;
case SPECIAL_TYPES:
@@ -3500,15 +3536,13 @@ llvm::Error ASTReader::ReadASTBlock(ModuleFile &F,
break;
case UNUSED_FILESCOPED_DECLS:
- for (unsigned I = 0, N = Record.size(); I != N; ++I)
- UnusedFileScopedDecls.push_back(
- getGlobalDeclID(F, LocalDeclID(Record[I])));
+ for (unsigned I = 0, N = Record.size(); I != N; /*in loop*/)
+ UnusedFileScopedDecls.push_back(ReadDeclID(F, Record, I));
break;
case DELEGATING_CTORS:
- for (unsigned I = 0, N = Record.size(); I != N; ++I)
- DelegatingCtorDecls.push_back(
- getGlobalDeclID(F, LocalDeclID(Record[I])));
+ for (unsigned I = 0, N = Record.size(); I != N; /*in loop*/)
+ DelegatingCtorDecls.push_back(ReadDeclID(F, Record, I));
break;
case WEAK_UNDECLARED_IDENTIFIERS:
@@ -3674,8 +3708,8 @@ llvm::Error ASTReader::ReadASTBlock(ModuleFile &F,
break;
case EXT_VECTOR_DECLS:
- for (unsigned I = 0, N = Record.size(); I != N; ++I)
- ExtVectorDecls.push_back(getGlobalDeclID(F, LocalDeclID(Record[I])));
+ for (unsigned I = 0, N = Record.size(); I != N; /*in loop*/)
+ ExtVectorDecls.push_back(ReadDeclID(F, Record, I));
break;
case VTABLE_USES:
@@ -3690,7 +3724,7 @@ llvm::Error ASTReader::ReadASTBlock(ModuleFile &F,
for (unsigned Idx = 0, N = Record.size(); Idx != N; /* In loop */) {
VTableUses.push_back(
- {getGlobalDeclID(F, LocalDeclID(Record[Idx++])),
+ {ReadDeclID(F, Record, Idx),
ReadSourceLocation(F, Record, Idx).getRawEncoding(),
(bool)Record[Idx++]});
}
@@ -3705,7 +3739,7 @@ llvm::Error ASTReader::ReadASTBlock(ModuleFile &F,
for (unsigned I = 0, N = Record.size(); I != N; /* in loop */) {
PendingInstantiations.push_back(
- {getGlobalDeclID(F, LocalDeclID(Record[I++])),
+ {ReadDeclID(F, Record, I),
ReadSourceLocation(F, Record, I).getRawEncoding()});
}
break;
@@ -3714,8 +3748,8 @@ llvm::Error ASTReader::ReadASTBlock(ModuleFile &F,
if (Record.size() != 3)
return llvm::createStringError(std::errc::illegal_byte_sequence,
"Invalid SEMA_DECL_REFS block");
- for (unsigned I = 0, N = Record.size(); I != N; ++I)
- SemaDeclRefs.push_back(getGlobalDeclID(F, LocalDeclID(Record[I])));
+ for (unsigned I = 0, N = Record.size(); I != N; /*in loop*/)
+ SemaDeclRefs.push_back(ReadDeclID(F, Record, I));
break;
case PPD_ENTITIES_OFFSETS: {
@@ -3773,9 +3807,9 @@ llvm::Error ASTReader::ReadASTBlock(ModuleFile &F,
return llvm::createStringError(
std::errc::illegal_byte_sequence,
"invalid DECL_UPDATE_OFFSETS block in AST file");
- for (unsigned I = 0, N = Record.size(); I != N; I += 2) {
- GlobalDeclID ID = getGlobalDeclID(F, LocalDeclID(Record[I]));
- DeclUpdateOffsets[ID].push_back(std::make_pair(&F, Record[I + 1]));
+ for (unsigned I = 0, N = Record.size(); I != N; /*in loop*/) {
+ GlobalDeclID ID = ReadDeclID(F, Record, I);
+ DeclUpdateOffsets[ID].push_back(std::make_pair(&F, Record[I++]));
// If we've already loaded the decl, perform the updates when we finish
// loading this block.
@@ -3791,13 +3825,17 @@ llvm::Error ASTReader::ReadASTBlock(ModuleFile &F,
std::errc::illegal_byte_sequence,
"invalid DELAYED_NAMESPACE_LEXICAL_VISIBLE_RECORD block in AST "
"file");
- for (unsigned I = 0, N = Record.size(); I != N; I += 3) {
- GlobalDeclID ID = getGlobalDeclID(F, LocalDeclID(Record[I]));
+ for (unsigned I = 0, N = Record.size(); I != N; /*in loop*/) {
+ GlobalDeclID ID = ReadDeclID(F, Record, I);
uint64_t BaseOffset = F.DeclsBlockStartOffset;
assert(BaseOffset && "Invalid DeclsBlockStartOffset for module file!");
- uint64_t LexicalOffset = Record[I + 1] ? BaseOffset + Record[I + 1] : 0;
- uint64_t VisibleOffset = Record[I + 2] ? BaseOffset + Record[I + 2] : 0;
+ uint64_t LocalLexicalOffset = Record[I++];
+ uint64_t LexicalOffset =
+ LocalLexicalOffset ? BaseOffset + LocalLexicalOffset : 0;
+ uint64_t LocalVisibleOffset = Record[I++];
+ uint64_t VisibleOffset =
+ LocalVisibleOffset ? BaseOffset + LocalVisibleOffset : 0;
DelayedNamespaceOffsetMap[ID] = {LexicalOffset, VisibleOffset};
@@ -3826,9 +3864,8 @@ llvm::Error ASTReader::ReadASTBlock(ModuleFile &F,
// Later tables overwrite earlier ones.
// FIXME: Modules will have trouble with this.
CUDASpecialDeclRefs.clear();
- for (unsigned I = 0, N = Record.size(); I != N; ++I)
- CUDASpecialDeclRefs.push_back(
- getGlobalDeclID(F, LocalDeclID(Record[I])));
+ for (unsigned I = 0, N = Record.size(); I != N; /*in loop*/)
+ CUDASpecialDeclRefs.push_back(ReadDeclID(F, Record, I));
break;
case HEADER_SEARCH_TABLE:
@@ -3868,14 +3905,13 @@ llvm::Error ASTReader::ReadASTBlock(ModuleFile &F,
break;
case TENTATIVE_DEFINITIONS:
- for (unsigned I = 0, N = Record.size(); I != N; ++I)
- TentativeDefinitions.push_back(
- getGlobalDeclID(F, LocalDeclID(Record[I])));
+ for (unsigned I = 0, N = Record.size(); I != N; /*in loop*/)
+ TentativeDefinitions.push_back(ReadDeclID(F, Record, I));
break;
case KNOWN_NAMESPACES:
- for (unsigned I = 0, N = Record.size(); I != N; ++I)
- KnownNamespaces.push_back(getGlobalDeclID(F, LocalDeclID(Record[I])));
+ for (unsigned I = 0, N = Record.size(); I != N; /*in loop*/)
+ KnownNamespaces.push_back(ReadDeclID(F, Record, I));
break;
case UNDEFINED_BUT_USED:
@@ -3884,15 +3920,14 @@ llvm::Error ASTReader::ReadASTBlock(ModuleFile &F,
"invalid undefined-but-used record");
for (unsigned I = 0, N = Record.size(); I != N; /* in loop */) {
UndefinedButUsed.push_back(
- {getGlobalDeclID(F, LocalDeclID(Record[I++])),
+ {ReadDeclID(F, Record, I),
ReadSourceLocation(F, Record, I).getRawEncoding()});
}
break;
case DELETE_EXPRS_TO_ANALYZE:
for (unsigned I = 0, N = Record.size(); I != N;) {
- DelayedDeleteExprs.push_back(
- getGlobalDeclID(F, LocalDeclID(Record[I++])).get());
+ DelayedDeleteExprs.push_back(ReadDeclID(F, Record, I).getRawValue());
const uint64_t Count = Record[I++];
DelayedDeleteExprs.push_back(Count);
for (uint64_t C = 0; C < Count; ++C) {
@@ -3906,8 +3941,8 @@ llvm::Error ASTReader::ReadASTBlock(ModuleFile &F,
case VTABLES_TO_EMIT:
if (F.Kind == MK_MainFile ||
getContext().getLangOpts().BuildingPCHWithObjectFile)
- for (unsigned I = 0, N = Record.size(); I != N;)
- VTablesToEmit.push_back(getGlobalDeclID(F, LocalDeclID(Record[I++])));
+ for (unsigned I = 0, N = Record.size(); I != N; /*in loop*/)
+ VTablesToEmit.push_back(ReadDeclID(F, Record, I));
break;
case IMPORTED_MODULES:
@@ -3982,9 +4017,8 @@ llvm::Error ASTReader::ReadASTBlock(ModuleFile &F,
break;
case UNUSED_LOCAL_TYPEDEF_NAME_CANDIDATES:
- for (unsigned I = 0, N = Record.size(); I != N; ++I)
- UnusedLocalTypedefNameCandidates.push_back(
- getGlobalDeclID(F, LocalDeclID(Record[I])));
+ for (unsigned I = 0, N = Record.size(); I != N; /*in loop*/)
+ UnusedLocalTypedefNameCandidates.push_back(ReadDeclID(F, Record, I));
break;
case CUDA_PRAGMA_FORCE_HOST_DEVICE_DEPTH:
@@ -4039,9 +4073,8 @@ llvm::Error ASTReader::ReadASTBlock(ModuleFile &F,
}
case DECLS_TO_CHECK_FOR_DEFERRED_DIAGS:
- for (unsigned I = 0, N = Record.size(); I != N; ++I)
- DeclsToCheckForDeferredDiags.insert(
- getGlobalDeclID(F, LocalDeclID(Record[I])));
+ for (unsigned I = 0, N = Record.size(); I != N; /*in loop*/)
+ DeclsToCheckForDeferredDiags.insert(ReadDeclID(F, Record, I));
break;
}
}
@@ -5997,8 +6030,8 @@ llvm::Error ASTReader::ReadSubmoduleBlock(ModuleFile &F,
if (!ContextObj)
break;
SmallVector<GlobalDeclID, 16> Inits;
- for (auto &ID : Record)
- Inits.push_back(getGlobalDeclID(F, LocalDeclID(ID)));
+ for (unsigned I = 0; I < Record.size(); /*in loop*/)
+ Inits.push_back(ReadDeclID(F, Record, I));
ContextObj->addLazyModuleInitializers(CurrentModule, Inits);
break;
}
@@ -7645,8 +7678,8 @@ CXXBaseSpecifier *ASTReader::GetExternalCXXBaseSpecifiers(uint64_t Offset) {
GlobalDeclID ASTReader::getGlobalDeclID(ModuleFile &F,
LocalDeclID LocalID) const {
- if (LocalID.get() < NUM_PREDEF_DECL_IDS)
- return GlobalDeclID(LocalID.get());
+ if (LocalID < NUM_PREDEF_DECL_IDS)
+ return GlobalDeclID(LocalID.getRawValue());
unsigned OwningModuleFileIndex = LocalID.getModuleFileIndex();
DeclID ID = LocalID.getLocalDeclIndex();
@@ -7663,12 +7696,12 @@ GlobalDeclID ASTReader::getGlobalDeclID(ModuleFile &F,
ID -= NUM_PREDEF_DECL_IDS;
uint64_t NewModuleFileIndex = OwningModuleFile->Index + 1;
- return GlobalDeclID(ID, NewModuleFileIndex);
+ return GlobalDeclID(NewModuleFileIndex, ID);
}
bool ASTReader::isDeclIDFromModule(GlobalDeclID ID, ModuleFile &M) const {
// Predefined decls aren't from any module.
- if (ID.get() < NUM_PREDEF_DECL_IDS)
+ if (ID < NUM_PREDEF_DECL_IDS)
return false;
unsigned ModuleFileIndex = ID.getModuleFileIndex();
@@ -7677,7 +7710,7 @@ bool ASTReader::isDeclIDFromModule(GlobalDeclID ID, ModuleFile &M) const {
ModuleFile *ASTReader::getOwningModuleFile(GlobalDeclID ID) const {
// Predefined decls aren't from any module.
- if (ID.get() < NUM_PREDEF_DECL_IDS)
+ if (ID < NUM_PREDEF_DECL_IDS)
return nullptr;
uint64_t ModuleFileIndex = ID.getModuleFileIndex();
@@ -7694,7 +7727,7 @@ ModuleFile *ASTReader::getOwningModuleFile(const Decl *D) const {
}
SourceLocation ASTReader::getSourceLocationForDeclID(GlobalDeclID ID) {
- if (ID.get() < NUM_PREDEF_DECL_IDS)
+ if (ID < NUM_PREDEF_DECL_IDS)
return SourceLocation();
if (Decl *D = GetExistingDecl(ID))
@@ -7767,8 +7800,8 @@ static Decl *getPredefinedDecl(ASTContext &Context, PredefinedDeclIDs ID) {
unsigned ASTReader::translateGlobalDeclIDToIndex(GlobalDeclID GlobalID) const {
ModuleFile *OwningModuleFile = getOwningModuleFile(GlobalID);
if (!OwningModuleFile) {
- assert(GlobalID.get() < NUM_PREDEF_DECL_IDS && "Untransalted Global ID?");
- return GlobalID.get();
+ assert(GlobalID < NUM_PREDEF_DECL_IDS && "Untransalted Global ID?");
+ return GlobalID.getRawValue();
}
return OwningModuleFile->BaseDeclIndex + GlobalID.getLocalDeclIndex();
@@ -7777,7 +7810,7 @@ unsigned ASTReader::translateGlobalDeclIDToIndex(GlobalDeclID GlobalID) const {
Decl *ASTReader::GetExistingDecl(GlobalDeclID ID) {
assert(ContextObj && "reading decl with no AST context");
- if (ID.get() < NUM_PREDEF_DECL_IDS) {
+ if (ID < NUM_PREDEF_DECL_IDS) {
Decl *D = getPredefinedDecl(*ContextObj, (PredefinedDeclIDs)ID);
if (D) {
// Track that we have merged the declaration with ID \p ID into the
@@ -7801,7 +7834,7 @@ Decl *ASTReader::GetExistingDecl(GlobalDeclID ID) {
}
Decl *ASTReader::GetDecl(GlobalDeclID ID) {
- if (ID.get() < NUM_PREDEF_DECL_IDS)
+ if (ID < NUM_PREDEF_DECL_IDS)
return GetExistingDecl(ID);
unsigned Index = translateGlobalDeclIDToIndex(ID);
@@ -7823,8 +7856,8 @@ Decl *ASTReader::GetDecl(GlobalDeclID ID) {
LocalDeclID ASTReader::mapGlobalIDToModuleFileGlobalID(ModuleFile &M,
GlobalDeclID GlobalID) {
- if (GlobalID.get() < NUM_PREDEF_DECL_IDS)
- return LocalDeclID(GlobalID.get());
+ if (GlobalID < NUM_PREDEF_DECL_IDS)
+ return LocalDeclID::get(*this, M, GlobalID.getRawValue());
if (!M.ModuleOffsetMap.empty())
ReadModuleOffsetMap(M);
@@ -7834,7 +7867,7 @@ LocalDeclID ASTReader::mapGlobalIDToModuleFileGlobalID(ModuleFile &M,
if (Owner == &M) {
ID += NUM_PREDEF_DECL_IDS;
- return LocalDeclID(ID);
+ return LocalDeclID::get(*this, M, ID);
}
uint64_t OrignalModuleFileIndex = 0;
@@ -7847,17 +7880,17 @@ LocalDeclID ASTReader::mapGlobalIDToModuleFileGlobalID(ModuleFile &M,
if (!OrignalModuleFileIndex)
return LocalDeclID();
- return LocalDeclID(ID, OrignalModuleFileIndex);
+ return getLocalDeclID(*this, M, OrignalModuleFileIndex, ID);
}
-GlobalDeclID ASTReader::ReadDeclID(ModuleFile &F, const RecordData &Record,
+GlobalDeclID ASTReader::ReadDeclID(ModuleFile &F, const RecordDataImpl &Record,
unsigned &Idx) {
if (Idx >= Record.size()) {
Error("Corrupted AST file");
return GlobalDeclID(0);
}
- return getGlobalDeclID(F, LocalDeclID(Record[Idx++]));
+ return getGlobalDeclID(F, LocalDeclID::get(*this, F, Record[Idx++]));
}
/// Resolve the offset of a statement into a statement.
@@ -7904,7 +7937,7 @@ void ASTReader::FindExternalLexicalDecls(
PredefsVisited[ID] = true;
}
- if (Decl *D = GetLocalDecl(*M, LocalDeclID(ID))) {
+ if (Decl *D = GetLocalDecl(*M, LocalDeclID::get(*this, *M, ID))) {
assert(D->getKind() == K && "wrong kind for lexical decl");
if (!DC->isDeclInLexicalTraversal(D))
Decls.push_back(D);
@@ -7953,7 +7986,7 @@ class UnalignedDeclIDComp {
SourceLocation getLocation(unaligned_decl_id_t ID) const {
return Reader.getSourceManager().getFileLoc(
Reader.getSourceLocationForDeclID(
- Reader.getGlobalDeclID(Mod, (LocalDeclID)ID)));
+ Reader.getGlobalDeclID(Mod, LocalDeclID::get(Reader, Mod, ID))));
}
};
@@ -7986,7 +8019,8 @@ void ASTReader::FindFileRegionDecls(FileID File,
// to backtrack until we find it otherwise we will fail to report that the
// region overlaps with an objc container.
while (BeginIt != DInfo.Decls.begin() &&
- GetDecl(getGlobalDeclID(*DInfo.Mod, (LocalDeclID)(*BeginIt)))
+ GetDecl(getGlobalDeclID(*DInfo.Mod,
+ LocalDeclID::get(*this, *DInfo.Mod, *BeginIt)))
->isTopLevelDeclInObjCContainer())
--BeginIt;
@@ -7997,7 +8031,8 @@ void ASTReader::FindFileRegionDecls(FileID File,
for (ArrayRef<unaligned_decl_id_t>::iterator DIt = BeginIt; DIt != EndIt;
++DIt)
- Decls.push_back(GetDecl(getGlobalDeclID(*DInfo.Mod, (LocalDeclID)(*DIt))));
+ Decls.push_back(GetDecl(getGlobalDeclID(
+ *DInfo.Mod, LocalDeclID::get(*this, *DInfo.Mod, *DIt))));
}
bool
@@ -8193,14 +8228,9 @@ dumpModuleIDMap(StringRef Name,
llvm::errs() << Name << ":\n";
for (typename MapType::const_iterator I = Map.begin(), IEnd = Map.end();
- I != IEnd; ++I) {
- uint64_t ID = 0;
- if constexpr (std::is_integral_v<Key>)
- ID = I->first;
- else /*GlobalDeclID*/
- ID = I->first.get();
- llvm::errs() << " " << ID << " -> " << I->second->FileName << "\n";
- }
+ I != IEnd; ++I)
+ llvm::errs() << " " << (DeclID)I->first << " -> " << I->second->FileName
+ << "\n";
}
LLVM_DUMP_METHOD void ASTReader::dump() {
@@ -8273,11 +8303,11 @@ void ASTReader::UpdateSema() {
assert(SemaDeclRefs.size() % 3 == 0);
for (unsigned I = 0; I != SemaDeclRefs.size(); I += 3) {
if (!SemaObj->StdNamespace)
- SemaObj->StdNamespace = SemaDeclRefs[I].get();
+ SemaObj->StdNamespace = SemaDeclRefs[I].getRawValue();
if (!SemaObj->StdBadAlloc)
- SemaObj->StdBadAlloc = SemaDeclRefs[I + 1].get();
+ SemaObj->StdBadAlloc = SemaDeclRefs[I + 1].getRawValue();
if (!SemaObj->StdAlignValT)
- SemaObj->StdAlignValT = SemaDeclRefs[I + 2].get();
+ SemaObj->StdAlignValT = SemaDeclRefs[I + 2].getRawValue();
}
SemaDeclRefs.clear();
}
@@ -8809,11 +8839,10 @@ void ASTReader::ReadLateParsedTemplates(
RecordDataImpl &LateParsed = LPT.second;
for (unsigned Idx = 0, N = LateParsed.size(); Idx < N;
/* In loop */) {
- FunctionDecl *FD = cast<FunctionDecl>(
- GetLocalDecl(*FMod, LocalDeclID(LateParsed[Idx++])));
+ FunctionDecl *FD = ReadDeclAs<FunctionDecl>(*FMod, LateParsed, Idx);
auto LT = std::make_unique<LateParsedTemplate>();
- LT->D = GetLocalDecl(*FMod, LocalDeclID(LateParsed[Idx++]));
+ LT->D = ReadDecl(*FMod, LateParsed, Idx);
LT->FPO = FPOptions::getFromOpaqueInt(LateParsed[Idx++]);
ModuleFile *F = getOwningModuleFile(LT->D);
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp
index eb0c8c6c099b1..4b8b515c02c70 100644
--- a/clang/lib/Serialization/ASTReaderDecl.cpp
+++ b/clang/lib/Serialization/ASTReaderDecl.cpp
@@ -274,7 +274,7 @@ namespace clang {
auto *&LazySpecializations = D->getCommonPtr()->LazySpecializations;
if (auto &Old = LazySpecializations) {
- IDs.insert(IDs.end(), Old + 1, Old + 1 + Old[0].get());
+ IDs.insert(IDs.end(), Old + 1, Old + 1 + Old[0].getRawValue());
llvm::sort(IDs);
IDs.erase(std::unique(IDs.begin(), IDs.end()), IDs.end());
}
@@ -2017,7 +2017,7 @@ void ASTDeclReader::ReadCXXDefinitionData(
if (Data.NumVBases)
Data.VBases = ReadGlobalOffset();
- Data.FirstFriend = readDeclID().get();
+ Data.FirstFriend = readDeclID().getRawValue();
} else {
using Capture = LambdaCapture;
@@ -2277,11 +2277,11 @@ ASTDeclReader::VisitCXXRecordDeclImpl(CXXRecordDecl *D) {
// compute it.
if (WasDefinition) {
GlobalDeclID KeyFn = readDeclID();
- if (KeyFn.get() && D->isCompleteDefinition())
+ if (KeyFn.isValid() && D->isCompleteDefinition())
// FIXME: This is wrong for the ARM ABI, where some other module may have
// made this function no longer be a key function. We need an update
// record or similar for that case.
- C.KeyFunctions[D] = KeyFn.get();
+ C.KeyFunctions[D] = KeyFn.getRawValue();
}
return Redecl;
@@ -2370,7 +2370,7 @@ void ASTDeclReader::VisitFriendDecl(FriendDecl *D) {
for (unsigned i = 0; i != D->NumTPLists; ++i)
D->getTrailingObjects<TemplateParameterList *>()[i] =
Record.readTemplateParameterList();
- D->NextFriend = readDeclID().get();
+ D->NextFriend = readDeclID().getRawValue();
D->UnsupportedFriend = (Record.readInt() != 0);
D->FriendLoc = readSourceLocation();
}
@@ -3079,14 +3079,14 @@ void ASTDeclReader::VisitOMPDeclareReductionDecl(OMPDeclareReductionDecl *D) {
Expr *Init = Record.readExpr();
auto IK = static_cast<OMPDeclareReductionInitKind>(Record.readInt());
D->setInitializer(Init, IK);
- D->PrevDeclInScope = readDeclID().get();
+ D->PrevDeclInScope = readDeclID().getRawValue();
}
void ASTDeclReader::VisitOMPDeclareMapperDecl(OMPDeclareMapperDecl *D) {
Record.readOMPChildren(D->Data);
VisitValueDecl(D);
D->VarName = Record.readDeclarationName();
- D->PrevDeclInScope = readDeclID().get();
+ D->PrevDeclInScope = readDeclID().getRawValue();
}
void ASTDeclReader::VisitOMPCapturedExprDecl(OMPCapturedExprDecl *D) {
@@ -3140,9 +3140,7 @@ class AttrReader {
OMPTraitInfo *readOMPTraitInfo() { return Reader.readOMPTraitInfo(); }
- template <typename T> T *GetLocalDeclAs(LocalDeclID LocalID) {
- return Reader.GetLocalDeclAs<T>(LocalID);
- }
+ template <typename T> T *readDeclAs() { return Reader.readDeclAs<T>(); }
};
}
@@ -4357,7 +4355,8 @@ void ASTReader::loadPendingDeclChain(Decl *FirstLocal, uint64_t LocalOffset) {
// we should instead generate one loop per kind and dispatch up-front?
Decl *MostRecent = FirstLocal;
for (unsigned I = 0, N = Record.size(); I != N; ++I) {
- auto *D = GetLocalDecl(*M, LocalDeclID(Record[N - I - 1]));
+ unsigned Idx = N - I - 1;
+ auto *D = ReadDecl(*M, Record, Idx);
ASTDeclReader::attachPreviousDecl(*this, D, MostRecent, CanonDecl);
MostRecent = D;
}
@@ -4454,7 +4453,7 @@ namespace {
M.ObjCCategoriesMap + M.LocalNumObjCCategoriesInMap,
Compare);
if (Result == M.ObjCCategoriesMap + M.LocalNumObjCCategoriesInMap ||
- Result->getDefinitionID() != LocalID) {
+ LocalID != Result->getDefinitionID()) {
// We didn't find anything. If the class definition is in this module
// file, then the module files it depends on cannot have any categories,
// so suppress further lookup.
@@ -4466,8 +4465,7 @@ namespace {
unsigned N = M.ObjCCategories[Offset];
M.ObjCCategories[Offset++] = 0; // Don't try to deserialize again
for (unsigned I = 0; I != N; ++I)
- add(cast_or_null<ObjCCategoryDecl>(
- Reader.GetLocalDecl(M, LocalDeclID(M.ObjCCategories[Offset++]))));
+ add(Reader.ReadDeclAs<ObjCCategoryDecl>(M, M.ObjCCategories, Offset));
return true;
}
};
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index 713091e070805..50fa44d34f524 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -3335,7 +3335,7 @@ uint64_t ASTWriter::WriteDeclContextLexicalBlock(ASTContext &Context,
continue;
KindDeclPairs.push_back(D->getKind());
- KindDeclPairs.push_back(GetDeclRef(D).get());
+ KindDeclPairs.push_back(GetDeclRef(D).getRawValue());
}
++NumLexicalDeclContexts;
@@ -3389,7 +3389,7 @@ void ASTWriter::WriteFileDeclIDsMap() {
Info.FirstDeclIndex = FileGroupedDeclIDs.size();
llvm::stable_sort(Info.DeclIDs);
for (auto &LocDeclEntry : Info.DeclIDs)
- FileGroupedDeclIDs.push_back(LocDeclEntry.second.get());
+ FileGroupedDeclIDs.push_back(LocDeclEntry.second.getRawValue());
}
auto Abbrev = std::make_shared<BitCodeAbbrev>();
@@ -4444,7 +4444,7 @@ void ASTWriter::WriteDeclContextVisibleUpdate(const DeclContext *DC) {
// Write the lookup table
RecordData::value_type Record[] = {UPDATE_VISIBLE,
- getDeclID(cast<Decl>(DC)).get()};
+ getDeclID(cast<Decl>(DC)).getRawValue()};
Stream.EmitRecordWithBlob(UpdateVisibleAbbrev, Record, LookupTable);
}
@@ -5657,7 +5657,7 @@ void ASTWriter::WriteDeclAndTypes(ASTContext &Context) {
continue;
NewGlobalKindDeclPairs.push_back(D->getKind());
- NewGlobalKindDeclPairs.push_back(GetDeclRef(D).get());
+ NewGlobalKindDeclPairs.push_back(GetDeclRef(D).getRawValue());
}
auto Abv = std::make_shared<llvm::BitCodeAbbrev>();
@@ -6159,11 +6159,11 @@ void ASTWriter::AddEmittedDeclRef(const Decl *D, RecordDataImpl &Record) {
if (!wasDeclEmitted(D))
return;
- Record.push_back(GetDeclRef(D).get());
+ AddDeclRef(D, Record);
}
void ASTWriter::AddDeclRef(const Decl *D, RecordDataImpl &Record) {
- Record.push_back(GetDeclRef(D).get());
+ Record.push_back(GetDeclRef(D).getRawValue());
}
LocalDeclID ASTWriter::GetDeclRef(const Decl *D) {
diff --git a/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp
index 49b2f9bc1e6cf..59d94c3d79824 100644
--- a/clang/lib/Serialization/ASTWriterDecl.cpp
+++ b/clang/lib/Serialization/ASTWriterDecl.cpp
@@ -225,7 +225,7 @@ namespace clang {
ArrayRef<GlobalDeclID> LazySpecializations;
if (auto *LS = Common->LazySpecializations)
- LazySpecializations = llvm::ArrayRef(LS + 1, LS[0].get());
+ LazySpecializations = llvm::ArrayRef(LS + 1, LS[0].getRawValue());
// Add a slot to the record for the number of specializations.
unsigned I = Record.size();
@@ -2834,7 +2834,7 @@ void ASTWriter::WriteDecl(ASTContext &Context, Decl *D) {
SourceLocationEncoding::RawLocEncoding RawLoc =
getRawSourceLocationEncoding(getAdjustedLocation(Loc));
- unsigned Index = ID.get() - FirstDeclID.get();
+ unsigned Index = ID.getRawValue() - FirstDeclID.getRawValue();
if (DeclOffsets.size() == Index)
DeclOffsets.emplace_back(RawLoc, Offset, DeclTypesBlockStartOffset);
else if (DeclOffsets.size() < Index) {
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp
index ca7630adfbb7b..660d7b57d8e0b 100644
--- a/clang/utils/TableGen/ClangAttrEmitter.cpp
+++ b/clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -105,9 +105,9 @@ GetFlattenedSpellings(const Record &Attr) {
static std::string ReadPCHRecord(StringRef type) {
return StringSwitch<std::string>(type)
- .EndsWith("Decl *", "Record.GetLocalDeclAs<" +
+ .EndsWith("Decl *", "Record.readDeclAs<" +
std::string(type.data(), 0, type.size() - 1) +
- ">(LocalDeclID(Record.readInt()))")
+ ">()")
.Case("TypeSourceInfo *", "Record.readTypeSourceInfo()")
.Case("Expr *", "Record.readExpr()")
.Case("IdentifierInfo *", "Record.readIdentifier()")
More information about the cfe-commits
mailing list