[all-commits] [llvm/llvm-project] a65d53: [ODRHash] Detect duplicate `ObjCProtocolDecl` ODR ...

Volodymyr Sapsai via All-commits all-commits at lists.llvm.org
Thu Nov 17 18:32:30 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a65d5309d5b73527efcbdec49a3ba9bba0fd873d
      https://github.com/llvm/llvm-project/commit/a65d5309d5b73527efcbdec49a3ba9bba0fd873d
  Author: Volodymyr Sapsai <vsapsai at apple.com>
  Date:   2022-11-17 (Thu, 17 Nov 2022)

  Changed paths:
    M clang/include/clang/AST/DeclObjC.h
    M clang/include/clang/AST/ODRDiagsEmitter.h
    M clang/include/clang/Basic/DiagnosticASTKinds.td
    M clang/include/clang/Sema/Sema.h
    M clang/lib/AST/DeclObjC.cpp
    M clang/lib/AST/ODRDiagsEmitter.cpp
    M clang/lib/Parse/ParseObjc.cpp
    M clang/lib/Sema/SemaDeclObjC.cpp
    M clang/test/Modules/compare-objc-protocol.m
    A clang/test/Modules/hidden-duplicates.m

  Log Message:
  -----------
  [ODRHash] Detect duplicate `ObjCProtocolDecl` ODR mismatches during parsing.

When during parsing we encountered a duplicate `ObjCProtocolDecl`, we
were always emitting an error. With this change we accept
* when a previous `ObjCProtocolDecl` is in a hidden [sub]module;
* parsed `ObjCProtocolDecl` is the same as the previous one.

And in case of mismatches we provide more detailed error messages.

rdar://93069080

Differential Revision: https://reviews.llvm.org/D130327




More information about the All-commits mailing list