[llvm] fe8a2ad - [llvm][NFC][CallSite] Remove CallSite from CGSCCPassManager

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 13 22:52:48 PDT 2020


Author: Mircea Trofin
Date: 2020-04-13T22:52:15-07:00
New Revision: fe8a2ad4a0e1d83127cf34a1937b47e60373f324

URL: https://github.com/llvm/llvm-project/commit/fe8a2ad4a0e1d83127cf34a1937b47e60373f324
DIFF: https://github.com/llvm/llvm-project/commit/fe8a2ad4a0e1d83127cf34a1937b47e60373f324.diff

LOG: [llvm][NFC][CallSite] Remove CallSite from CGSCCPassManager

Reviewers: craig.topper, dblaikie, davidxl

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78080

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/CGSCCPassManager.h b/llvm/include/llvm/Analysis/CGSCCPassManager.h
index 6e3b4aac3dc9..4c5191797f59 100644
--- a/llvm/include/llvm/Analysis/CGSCCPassManager.h
+++ b/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 @@ class DevirtSCCRepeatedPass
             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 @@ class DevirtSCCRepeatedPass
       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,


        


More information about the llvm-commits mailing list