This is an archive of the discontinued LLVM Phabricator instance.

Serialization: Merge three diagnostics to simplify ASTReader::getInputFile, NFC
ClosedPublic

Authored by dexonsmith on Nov 12 2020, 10:15 AM.

Details

Summary

Clean up the logic for err_fe_{pch,module,ast}_file_modified to use a
select like other ASTReader diagnostics. There should be no
functionality change here, just a cleanup.

Diff Detail

Event Timeline

dexonsmith created this revision.Nov 12 2020, 10:15 AM

Getting rid of the duplication is definitely nice. I left one inline question about the terminology used.

clang/include/clang/Basic/DiagnosticSerializationKinds.td
19–21

I'm a bit confused by the fact that a diagnostic with pch_file in its name might output module file or AST file as well.

This file already contains a couple diagnostics that use a similar %select and have module in their name (e.g. err_module_file_out_of_date). Would it make sense to unify the terminology here?

dexonsmith added inline comments.Nov 13 2020, 8:25 AM
clang/include/clang/Basic/DiagnosticSerializationKinds.td
19–21

Yeah, I wasn't sure what to do about that. module is also wrong. I ended up choosing pch just since the diagnostic was in a group of pch diagnostics.

IMO, the best name for all of these is ast since that's the most generic term. I could rename the others to ast in a prep commit and then update this patch to use ast as well. WDYT?

jansvoboda11 accepted this revision.Nov 13 2020, 9:52 AM

LGTM

clang/include/clang/Basic/DiagnosticSerializationKinds.td
19–21

Sounds good.

This revision is now accepted and ready to land.Nov 13 2020, 9:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 13 2020, 1:23 PM