Skip to content

Commit a19f027

Browse files
committed
Introduce global constant for file local prefix in the mangler
1 parent 069db73 commit a19f027

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/goto-programs/name_mangler.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ operator()(const symbolt &src, const std::string &extra_info)
1919
std::string basename = get_base_name(src.location.get_file().c_str(), false);
2020

2121
std::stringstream ss;
22-
ss << CPROVER_PREFIX << "file_local_";
22+
ss << FILE_LOCAL_PREFIX;
2323
ss << std::regex_replace(
2424
std::regex_replace(basename, forbidden, "_"), multi_under, "_")
2525
<< "_";
@@ -42,7 +42,7 @@ operator()(const symbolt &src, const std::string &extra_info)
4242
uint32_t eight_nibble_hash = (uint32_t)hash;
4343

4444
std::stringstream ss;
45-
ss << CPROVER_PREFIX << "file_local_" << std::setfill('0') << std::setw(8)
46-
<< std::hex << eight_nibble_hash << "_" << extra_info << "_" << src.name;
45+
ss << FILE_LOCAL_PREFIX << std::setfill('0') << std::setw(8) << std::hex
46+
<< eight_nibble_hash << "_" << extra_info << "_" << src.name;
4747
return irep_idt(ss.str());
4848
}

src/goto-programs/name_mangler.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#include <regex>
1414
#include <vector>
1515

16+
#define FILE_LOCAL_PREFIX CPROVER_PREFIX "file_local_"
17+
1618
/// \brief Mangles the names in an entire program and its symbol table
1719
///
1820
/// The type parameter to this class should be a functor that has a no-arg

0 commit comments

Comments
 (0)