This is an archive of the discontinued LLVM Phabricator instance.

Add a class ASTRecordReader which wraps an ASTReader, a RecordData, and ModuleFile.
ClosedPublic

Authored by dlj on Dec 14 2016, 4:07 PM.

Details

Summary

When reading an ASTRecord, each RecordData is logically contained within a
single ModuleFile, and global(er) state is contained by a single ASTReader. This
means that any operations that read from a RecordData and reference an ASTReader
or a ModuleFile, will always reference the same ASTReader or ModuleFile.
ASTRecordReader groups these together so that parameters don't need to be
duplicated ad infinitum. Most uses of the Idx variable seem to be redunant
aliases as well, but I'll leave that for now.

Event Timeline

dlj updated this revision to Diff 81492.Dec 14 2016, 4:07 PM
dlj retitled this revision from to Add a class ASTRecordReader which wraps an ASTReader, a RecordData, and ModuleFile..
dlj updated this object.
dlj added a reviewer: rsmith.
dlj added a subscriber: cfe-commits.
dlj updated this revision to Diff 81521.Dec 14 2016, 7:09 PM
  • Picked some whitespace nits.
  • Removed extraneous reference from a class.
rsmith accepted this revision.Dec 15 2016, 11:50 AM
rsmith edited edge metadata.
rsmith added inline comments.
lib/Serialization/ASTReader.cpp
5870–5876

Can you remove the .getRecordData() here and use ASTRecordReader::operator[] instead?

This revision is now accepted and ready to land.Dec 15 2016, 11:50 AM
dlj updated this revision to Diff 81643.Dec 15 2016, 1:02 PM
dlj marked an inline comment as done.
dlj edited edge metadata.

Remove getRecordData() entirely since operator[] covers all the use cases.

This revision was automatically updated to reflect the committed changes.