File tree Expand file tree Collapse file tree 2 files changed +24
-24
lines changed
include/llvm/ExecutionEngine/Orc Expand file tree Collapse file tree 2 files changed +24
-24
lines changed Original file line number Diff line number Diff line change 18
18
19
19
#include < vector>
20
20
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
-
45
21
namespace llvm {
46
22
47
23
namespace orc {
Original file line number Diff line number Diff line change 12
12
#include " llvm/ADT/SmallVector.h"
13
13
#include " llvm/Analysis/BlockFrequencyInfo.h"
14
14
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
+
15
39
// Implementations of Queries shouldn't need to lock the resources
16
40
// such as LLVMContext, each argument (function) has a non-shared LLVMContext
17
41
namespace llvm {
You can’t perform that action at this time.
0 commit comments