[PATCH] D135118: [clang/Sema] Fix non-deterministic order for certain kind of diagnostics

Argyrios Kyrtzidis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 4 17:58:09 PDT 2022


akyrtzi marked an inline comment as done.
akyrtzi added inline comments.


================
Comment at: clang/include/clang/AST/DeclObjC.h:1091
   virtual void collectPropertiesToImplement(PropertyMap &PM,
                                             PropertyDeclOrder &PO) const {}
 
----------------
akyrtzi wrote:
> benlangmuir wrote:
> > Can we use the existing `PropertyDeclOrder` instead of changing the map type? Or else get rid of the `PO` parameter to functions using `PropertyMap` if we keep the MapVector?
> I'll take a look.
See updated patch.

The diagnostic machinery (e.g. in `DiagnoseUnimplementedProperties`) for these ObjC diagnostics is using `PropertyMap` separately from the `collectPropertiesToImplement` functions, so I kept the map type change and removed `PropertyDeclOrder` from these functions accepting `PropertyMap`.
This is better for maintainance since it'd be an easy mistake to add new code that iterates the `DenseMap` instead of the vector.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135118



More information about the cfe-commits mailing list