[PATCH] D60850: [sema][objc] Minor refactor to OverrideSearch. NFCI.

John McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 18 20:02:32 PDT 2019


rjmccall added inline comments.


================
Comment at: clang/lib/Sema/SemaDeclObjC.cpp:4168
 public:
-  Sema &S;
-  ObjCMethodDecl *Method;
+  const ObjCMethodDecl &Method;
   llvm::SmallSetVector<ObjCMethodDecl*, 4> Overridden;
----------------
We've been trying to move towards consistently passing around AST nodes as pointers, not references.  Well, at least I am; please keep this as a pointer, at any rate.


================
Comment at: clang/lib/Sema/SemaDeclObjC.cpp:4254
     // Otherwise it overrides declarations from the class.
-    } else if (ObjCInterfaceDecl *Interface = impl->getClassInterface()) {
+    } else if (const ObjCInterfaceDecl *Interface = impl->getClassInterface()) {
       search(Interface);
----------------
You could use `auto` here, I think the return type is obvious enough from the method.


================
Comment at: clang/lib/Sema/SemaDeclObjC.cpp:4279
     // the class interface.
-    if (ObjCInterfaceDecl *Interface = impl->getClassInterface())
+    if (const ObjCInterfaceDecl *Interface = impl->getClassInterface())
       search(Interface);
----------------
This could also be `auto`.


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

https://reviews.llvm.org/D60850





More information about the llvm-commits mailing list