Skip to content

Commit 4acb4ee

Browse files
committed
Move findBBwithCalls to the file it's used in to avoid unused function
warnings. llvm-svn: 368636
1 parent b2cff5e commit 4acb4ee

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,6 @@
1818

1919
#include <vector>
2020

21-
namespace {
22-
using namespace llvm;
23-
std::vector<const BasicBlock *> findBBwithCalls(const Function &F,
24-
bool IndirectCall = false) {
25-
std::vector<const BasicBlock *> BBs;
26-
27-
auto findCallInst = [&IndirectCall](const Instruction &I) {
28-
if (auto Call = dyn_cast<CallBase>(&I)) {
29-
if (Call->isIndirectCall())
30-
return IndirectCall;
31-
else
32-
return true;
33-
} else
34-
return false;
35-
};
36-
for (auto &BB : F)
37-
if (findCallInst(*BB.getTerminator()) ||
38-
llvm::any_of(BB.instructionsWithoutDebug(), findCallInst))
39-
BBs.emplace_back(&BB);
40-
41-
return BBs;
42-
}
43-
} // namespace
44-
4521
namespace llvm {
4622

4723
namespace orc {

llvm/lib/ExecutionEngine/Orc/SpeculateAnalyses.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,30 @@
1212
#include "llvm/ADT/SmallVector.h"
1313
#include "llvm/Analysis/BlockFrequencyInfo.h"
1414

15+
namespace {
16+
using namespace llvm;
17+
std::vector<const BasicBlock *> findBBwithCalls(const Function &F,
18+
bool IndirectCall = false) {
19+
std::vector<const BasicBlock *> BBs;
20+
21+
auto findCallInst = [&IndirectCall](const Instruction &I) {
22+
if (auto Call = dyn_cast<CallBase>(&I)) {
23+
if (Call->isIndirectCall())
24+
return IndirectCall;
25+
else
26+
return true;
27+
} else
28+
return false;
29+
};
30+
for (auto &BB : F)
31+
if (findCallInst(*BB.getTerminator()) ||
32+
llvm::any_of(BB.instructionsWithoutDebug(), findCallInst))
33+
BBs.emplace_back(&BB);
34+
35+
return BBs;
36+
}
37+
} // namespace
38+
1539
// Implementations of Queries shouldn't need to lock the resources
1640
// such as LLVMContext, each argument (function) has a non-shared LLVMContext
1741
namespace llvm {

0 commit comments

Comments
 (0)