summaryrefslogtreecommitdiff
path: root/src/trans/mangling.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/trans/mangling.cpp')
-rw-r--r--src/trans/mangling.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/trans/mangling.cpp b/src/trans/mangling.cpp
index 741d13dd..5d7584ed 100644
--- a/src/trans/mangling.cpp
+++ b/src/trans/mangling.cpp
@@ -22,18 +22,27 @@
#include <hir/path.hpp>
namespace {
- ::std::string escape_str(const ::std::string& s) {
+ ::std::string escape_str(const char* s, size_t len) {
::std::string output;
- output.reserve(s.size() + 1);
- for(auto v : s)
+ output.reserve(len + 1);
+ for(auto vp = s; vp != s + len; vp ++)
+ {
+ auto v= *vp;
if( v == '#' )
output += "$H";
else if( v == '-' )
output += "_";
else
output += v;
+ }
return output;
}
+ ::std::string escape_str(const RcString& s) {
+ return escape_str(s.c_str(), s.size());
+ }
+ ::std::string escape_str(const ::std::string& s) {
+ return escape_str(s.c_str(), s.size());
+ }
::FmtLambda emit_params(const ::HIR::PathParams& params)
{
return FMT_CB(ss,