[PATCH] D99517: Implemented [[clang::musttail]] attribute for guaranteed tail calls.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 9 12:12:51 PDT 2021


aaron.ballman added inline comments.


================
Comment at: clang/lib/Sema/SemaStmt.cpp:697-699
+  } else if (VD && dyn_cast<MemberPointerType>(VD->getType())) {
+    // Call is: obj->*method_ptr or obj.*method_ptr
+    const auto *MPT = VD->getType()->castAs<MemberPointerType>();
----------------
I'm not certain if I should take a shower after writing that code or not, but it's one potential way not to perform the cast twice.

If that code is too odious for others, we should at least change the `dyn_cast<>` in the `else if` to be an `isa<>`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99517



More information about the cfe-commits mailing list