@@ -1144,7 +1144,7 @@ bool ConverterRefCount::VisitBinaryOperator(clang::BinaryOperator *expr) {
11441144 auto *rhs = expr->getRHS ();
11451145 auto lhs_type = lhs->getType ();
11461146 auto rhs_type = rhs->getType ();
1147- std::string opcode_as_string = expr->getOpcodeStr (). str ();
1147+ std::string_view opcode_as_string = expr->getOpcodeStr ();
11481148
11491149 if (auto *assign = llvm::dyn_cast<clang::CompoundAssignOperator>(expr);
11501150 assign && lhs_type != assign->getComputationResultType ()) {
@@ -1165,7 +1165,9 @@ bool ConverterRefCount::VisitBinaryOperator(clang::BinaryOperator *expr) {
11651165 StrCat (ConvertRValue (lhs));
11661166 ConvertCast (computation_result_type);
11671167 }
1168- StrCat (std::regex_replace (opcode_as_string, std::regex (" =" ), " " ));
1168+ std::string op (opcode_as_string);
1169+ op.erase (std::remove (op.begin (), op.end (), ' =' ), op.end ());
1170+ StrCat (op);
11691171 Convert (rhs);
11701172 }
11711173 if (lhs_type->isBooleanType ()) {
@@ -1805,7 +1807,7 @@ bool ConverterRefCount::ConvertCXXOperatorCallExpr(
18051807 clang::CXXOperatorCallExpr *expr) {
18061808 switch (expr->getOperator ()) {
18071809 case clang::OverloadedOperatorKind::OO_Equal:
1808- ConvertAssignment (expr->getArg (0 ), expr->getArg (1 ), token:: kAssign );
1810+ ConvertAssignment (expr->getArg (0 ), expr->getArg (1 ), " = " );
18091811 break ;
18101812
18111813 case clang::OverloadedOperatorKind::OO_Arrow:
0 commit comments