This is an archive of the discontinued LLVM Phabricator instance.

clang/Modules: Split loop in ReadAST between failable and not
ClosedPublic

Authored by dexonsmith on Nov 10 2019, 11:40 AM.

Details

Summary

Split a loop in ReadAST that visits the just-loaded module chain,
between an initial loop that reads further from the ASTs (and can fail)
and a second loop that does some preloading (and cannot fail). This
makes it less likely for a reading failure to affect the AST.

This is not fixing a known bug and the behaviour change may not be
observable, it's just part of an audit to look at all of the error
handling in the ASTReader.

Diff Detail

Event Timeline

dexonsmith created this revision.Nov 10 2019, 11:40 AM
aprantl accepted this revision.Nov 11 2019, 2:28 PM
aprantl added inline comments.
clang/lib/Serialization/ASTReader.cpp
4211

and this?

4236

Could this be a range-based for?

This revision is now accepted and ready to land.Nov 11 2019, 2:28 PM
dexonsmith marked an inline comment as done.Nov 11 2019, 2:43 PM
dexonsmith added inline comments.
clang/lib/Serialization/ASTReader.cpp
4236

Yes, probably. If so, I'll do that to the existing one as a prep patch (before pushing this change), and follow the style for the new one.