We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 20ee8df commit b5657a8Copy full SHA for b5657a8
src/goto-programs/goto_program.h
@@ -588,6 +588,23 @@ class goto_programt
588
return t;
589
}
590
591
+ optionalt<const_targett> get_target(const unsigned location_number) const
592
+ {
593
+ PRECONDITION(!instructions.empty());
594
+
595
+ const unsigned start_location_number = instructions.front().location_number;
596
597
+ if(
598
+ location_number < start_location_number ||
599
+ location_number > instructions.back().location_number)
600
601
+ return nullopt;
602
+ }
603
604
+ return std::next(
605
+ instructions.begin(), location_number - start_location_number);
606
607
608
template <typename Target>
609
std::list<Target> get_successors(Target target) const;
610
0 commit comments