[clang] [llvm] Replace autoconversion with TextEncodingConverter converters (PR #206519)

Corentin Jabot via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 15 03:22:29 PDT 2026


================
@@ -610,8 +610,10 @@ static bool ParseDirective(StringRef S, ExpectedData *ED, SourceManager &SM,
           }
 
           FileID FID = SM.translateFile(*File);
+          // FIXME: Figure out character-encoding converter treatment.
           if (FID.isInvalid())
-            FID = SM.createFileID(*File, Pos, SrcMgr::C_User);
+            FID = SM.createFileID(*File, Pos, SrcMgr::C_User,
+                                  /*InputEncodingName=*/{});
----------------
cor3ntin wrote:

That should use the input encoding.
However, you should consider that all clang own test files are utf8-ended and should not be converted.
So you might want to modify lit to force utf-8 for test files (of anything compiled with clang),
or document that if there is no tag set for the entiere llvm source tree, nothing will be expected to work.

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


More information about the cfe-commits mailing list