[PATCH] D128488: [ODRHash diagnostics] Split `err_module_odr_violation_mismatch_decl_diff` into per-entity diagnostics. NFC.

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 30 18:02:20 PDT 2022


vsapsai added a comment.

Thanks for the review, Chuanqi!



================
Comment at: clang/lib/Serialization/ASTReader.cpp:9642
+  // note_module_odr_violation_record
+  enum ODRCXXRecordDifference {
     StaticAssertCondition,
----------------
ChuanqiXu wrote:
> Is this specific to C++?
That is supposed to be for C++ only. In D128490 I'm moving it to 
```lang=c++
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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128488/new/

https://reviews.llvm.org/D128488



More information about the cfe-commits mailing list