[llvm-branch-commits] [clang] [llvm] Enable fexec-charset option (PR #138895)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon May 12 00:42:46 PDT 2025


================
@@ -367,6 +370,15 @@ static unsigned ProcessCharEscape(const char *ThisTokBegin,
     HadError = true;
   }
 
+  if (Translate && Converter) {
+    // Invalid escapes are written as '?' and then translated.
+    char ByteChar = Invalid ? '?' : ResultChar;
+    SmallString<8> ResultCharConv;
+    Converter->convert(StringRef(&ByteChar, 1), ResultCharConv);
+    assert(ResultCharConv.size() == 1 &&
+           "Char size increased after translation");
----------------
cor3ntin wrote:

Can we have a `GetReplacementChar` function... somewhere, and cache the result?

https://github.com/llvm/llvm-project/pull/138895


More information about the llvm-branch-commits mailing list