[PATCH] D78080: [llvm][NFC][CallSite] Remove CallSite from CGSCCPassManager

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 13 22:14:56 PDT 2020


mtrofin created this revision.
mtrofin added reviewers: craig.topper, dblaikie, davidxl.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78080

Files:
  llvm/include/llvm/Analysis/CGSCCPassManager.h


Index: llvm/include/llvm/Analysis/CGSCCPassManager.h
===================================================================
--- llvm/include/llvm/Analysis/CGSCCPassManager.h
+++ llvm/include/llvm/Analysis/CGSCCPassManager.h
@@ -95,7 +95,6 @@
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Analysis/LazyCallGraph.h"
-#include "llvm/IR/CallSite.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/InstIterator.h"
 #include "llvm/IR/PassManager.h"
@@ -605,8 +604,8 @@
             CallCounts.insert(std::make_pair(&N.getFunction(), CountLocal))
                 .first->second;
         for (Instruction &I : instructions(N.getFunction()))
-          if (auto CS = CallSite(&I)) {
-            if (CS.getCalledFunction()) {
+          if (auto *CB = dyn_cast<CallBase>(&I)) {
+            if (CB->getCalledFunction()) {
               ++Count.Direct;
             } else {
               ++Count.Indirect;
@@ -648,17 +647,17 @@
       auto IsDevirtualizedHandle = [&](WeakTrackingVH &CallH) {
         if (!CallH)
           return false;
-        auto CS = CallSite(CallH);
-        if (!CS)
+        auto *CB = dyn_cast<CallBase>(CallH);
+        if (!CB)
           return false;
 
         // If the call is still indirect, leave it alone.
-        Function *F = CS.getCalledFunction();
+        Function *F = CB->getCalledFunction();
         if (!F)
           return false;
 
         LLVM_DEBUG(dbgs() << "Found devirtualized call from "
-                          << CS.getParent()->getParent()->getName() << " to "
+                          << CB->getParent()->getParent()->getName() << " to "
                           << F->getName() << "\n");
 
         // We now have a direct call where previously we had an indirect call,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78080.257197.patch
Type: text/x-patch
Size: 1774 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200414/3fed0de2/attachment.bin>


More information about the llvm-commits mailing list