[PATCH] D78256: [llvm][NFC][CallSite] Removed CallSite from some implementation details.

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 15 18:14:24 PDT 2020


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


================
Comment at: llvm/lib/Transforms/Utils/FunctionComparator.cpp:589
     return cmpNumbers(CI->getPredicate(), cast<CmpInst>(R)->getPredicate());
-  if (auto CSL = CallSite(const_cast<Instruction *>(L))) {
-    auto CSR = CallSite(const_cast<Instruction *>(R));
-    if (int Res = cmpNumbers(CSL.getCallingConv(), CSR.getCallingConv()))
+  if (auto *CBL = dyn_cast<CallBase>(const_cast<Instruction *>(L))) {
+    auto *CBR = cast<CallBase>(const_cast<Instruction *>(R));
----------------
craig.topper wrote:
> Why do we need a const_cast? Aren't getCallingConv and getAttributes() both const methods?
good point, fixed


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78256





More information about the llvm-commits mailing list