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

Sergei Barannikov via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 30 07:51:15 PDT 2026


================
@@ -513,6 +513,10 @@ class Triple {
   /// For example, "fooos1.2.3" would return "1.2.3".
   LLVM_ABI StringRef getEnvironmentVersionString() const;
 
+  /// Get the default system encoding of the triple.
+  /// For example, "IBM-1047" for z/OS, "UTF-8" for others
+  LLVM_ABI StringRef getDefaultNarrowTextEncoding() const;
+
----------------
s-barannikov wrote:

Why is this in Triple and not in e.g., clang::TargetInfo?
I'm not sure Triple is the correct place for this method because it only specifies the default, and not the actual encoding used in compilation. This makes it useless for middle end / LTO. If we need the effective encoding in the middle end (I think we do since SimplifyLibCalls relies on specific values for certain code points), clang should put the effective encoding in module's metadata.


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


More information about the cfe-commits mailing list