]> granicus.if.org Git - llvm/commitdiff
Move findBBwithCalls to the file it's used in to avoid unused function
authorEric Christopher <echristo@gmail.com>
Tue, 13 Aug 2019 00:05:01 +0000 (00:05 +0000)
committerEric Christopher <echristo@gmail.com>
Tue, 13 Aug 2019 00:05:01 +0000 (00:05 +0000)
warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368636 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h
lib/ExecutionEngine/Orc/SpeculateAnalyses.cpp

index 6f7a784a8f8a4dae7259d214f840e03fbe233572..2652bff72a629e815b3eaad8cf858f991f671727 100644 (file)
 
 #include <vector>
 
-namespace {
-using namespace llvm;
-std::vector<const BasicBlock *> findBBwithCalls(const Function &F,
-                                                bool IndirectCall = false) {
-  std::vector<const BasicBlock *> BBs;
-
-  auto findCallInst = [&IndirectCall](const Instruction &I) {
-    if (auto Call = dyn_cast<CallBase>(&I)) {
-      if (Call->isIndirectCall())
-        return IndirectCall;
-      else
-        return true;
-    } else
-      return false;
-  };
-  for (auto &BB : F)
-    if (findCallInst(*BB.getTerminator()) ||
-        llvm::any_of(BB.instructionsWithoutDebug(), findCallInst))
-      BBs.emplace_back(&BB);
-
-  return BBs;
-}
-} // namespace
-
 namespace llvm {
 
 namespace orc {
index 9d8c2f331de2af12295d4a9e0a93ee06a5fc3552..52e9919f57c682e7b6562e38e42aee57202b4824 100644 (file)
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Analysis/BlockFrequencyInfo.h"
 
+namespace {
+using namespace llvm;
+std::vector<const BasicBlock *> findBBwithCalls(const Function &F,
+                                                bool IndirectCall = false) {
+  std::vector<const BasicBlock *> BBs;
+
+  auto findCallInst = [&IndirectCall](const Instruction &I) {
+    if (auto Call = dyn_cast<CallBase>(&I)) {
+      if (Call->isIndirectCall())
+        return IndirectCall;
+      else
+        return true;
+    } else
+      return false;
+  };
+  for (auto &BB : F)
+    if (findCallInst(*BB.getTerminator()) ||
+        llvm::any_of(BB.instructionsWithoutDebug(), findCallInst))
+      BBs.emplace_back(&BB);
+
+  return BBs;
+}
+} // namespace
+
 // Implementations of Queries shouldn't need to lock the resources
 // such as LLVMContext, each argument (function) has a non-shared LLVMContext
 namespace llvm {