summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/IR/BasicBlock.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp
index 938c40182b9..c103de4fa34 100644
--- a/llvm/lib/IR/BasicBlock.cpp
+++ b/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());
}
OpenPOWER on IntegriCloud