[clang] [Clang] Do not emit 'wchar' module flag for OpenCL (PR #174454)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 1 00:58:23 PST 2026


================
@@ -1164,7 +1164,8 @@ void CodeGenModule::Release() {
   // TargetLibraryInfo.
   uint64_t WCharWidth =
       Context.getTypeSizeInChars(Context.getWideCharType()).getQuantity();
-  getModule().addModuleFlag(llvm::Module::Error, "wchar_size", WCharWidth);
+  if (!LangOpts.OpenCL)
----------------
arsenm wrote:

Isn't this only relevant if some flag was set? I would hope TargetLibraryInfo knows the real size from the triple and this flag would only be needed in abnormal cases 

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


More information about the cfe-commits mailing list