diff options
-rw-r--r-- | llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h | 24 | ||||
-rw-r--r-- | llvm/lib/ExecutionEngine/Orc/SpeculateAnalyses.cpp | 24 |
2 files changed, 24 insertions, 24 deletions
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h b/llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h index 6f7a784a8f8..2652bff72a6 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/SpeculateAnalyses.h @@ -18,30 +18,6 @@ #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 { diff --git a/llvm/lib/ExecutionEngine/Orc/SpeculateAnalyses.cpp b/llvm/lib/ExecutionEngine/Orc/SpeculateAnalyses.cpp index 9d8c2f331de..52e9919f57c 100644 --- a/llvm/lib/ExecutionEngine/Orc/SpeculateAnalyses.cpp +++ b/llvm/lib/ExecutionEngine/Orc/SpeculateAnalyses.cpp @@ -12,6 +12,30 @@ #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 { |