[PATCH] D124287: [modules][ODRHash] Compare ODR hashes to detect mismatches in duplicate ObjCInterfaceDecl.

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 28 13:53:22 PDT 2022


vsapsai added a comment.

Recollected that `ASTStructuralEquivalence` by default tends to be order-dependent while ODR hash order-independent. Different approaches can be achieved with different mechanisms but some behavior is easier to achieve.

Another peculiarity of `ASTStructuralEquivalence` is that it allows more customizability. Initializing `StructuralEquivalenceContext` is more involved than `getODRHash()` but adding knobs for tweaking comparison behavior is easier.



================
Comment at: clang/lib/AST/ODRHash.cpp:528
+
+  //FIXME: Hash other interface-specific elements like protocols, etc.
+
----------------
jansvoboda11 wrote:
> Is this important to implement now, or are you fine leaving this be for the time being?
When I was posting this patch, I thought it wasn't critical to cover everything immediately. Now I'm thinking about the ways to minimize the uncovered elements. Specifically, I'm thinking about adding support for protocols first and then for interfaces. Protocols aren't as useful as interfaces but they are simpler and can be easier to add.

And `AddSubDecl` should cover some of the nested decls already, need to add more cases to the test.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124287



More information about the cfe-commits mailing list