This is an archive of the discontinued LLVM Phabricator instance.

[ODRHash diagnostics] Split `err_module_odr_violation_mismatch_decl_diff` into per-entity diagnostics. NFC.
ClosedPublic

Authored by vsapsai on Jun 23 2022, 7:44 PM.

Details

Summary

We'll need to add more cases for Objective-C entities and adding
everything to err_module_odr_violation_mismatch_decl_diff makes it
harder to work with over time.

Diff Detail

Event Timeline

vsapsai created this revision.Jun 23 2022, 7:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 23 2022, 7:44 PM
Herald added a subscriber: ributzka. · View Herald Transcript
vsapsai requested review of this revision.Jun 23 2022, 7:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 23 2022, 7:44 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
vsapsai updated this revision to Diff 441182.Jun 29 2022, 3:02 PM

Rebase after blocking change has landed.

vsapsai added a subscriber: Restricted Project.
ChuanqiXu accepted this revision.Jun 29 2022, 7:20 PM

LGTM if the changes is specific to C++. Otherwise we need to rename for that enumerate.

clang/lib/Serialization/ASTReader.cpp
9642

Is this specific to C++?

This revision is now accepted and ready to land.Jun 29 2022, 7:20 PM

Thanks for the review, Chuanqi!

clang/lib/Serialization/ASTReader.cpp
9642

That is supposed to be for C++ only. In D128490 I'm moving it to

bool ODRDiagsEmitter::diagnoseMismatch(
    const CXXRecordDecl *, const CXXRecordDecl *,
    const struct CXXRecordDecl::DefinitionData *) const

so it will be even harder to use for non-C++ decls. And for pure C RecordDecl the plan is to move common checks there and call them from C++-specific code. So this enum should remain C++-specific. At most I might move some constants to ODRRecordDifference or something like that.