|
9 | 9 | #include <llvm/Support/ConvertUTF.h> |
10 | 10 |
|
11 | 11 | #include <format> |
12 | | -#include <regex> |
13 | 12 |
|
14 | 13 | #include "compiler.h" |
15 | 14 | #include "converter/converter_lib.h" |
@@ -381,7 +380,7 @@ bool Converter::ConvertVarDeclSkipInit(clang::VarDecl *decl) { |
381 | 380 | } |
382 | 381 |
|
383 | 382 | if (decl->isFileVarDecl()) { |
384 | | - name = std::regex_replace(Mapper::ToString(decl), std::regex("::"), "_"); |
| 383 | + name = ReplaceAll(Mapper::ToString(decl), "::", "_"); |
385 | 384 | if ((decl->isExternallyDeclarable() && !decl->hasInit()) || |
386 | 385 | !globals_.insert(name).second) { |
387 | 386 | return false; |
@@ -2139,8 +2138,7 @@ std::string Converter::ConvertDeclRefExpr(clang::DeclRefExpr *expr) { |
2139 | 2138 | enum_constant->getDeclContext())), |
2140 | 2139 | enum_constant->getName().str()); |
2141 | 2140 | } else if (IsGlobalVar(expr)) { |
2142 | | - return std::regex_replace(Mapper::ToString(expr->getDecl()), |
2143 | | - std::regex("::"), "_"); |
| 2141 | + return ReplaceAll(Mapper::ToString(expr->getDecl()), "::", "_"); |
2144 | 2142 | } |
2145 | 2143 |
|
2146 | 2144 | return GetNamedDeclAsString(decl); |
@@ -2888,7 +2886,7 @@ std::string Converter::GetRecordName(const clang::NamedDecl *decl) const { |
2888 | 2886 | if (auto it = inner_structs_.find(ID); it != inner_structs_.end()) { |
2889 | 2887 | return it->second; |
2890 | 2888 | } |
2891 | | - return std::regex_replace(Mapper::ToString(decl), std::regex("::"), "_"); |
| 2889 | + return ReplaceAll(Mapper::ToString(decl), "::", "_"); |
2892 | 2890 | } |
2893 | 2891 |
|
2894 | 2892 | std::vector<const char *> |
|
0 commit comments