SerializeLoc: remove NameLoc entry in the serialized format

Having both Loc and NameLoc fields seems to be redundant.
This commit is contained in:
Xi Ge
2019-10-07 15:27:29 -07:00
parent 8293bdc9e9
commit c9647bb02e
3 changed files with 2 additions and 14 deletions

View File

@@ -2387,8 +2387,8 @@ Optional<BasicDeclLocs> ModuleFile::getBasicDeclLocsForDecl(const Decl *D) const
auto UsrId = *It;
uint32_t NumSize = 4;
// Size of BasicDeclLocs in the buffer.
// FilePathOffset + 4 * LineColumn
uint32_t LineColumnCount = 4;
// FilePathOffset + LocNum * LineColumn
uint32_t LineColumnCount = 3;
uint32_t RecordSize = NumSize + NumSize * 2 * LineColumnCount;
uint32_t RecordOffset = RecordSize * UsrId;
assert(RecordOffset < BasicDeclLocsData.size());
@@ -2408,7 +2408,6 @@ Optional<BasicDeclLocs> ModuleFile::getBasicDeclLocsForDecl(const Decl *D) const
Result.X.Line = ReadNext(); \
Result.X.Column = ReadNext();
READ_FIELD(Loc)
READ_FIELD(NameLoc)
READ_FIELD(StartLoc)
READ_FIELD(EndLoc)
#undef READ_FIELD