vsk added a comment.

I suggest changing the API for 'canDevirtualizeCall' a bit but this is looking 
great overall. The code movement and test case changes look good.



================
Comment at: include/clang/AST/DeclCXX.h:1902
+  bool canDevirtualizeCall(const Expr *Base, bool IsAppleKext,
+                           CXXMethodDecl *&DM);
+
----------------
Something like `CXXMethodDecl *getDevirtualizedMethod(...)` would fit in better 
with the current API. E.g, getCorrespondingMethodInClass is done this way (and 
returns nullptr when a method is not found).


================
Comment at: lib/AST/DeclCXX.cpp:1693
+  const CXXMethodDecl *DM;
+  return ::canDevirtualizeCall(Base, this, IsAppleKext, DM);
+}
----------------
Instead of templating canDevirtualizeCall, you could do something like 
`const_cast<CXXMethodDecl *>(this)->getDevirtualizedMethod(...)`.


https://reviews.llvm.org/D34301



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to