diff options
| author | 2019-01-27 16:42:12 +0000 | |
|---|---|---|
| committer | 2019-01-27 16:42:12 +0000 | |
| commit | b773203fb58f3ef282fb69c832d8710cab5bc82d (patch) | |
| tree | e75913f147570fbd75169647b144df85b88a038c /gnu/llvm/lib/IR/BasicBlock.cpp | |
| parent | tweak errno in previous (diff) | |
| download | wireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.tar.xz wireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.zip | |
Import LLVM 7.0.1 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/lib/IR/BasicBlock.cpp')
| -rw-r--r-- | gnu/llvm/lib/IR/BasicBlock.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gnu/llvm/lib/IR/BasicBlock.cpp b/gnu/llvm/lib/IR/BasicBlock.cpp index 938c40182b9..7c3e5862d1c 100644 --- a/gnu/llvm/lib/IR/BasicBlock.cpp +++ b/gnu/llvm/lib/IR/BasicBlock.cpp @@ -90,6 +90,24 @@ void BasicBlock::setParent(Function *parent) { InstList.setSymTabObject(&Parent, parent); } +iterator_range<filter_iterator<BasicBlock::const_iterator, + std::function<bool(const Instruction &)>>> +BasicBlock::instructionsWithoutDebug() const { + std::function<bool(const Instruction &)> Fn = [](const Instruction &I) { + return !isa<DbgInfoIntrinsic>(I); + }; + return make_filter_range(*this, Fn); +} + +iterator_range<filter_iterator<BasicBlock::iterator, + std::function<bool(Instruction &)>>> +BasicBlock::instructionsWithoutDebug() { + std::function<bool(Instruction &)> Fn = [](Instruction &I) { + return !isa<DbgInfoIntrinsic>(I); + }; + return make_filter_range(*this, Fn); +} + void BasicBlock::removeFromParent() { getParent()->getBasicBlockList().remove(getIterator()); } @@ -461,3 +479,9 @@ Optional<uint64_t> BasicBlock::getIrrLoopHeaderWeight() const { } return Optional<uint64_t>(); } + +BasicBlock::iterator llvm::skipDebugIntrinsics(BasicBlock::iterator It) { + while (isa<DbgInfoIntrinsic>(It)) + ++It; + return It; +} |
