================
@@ -134,6 +140,19 @@ class TextEncodingConverter {
return std::string(Result);
return EC;
}
+
+ /// Returns true if this converter performs no conversion.
+ bool isNoop() const { return Converter->isNoop(); }
+
+ // This method is used in format string handling and is only intended
+ // to support basic charsets, not multibyte characters.
----------------
s-barannikov wrote:
`std::optional<char>` would do, I don't think we need the error code in places
where this function is used (currently).
But there are so many uses, some inside `switch`es. An invaild return value
(like the suggested 0x80) should work equally well with less code churn. 0x00
also works, but requires care as I tried to outline.
https://github.com/llvm/llvm-project/pull/196568
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits