[PATCH] D37308: Interface class with uuid base record

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 7 10:23:03 PDT 2017


erichkeane added inline comments.


================
Comment at: lib/Sema/SemaDeclCXX.cpp:2377
+/// \brief Tests if the __interface base is public.
+static bool IsBasePublicInterface(const CXXRecordDecl *RD,
+                                  AccessSpecifier spec) {
----------------
This function isn't testing the 'base', it is testing the actual record decl.


================
Comment at: lib/Sema/SemaDeclCXX.cpp:2391
+
+static bool IsInheritatedBaseUuid(const CXXRecordDecl *RD) {
+  for (unsigned int n = 0; n < RD->getNumBases(); n++) {
----------------
This function isn't nearly correct.  IT is only testing the first base (over and over, but returns immediately...).


================
Comment at: lib/Sema/SemaDeclCXX.cpp:2396
+
+    return (Base && Base->getName() == "IUnknown" &&
+            !strcmp(Base->getAttr<InheritableAttr>()->getSpelling(),"uuid"));
----------------
Note that this can go down a number of layers.  You have to ensure that it goes multiple layers down.  You may wish to make this recursive, and to use your "IsUnknownType" function..


https://reviews.llvm.org/D37308





More information about the cfe-commits mailing list