@@ -28,44 +28,45 @@ static compat::RegisterCodeDealloc register_dealloc(on_dealloc);
2828
2929// Used for regions, that have an identifier, aka a code object id. (instrumenter regions and
3030// some decorated regions)
31- void region_begin (std::string_view function_name, std::string_view module ,
32- const std::string& file_name, const std::uint64_t line_number,
33- compat::PyCodeObject* identifier)
31+ void region_begin (std::string_view function_name, std::string module , std::string file_name,
32+ const std::uint64_t line_number, compat::PyCodeObject* identifier)
3433{
3534 region_handle& region = regions[identifier];
3635
3736 if (region == uninitialised_region_handle)
3837 {
39- const auto region_name = make_region_name (module , function_name);
38+ const auto region_name = make_region_name (std::move ( module ) , function_name);
4039 SCOREP_User_RegionInit (®ion.value , NULL , NULL , region_name.c_str (),
4140 SCOREP_USER_REGION_TYPE_FUNCTION, file_name.c_str (), line_number);
4241
43- SCOREP_User_RegionSetGroup (region.value , std::string (module , 0 , module .find (' .' )).c_str ());
42+ SCOREP_User_RegionSetGroup (region.value ,
43+ std::string (region_name, 0 , region_name.find (' .' )).c_str ());
4444 }
4545 SCOREP_User_RegionEnter (region.value );
4646}
4747
4848// Used for regions, that only have a function name, a module, a file and a line number (user
4949// regions)
50- void region_begin (std::string_view function_name, std::string_view module ,
51- const std::string& file_name, const std:: uint64_t line_number)
50+ void region_begin (std::string_view function_name, std::string module , std::string file_name ,
51+ const std::uint64_t line_number)
5252{
53- const auto region_name = make_region_name (module , function_name);
53+ const auto region_name = make_region_name (std::move ( module ) , function_name);
5454 region_handle& region = user_regions[region_name];
5555
5656 if (region == uninitialised_region_handle)
5757 {
5858 SCOREP_User_RegionInit (®ion.value , NULL , NULL , region_name.c_str (),
5959 SCOREP_USER_REGION_TYPE_FUNCTION, file_name.c_str (), line_number);
6060
61- SCOREP_User_RegionSetGroup (region.value , std::string (module , 0 , module .find (' .' )).c_str ());
61+ SCOREP_User_RegionSetGroup (region.value ,
62+ std::string (region_name, 0 , region_name.find (' .' )).c_str ());
6263 }
6364 SCOREP_User_RegionEnter (region.value );
6465}
6566
6667// Used for regions, that have an identifier, aka a code object id. (instrumenter regions and
6768// some decorated regions)
68- void region_end (std::string_view function_name, std::string_view module ,
69+ void region_end (std::string_view function_name, std::string module ,
6970 compat::PyCodeObject* identifier)
7071{
7172 const auto it_region = regions.find (identifier);
@@ -75,27 +76,27 @@ void region_end(std::string_view function_name, std::string_view module,
7576 }
7677 else
7778 {
78- const auto region_name = make_region_name (module , function_name);
79- region_end_error_handling (region_name);
79+ const auto region_name = make_region_name (std::move ( module ) , function_name);
80+ region_end_error_handling (std::move ( region_name) );
8081 }
8182}
8283
8384// Used for regions, that only have a function name, a module (user regions)
84- void region_end (std::string_view function_name, std::string_view module )
85+ void region_end (std::string_view function_name, std::string module )
8586{
86- const auto region_name = make_region_name (module , function_name);
87+ const auto region_name = make_region_name (std::move ( module ) , function_name);
8788 auto it_region = user_regions.find (region_name);
8889 if (it_region != user_regions.end ())
8990 {
9091 SCOREP_User_RegionEnd (it_region->second .value );
9192 }
9293 else
9394 {
94- region_end_error_handling (region_name);
95+ region_end_error_handling (std::move ( region_name) );
9596 }
9697}
9798
98- void region_end_error_handling (const std::string& region_name)
99+ void region_end_error_handling (std::string region_name)
99100{
100101 static region_handle error_region;
101102 static SCOREP_User_ParameterHandle scorep_param = SCOREP_USER_INVALID_PARAMETER;
0 commit comments