File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,18 @@ class basic_blockst
100
100
}
101
101
};
102
102
103
+ bool coverage_goalst::is_existing_goal (source_locationt source_location)
104
+ {
105
+ std::vector<std::string>::iterator it;
106
+ it = find (existing_goals.begin (), existing_goals.end (),
107
+ source_location.get_line ().c_str ());
108
+
109
+ if (it == existing_goals.end ())
110
+ return true ;
111
+ else
112
+ return false ;
113
+ }
114
+
103
115
const char *as_string (coverage_criteriont c)
104
116
{
105
117
switch (c)
@@ -934,7 +946,7 @@ void instrument_cover_goals(
934
946
basic_blocks.source_location_map [block_nr];
935
947
936
948
// check whether the current goal already exists
937
- if (goals.is_existing_goal (source_location. get_line (). c_str () ) &&
949
+ if (goals.is_existing_goal (source_location) &&
938
950
!source_location.get_file ().empty () &&
939
951
!source_location.is_built_in ())
940
952
{
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class coverage_goalst
23
23
{
24
24
public:
25
25
void set_goals (std::string goal);
26
- bool is_existing_goal (const char * goal );
26
+ bool is_existing_goal (source_locationt source_location );
27
27
28
28
private:
29
29
std::vector<std::string> existing_goals;
You can’t perform that action at this time.
0 commit comments