Skip to content

Commit 92793ca

Browse files
Petr BauchPetr Bauch
Petr Bauch
authored and
Petr Bauch
committed
slicer: add function slicer criterion
This criterion marks all instructions of a given function as slicer starting point. This is useful when the slicing does not aim at properties, but path that hit a certain function.
1 parent 01a348c commit 92793ca

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/goto-instrument/full_slicer_class.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,23 @@ class assert_criteriont:public slicing_criteriont
113113
}
114114
};
115115

116+
class in_function_criteriont : public slicing_criteriont
117+
{
118+
public:
119+
explicit in_function_criteriont(const std::string &function_name)
120+
: target_function(function_name)
121+
{
122+
}
123+
124+
virtual bool operator()(goto_programt::const_targett target)
125+
{
126+
return target->function == target_function;
127+
}
128+
129+
protected:
130+
const irep_idt target_function;
131+
};
132+
116133
class properties_criteriont:public slicing_criteriont
117134
{
118135
public:

0 commit comments

Comments
 (0)