[clang] d4f0f17 - [z/OS] Disable pr59765-modules-global-ctor-dtor.cppm on z/OS to make it unsupported.

2023-06-01 Thread Zibi Sarbinowski via cfe-commits

Author: Zibi Sarbinowski
Date: 2023-06-01T08:44:30-05:00
New Revision: d4f0f171d7f890abe913023e4439018fd74aa175

URL: 
https://github.com/llvm/llvm-project/commit/d4f0f171d7f890abe913023e4439018fd74aa175
DIFF: 
https://github.com/llvm/llvm-project/commit/d4f0f171d7f890abe913023e4439018fd74aa175.diff

LOG: [z/OS] Disable pr59765-modules-global-ctor-dtor.cppm on z/OS to make it 
unsupported.

[z/OS] Disable pr59765-modules-global-ctor-dtor.cppm

Reviewed By: SeanP

Differential Revision: https://reviews.llvm.org/D151828

Added: 


Modified: 
clang/test/CodeGenCXX/pr59765-modules-global-ctor-dtor.cppm

Removed: 




diff  --git a/clang/test/CodeGenCXX/pr59765-modules-global-ctor-dtor.cppm 
b/clang/test/CodeGenCXX/pr59765-modules-global-ctor-dtor.cppm
index 1a9384bf0bc9a..9956348f87ff4 100644
--- a/clang/test/CodeGenCXX/pr59765-modules-global-ctor-dtor.cppm
+++ b/clang/test/CodeGenCXX/pr59765-modules-global-ctor-dtor.cppm
@@ -1,9 +1,9 @@
 // https://github.com/llvm/llvm-project/issues/59765
 // FIXME: Since the signature of the constructors/destructors is
 // 
diff erent in 
diff erent targets. The current CHECK can't work
-// well when targeting or running on AIX.
+// well when targeting or running on AIX and z/OS.
 // It would be better to add the corresponding test for other test.
-// UNSUPPORTED: system-aix
+// UNSUPPORTED: system-zos, system-aix
 //
 // RUN: rm -rf %t
 // RUN: mkdir %t



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 4a27ddd - Remove 3-byte characters causing clang-tblgen to get I/O error.

2023-06-05 Thread Zibi Sarbinowski via cfe-commits

Author: Zibi Sarbinowski
Date: 2023-06-05T07:58:16-05:00
New Revision: 4a27ddd423337bb1088bd997d33a1f0f49f1ead4

URL: 
https://github.com/llvm/llvm-project/commit/4a27ddd423337bb1088bd997d33a1f0f49f1ead4
DIFF: 
https://github.com/llvm/llvm-project/commit/4a27ddd423337bb1088bd997d33a1f0f49f1ead4.diff

LOG: Remove 3-byte characters causing clang-tblgen to get I/O error.

[SystemZ} This revision fixes the following error caused by 
301eb6b68f30074ee3a90e2dfbd11dfd87076323.
LLVM ERROR: IO failure on output stream: EDC5122I Input/output error.

The characters seems to be 3-byte characters which cause the failure with auto 
conversion from EBCDIC to ASCII.
Credit to @Kai who found this issue.

Reviewed By: abhina.sreeskantharajan

Differential Revision: https://reviews.llvm.org/D152016

Added: 


Modified: 
clang/include/clang/Basic/AttrDocs.td

Removed: 




diff  --git a/clang/include/clang/Basic/AttrDocs.td 
b/clang/include/clang/Basic/AttrDocs.td
index e3d83234b316a..1c4198cc8d547 100644
--- a/clang/include/clang/Basic/AttrDocs.td
+++ b/clang/include/clang/Basic/AttrDocs.td
@@ -6559,7 +6559,7 @@ def ArmStreamingDocs : Documentation {
 
 The ``__arm_streaming`` keyword is only available on AArch64 targets.
 It applies to function types and specifies that the function has a
-“streaming interface”.  This means that:
+"streaming interface".  This means that:
 
 * the function requires the Scalable Matrix Extension (SME)
 
@@ -6578,7 +6578,7 @@ function calls an ``__arm_streaming`` function, Clang 
generates code
 that switches into streaming mode before calling the function and
 switches back to non-streaming mode on return.
 
-``__arm_streaming`` can appear anywhere that a standard ``[[…]]`` type
+``__arm_streaming`` can appear anywhere that a standard ``[[...]]`` type
 attribute can appear.
 
 See `Arm C Language Extensions `_



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [SystemZ][z/OS] __ptr32 support for z/OS in Clang (PR #96063)

2024-06-19 Thread Zibi Sarbinowski via cfe-commits


@@ -107,12 +107,14 @@ namespace {
 KEYMSCOMPAT   = 0x40,
 KEYSYCL   = 0x80,
 KEYCUDA   = 0x100,
-KEYHLSL   = 0x200,
-KEYFIXEDPOINT = 0x400,
+KEYZOS= 0x200,
+KEYNOZOS  = 0x400,
+KEYHLSL   = 0x800,
+KEYFIXEDPOINT = 0x1000,
 KEYMAX= KEYFIXEDPOINT, // The maximum key
 KEYALLCXX = KEYCXX | KEYCXX11 | KEYCXX20,
-KEYALL = (KEYMAX | (KEYMAX-1)) & ~KEYNOMS18 &
- ~KEYNOOPENCL // KEYNOMS18 and KEYNOOPENCL are used to exclude.
+KEYALL = (KEYMAX | (KEYMAX-1)) & ~KEYNOMS18 & ~KEYNOOPENCL &
+ ~KEYNOZOS // KEYNOMS18, KEYNOOPENCL, KEYNOZOS are used to exclude.

zibi2 wrote:

```suggestion
 ~KEYNOZOS // KEYNOMS18, KEYNOOPENCL, KEYNOZOS are excluded.
```

https://github.com/llvm/llvm-project/pull/96063
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [SystemZ][z/OS] __ptr32 support for z/OS in Clang (PR #96063)

2024-06-19 Thread Zibi Sarbinowski via cfe-commits


@@ -224,6 +252,19 @@ class LLVM_LIBRARY_VISIBILITY SystemZTargetInfo : public 
TargetInfo {
   std::pair hardwareInterferenceSizes() const override {
 return std::make_pair(256, 256);
   }
+
+  uint64_t getPointerWidthV(LangAS AddrSpace) const override {
+unsigned TargetAddrSpace = getTargetAddressSpace(AddrSpace);
+return (TargetAddrSpace == ptr32 && getTriple().isOSzOS() &&
+getTriple().isArch64Bit())

zibi2 wrote:

```suggestion
return (getTriple().isOSzOS() && getTriple().isArch64Bit() &&
getTargetAddressSpace(AddrSpace) == ptr32)
```

https://github.com/llvm/llvm-project/pull/96063
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [SystemZ][z/OS] __ptr32 support for z/OS in Clang (PR #96063)

2024-06-19 Thread Zibi Sarbinowski via cfe-commits


@@ -3567,6 +3567,14 @@ void CompilerInvocationBase::GenerateLangArgs(const 
LangOptions &Opts,
   GenerateArg(Consumer, OPT_ftrigraphs);
   }
 
+  if (T.isOSzOS()) {
+if (!Opts.ZOSExt)
+  GenerateArg(Consumer, OPT_fno_zos_extensions);

zibi2 wrote:

I assume the default is -fno-zos-extensions, can you check why we need to 
explicitly pass this option?

https://github.com/llvm/llvm-project/pull/96063
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [SystemZ][z/OS] __ptr32 support for z/OS in Clang (PR #96063)

2024-06-19 Thread Zibi Sarbinowski via cfe-commits


@@ -7097,10 +7098,14 @@ static bool 
handleMSPointerTypeQualifierAttr(TypeProcessingState &State,
 else if (Attrs[attr::UPtr])
   ASIdx = LangAS::ptr32_uptr;
   } else if (PtrWidth == 64 && Attrs[attr::Ptr32]) {
-if (Attrs[attr::UPtr])
+if (Triple.isOSzOS()) {
   ASIdx = LangAS::ptr32_uptr;
-else
-  ASIdx = LangAS::ptr32_sptr;
+} else {
+  if (Attrs[attr::UPtr])
+ASIdx = LangAS::ptr32_uptr;
+  else
+ASIdx = LangAS::ptr32_sptr;
+}

zibi2 wrote:

I assume this block can be simplifed

https://github.com/llvm/llvm-project/pull/96063
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [SystemZ][z/OS] __ptr32 support for z/OS in Clang (PR #96063)

2024-06-19 Thread Zibi Sarbinowski via cfe-commits


@@ -59,6 +59,14 @@ static std::string computeDataLayout(const Triple &TT) {
   // Data mangling.
   Ret += DataLayout::getManglingComponent(TT);
 
+  // Special features for z/OS.
+  if (TT.isOSzOS()) {
+if (TT.isArch64Bit()) {

zibi2 wrote:

You can collapse these 2 `if` statements into one.

https://github.com/llvm/llvm-project/pull/96063
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [NFC] Format TokenKey enum (PR #101700)

2024-08-02 Thread Zibi Sarbinowski via cfe-commits

https://github.com/zibi2 approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/101700
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [SystemZ][z/OS] __ptr32 support for z/OS (PR #101696)

2024-08-07 Thread Zibi Sarbinowski via cfe-commits


@@ -0,0 +1,119 @@
+// RUN: %clang_cc1 -triple s390x-ibm-zos %s -fsyntax-only -fzos-extensions 
-verify

zibi2 wrote:

We should also test the default `-fzos-extensions` by not explicitly specifying 
it.

https://github.com/llvm/llvm-project/pull/101696
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [SystemZ][z/OS] __ptr32 support for z/OS (PR #101696)

2024-08-07 Thread Zibi Sarbinowski via cfe-commits


@@ -211,6 +215,9 @@ static KeywordStatus getKeywordStatusHelper(const 
LangOptions &LangOpts,
   case KEYNOMS18:
 // The disable behavior for this is handled in getKeywordStatus.
 return KS_Unknown;
+  case KEYNOZOS:
+// The disable behavior for this is handled in getKeywordStatus.
+return KS_Unknown;

zibi2 wrote:

We should be combined this with the above case.

https://github.com/llvm/llvm-project/pull/101696
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [SystemZ][z/OS] __ptr32 support for z/OS (PR #101696)

2024-08-07 Thread Zibi Sarbinowski via cfe-commits


@@ -3650,6 +3650,14 @@ void CompilerInvocationBase::GenerateLangArgs(const 
LangOptions &Opts,
   GenerateArg(Consumer, OPT_ftrigraphs);
   }
 
+  if (T.isOSzOS()) {
+if (!Opts.ZOSExt)
+  GenerateArg(Consumer, OPT_fno_zos_extensions);
+  } else {
+if (Opts.ZOSExt)
+  GenerateArg(Consumer, OPT_fzos_extensions);
+  }

zibi2 wrote:

I think this can be simplified since zos-extensions are on by default on z/OS. 

https://github.com/llvm/llvm-project/pull/101696
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [SystemZ][z/OS] __ptr32 support for z/OS (PR #101696)

2024-08-07 Thread Zibi Sarbinowski via cfe-commits

https://github.com/zibi2 edited https://github.com/llvm/llvm-project/pull/101696
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [SystemZ][z/OS] __ptr32 support for z/OS (PR #101696)

2024-08-07 Thread Zibi Sarbinowski via cfe-commits

https://github.com/zibi2 approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/101696
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [SystemZ][z/OS] __ptr32 support for z/OS (PR #101696)

2024-08-07 Thread Zibi Sarbinowski via cfe-commits

https://github.com/zibi2 approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/101696
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [SystemZ][z/OS] fix ppc-xmmintrin.c on z/OS (PR #109676)

2024-09-23 Thread Zibi Sarbinowski via cfe-commits

https://github.com/zibi2 created 
https://github.com/llvm/llvm-project/pull/109676

This will fix the following failure seeing on z/OS:

```
In file included from clang/test/CodeGen/PowerPC/ppc-xmmintrin.c:31:
In file included from build/lib/clang/20/include/ppc_wrappers/xmmintrin.h:44:
In file included from build/lib/clang/20/include/altivec.h:48:
In file included from build/bin/../include/c++/v1/stddef.h:27:
In file included from build/bin/../include/c++/v1/__config:14:
In file included from build/bin/../include/c++/v1/__configuration/abi.h:15:
In file included from build/bin/../include/c++/v1/__configuration/platform.h:35:
/usr/include/features.h:1:20: error: expected unqualified-id
1 |??=if   ??/
  |^
/usr/include/features.h:2140:20: error: expected unqualified-id
 2140 |??=endif /* __features_h */
  |^
```
Adding `-nostdlibinc` will not use standard system include path and it will 
prevent above errors. 

>From 68165f06767a47b63eecb5aad7af01ec791a2e40 Mon Sep 17 00:00:00 2001
From: Zbigniew Sarbinowski 
Date: Mon, 23 Sep 2024 15:18:40 +
Subject: [PATCH] fix ppc-xmmintrin.c on z/OS

---
 clang/test/CodeGen/PowerPC/ppc-xmmintrin.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/test/CodeGen/PowerPC/ppc-xmmintrin.c 
b/clang/test/CodeGen/PowerPC/ppc-xmmintrin.c
index 4a15fa9f76ceea..8681bb3f9b4f8c 100644
--- a/clang/test/CodeGen/PowerPC/ppc-xmmintrin.c
+++ b/clang/test/CodeGen/PowerPC/ppc-xmmintrin.c
@@ -23,7 +23,7 @@
 
 // RUN: %clang -S -emit-llvm -target powerpc64-ibm-aix -mcpu=pwr8 
-ffreestanding -DNO_WARN_X86_INTRINSICS %s \
 // RUN:   -ffp-contract=off -fno-discard-value-names -mllvm 
-disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s 
--check-prefixes=CHECK,CHECK-BE
-// RUN: %clang -x c++ -fsyntax-only -target powerpc64-ibm-aix -mcpu=pwr8 
-ffreestanding -DNO_WARN_X86_INTRINSICS %s \
+// RUN: %clang -x c++ -fsyntax-only -target powerpc64-ibm-aix -mcpu=pwr8 
-ffreestanding -nostdlibinc -DNO_WARN_X86_INTRINSICS %s \
 // RUN:   -fno-discard-value-names -mllvm -disable-llvm-optzns
 // RUN: %clang -S -emit-llvm -target powerpc64-ibm-aix -mcpu=pwr10 
-ffreestanding -DNO_WARN_X86_INTRINSICS %s \
 // RUN:   -ffp-contract=off -fno-discard-value-names -mllvm 
-disable-llvm-optzns -o - | llvm-cxxfilt -n | FileCheck %s 
--check-prefixes=CHECK,CHECK-P10-BE

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [SystemZ][z/OS] fix ppc-xmmintrin.c on z/OS (PR #109676)

2024-10-01 Thread Zibi Sarbinowski via cfe-commits

https://github.com/zibi2 closed https://github.com/llvm/llvm-project/pull/109676
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [SystemZ][z/OS] Update autoconversion functions to improve support for UTF-8 (PR #98652)

2024-09-19 Thread Zibi Sarbinowski via cfe-commits


@@ -70,6 +70,11 @@ class FileEntryRef {
   const FileEntry &getFileEntry() const {
 return *getBaseMapEntry().second->V.get();
   }
+#ifdef __MVS__

zibi2 wrote:

I wonder if we can remove this conditional compilation guard and defined this 
non-const function unconditionally.

https://github.com/llvm/llvm-project/pull/98652
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [SystemZ][z/OS] Update autoconversion functions to improve support for UTF-8 (PR #98652)

2024-09-19 Thread Zibi Sarbinowski via cfe-commits


@@ -617,6 +625,23 @@ FileID SourceManager::createFileIDImpl(ContentCache &File, 
StringRef Filename,
 return FileID::get(LoadedID);
   }
   unsigned FileSize = File.getSize();
+#ifdef __MVS__
+  llvm::ErrorOr NeedConversion =
+  llvm::needzOSConversion(Filename.str().c_str());
+  if (NeedConversion && *NeedConversion) {
+// Buffer size may increase due to potential z/OS EBCDIC to UTF-8
+// conversion.
+if (std::optional Buffer =
+File.getBufferOrNone(Diag, getFileManager())) {
+  unsigned BufSize = Buffer->getBufferSize();
+  if (BufSize > FileSize) {
+if (File.ContentsEntry.has_value())
+  File.ContentsEntry->getFileEntry().setSize(BufSize);
+FileSize = BufSize;
+  }
+}
+  }
+#endif

zibi2 wrote:

Could you experiment with creating for z/OS a derived class from SourceManager 
so we can have this code bundle with member function which for base class will 
be empty and we will just call this new member function here?
This will minimized a lot of conditional directives. 

https://github.com/llvm/llvm-project/pull/98652
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lldb] [llvm] [SystemZ][z/OS] Propagate IsText parameter to open text files as text (PR #107906)

2024-09-19 Thread Zibi Sarbinowski via cfe-commits

https://github.com/zibi2 approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/107906
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [z/OS] Make sure __alignas_is_defined and __alignof_is_defined are defined on z/OS. (PR #115368)

2024-11-07 Thread Zibi Sarbinowski via cfe-commits

https://github.com/zibi2 created 
https://github.com/llvm/llvm-project/pull/115368

None

>From 34569fd0fbe6894d598d48e2088040ee730d308d Mon Sep 17 00:00:00 2001
From: Zbigniew Sarbinowski 
Date: Thu, 7 Nov 2024 20:27:52 +
Subject: [PATCH] Make sure __alignas_is_defined and __alignof_is_defined are
 defined on z/OS

---
 clang/lib/Headers/stdalign.h | 5 -
 1 file changed, 5 deletions(-)

diff --git a/clang/lib/Headers/stdalign.h b/clang/lib/Headers/stdalign.h
index 56cdfa52d4bafa..158508e65d2b34 100644
--- a/clang/lib/Headers/stdalign.h
+++ b/clang/lib/Headers/stdalign.h
@@ -10,10 +10,6 @@
 #ifndef __STDALIGN_H
 #define __STDALIGN_H
 
-#if defined(__MVS__) && __has_include_next()
-#include_next 
-#else
-
 #if defined(__cplusplus) ||
\
 (defined(__STDC_VERSION__) && __STDC_VERSION__ < 202311L)
 #ifndef __cplusplus
@@ -25,5 +21,4 @@
 #define __alignof_is_defined 1
 #endif /* __STDC_VERSION__ */
 
-#endif /* __MVS__ */
 #endif /* __STDALIGN_H */

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [z/OS] Make sure __alignas_is_defined and __alignof_is_defined are defined on z/OS. (PR #115368)

2024-11-08 Thread Zibi Sarbinowski via cfe-commits

https://github.com/zibi2 closed https://github.com/llvm/llvm-project/pull/115368
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [libcxx] [libc++] Rename `__` prefix to `__libcpp_` for locale related functions (PR #119241)

2024-12-09 Thread Zibi Sarbinowski via cfe-commits

https://github.com/zibi2 updated 
https://github.com/llvm/llvm-project/pull/119241

>From d3ee5e960bbf20286d726135423eb632ae45eafb Mon Sep 17 00:00:00 2001
From: Zbigniew Sarbinowski 
Date: Mon, 9 Dec 2024 18:17:47 +
Subject: [PATCH 1/2] Rename __ prefix to __libcpp_ for locale related
 functions to eliminate name collition with macors in system locale.h header

---
 clang/lib/Headers/CMakeLists.txt  |   1 +
 clang/lib/Headers/zos_wrappers/locale.h   |  19 +++
 libcxx/include/__locale_dir/locale_base_api.h | 119 +++
 .../__locale_dir/locale_base_api/ibm.h|  33 +
 libcxx/include/locale |   4 +-
 libcxx/src/locale.cpp | 140 +-
 6 files changed, 186 insertions(+), 130 deletions(-)
 create mode 100644 clang/lib/Headers/zos_wrappers/locale.h

diff --git a/clang/lib/Headers/CMakeLists.txt b/clang/lib/Headers/CMakeLists.txt
index 43124111b7ba5a..71f2ff268548d5 100644
--- a/clang/lib/Headers/CMakeLists.txt
+++ b/clang/lib/Headers/CMakeLists.txt
@@ -381,6 +381,7 @@ set(llvm_libc_wrapper_files
 
 set(zos_wrapper_files
   zos_wrappers/builtins.h
+  zos_wrappers/locale.h
 )
 
 include(GetClangResourceDir)
diff --git a/clang/lib/Headers/zos_wrappers/locale.h 
b/clang/lib/Headers/zos_wrappers/locale.h
new file mode 100644
index 00..1381f6d47ac097
--- /dev/null
+++ b/clang/lib/Headers/zos_wrappers/locale.h
@@ -0,0 +1,19 @@
+/*===- locale.h 
--===
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+ 
*===-===
+ */
+
+#ifndef __ZOS_WRAPPERS_LOCALE_H
+#define __ZOS_WRAPPERS_LOCALE_H
+  #if defined(__MVS__)
+#include_next 
+#ifdef __locale
+  #undef __locale
+  #define __locale __locale
+#endif
+  #endif /* defined(__MVS__) */
+#endif /* __ZOS_WRAPPERS_LOCALE_H */
diff --git a/libcxx/include/__locale_dir/locale_base_api.h 
b/libcxx/include/__locale_dir/locale_base_api.h
index 8ed4c29cb8732f..9bd3420b65fcf8 100644
--- a/libcxx/include/__locale_dir/locale_base_api.h
+++ b/libcxx/include/__locale_dir/locale_base_api.h
@@ -39,41 +39,41 @@
 // Strtonum functions
 // --
 // namespace __locale {
-//  float   __strtof(const char*, char**, __locale_t);
-//  double  __strtod(const char*, char**, __locale_t);
-//  long double __strtold(const char*, char**, __locale_t);
-//  long long   __strtoll(const char*, char**, __locale_t);
-//  unsigned long long  __strtoull(const char*, char**, __locale_t);
+//  float   __libcpp_strtof(const char*, char**, __locale_t);
+//  double  __libcpp_strtod(const char*, char**, __locale_t);
+//  long double __libcpp_strtold(const char*, char**, __locale_t);
+//  long long   __libcpp_strtoll(const char*, char**, __locale_t);
+//  unsigned long long  __libcpp_strtoull(const char*, char**, __locale_t);
 // }
 //
 // Character manipulation functions
 // 
 // namespace __locale {
-//  int __islower(int, __locale_t);
-//  int __isupper(int, __locale_t);
-//  int __isdigit(int, __locale_t);
-//  int __isxdigit(int, __locale_t);
-//  int __toupper(int, __locale_t);
-//  int __tolower(int, __locale_t);
-//  int __strcoll(const char*, const char*, __locale_t);
-//  size_t  __strxfrm(char*, const char*, size_t, __locale_t);
+//  int __libcpp_islower(int, __locale_t);
+//  int __libcpp_isupper(int, __locale_t);
+//  int __libcpp_isdigit(int, __locale_t);
+//  int __libcpp_isxdigit(int, __locale_t);
+//  int __libcpp_toupper(int, __locale_t);
+//  int __libcpp_tolower(int, __locale_t);
+//  int __libcpp_strcoll(const char*, const char*, __locale_t);
+//  size_t  __libcpp_strxfrm(char*, const char*, size_t, __locale_t);
 //
-//  int __iswspace(wint_t, __locale_t);
-//  int __iswprint(wint_t, __locale_t);
-//  int __iswcntrl(wint_t, __locale_t);
-//  int __iswupper(wint_t, __locale_t);
-//  int __iswlower(wint_t, __locale_t);
-//  int __iswalpha(wint_t, __locale_t);
-//  int __iswblank(wint_t, __locale_t);
-//  int __iswdigit(wint_t, __locale_t);
-//  int __iswpunct(wint_t, __locale_t);
-//  int __iswxdigit(wint_t, __locale_t);
-//  wint_t  __towupper(wint_t, __locale_t);
-//  wint_t  __towlower(wint_t, __locale_t);
-//  int __wcscoll(const wchar_t*, const wchar_t*, __locale_t);
-//  size_t  __wcsxfrm(wchar_t*, const wchar_t*, size_t, __locale_t);
+//  int __libcpp_iswspace(wint_t, __locale_t);
+//  int __libcpp_iswprint(wint_t, __locale_t);
+//  int __libcpp_iswcntrl(wint_t, __locale_t);
+//  int __libcpp_iswupper(wint_t, __locale_t);
+//  int __lib

[clang] [libcxx] [libc++] Rename `__` prefix to `__libcpp_` for locale related functions (PR #119241)

2024-12-09 Thread Zibi Sarbinowski via cfe-commits

https://github.com/zibi2 updated 
https://github.com/llvm/llvm-project/pull/119241

>From d3ee5e960bbf20286d726135423eb632ae45eafb Mon Sep 17 00:00:00 2001
From: Zbigniew Sarbinowski 
Date: Mon, 9 Dec 2024 18:17:47 +
Subject: [PATCH 1/3] Rename __ prefix to __libcpp_ for locale related
 functions to eliminate name collition with macors in system locale.h header

---
 clang/lib/Headers/CMakeLists.txt  |   1 +
 clang/lib/Headers/zos_wrappers/locale.h   |  19 +++
 libcxx/include/__locale_dir/locale_base_api.h | 119 +++
 .../__locale_dir/locale_base_api/ibm.h|  33 +
 libcxx/include/locale |   4 +-
 libcxx/src/locale.cpp | 140 +-
 6 files changed, 186 insertions(+), 130 deletions(-)
 create mode 100644 clang/lib/Headers/zos_wrappers/locale.h

diff --git a/clang/lib/Headers/CMakeLists.txt b/clang/lib/Headers/CMakeLists.txt
index 43124111b7ba5a..71f2ff268548d5 100644
--- a/clang/lib/Headers/CMakeLists.txt
+++ b/clang/lib/Headers/CMakeLists.txt
@@ -381,6 +381,7 @@ set(llvm_libc_wrapper_files
 
 set(zos_wrapper_files
   zos_wrappers/builtins.h
+  zos_wrappers/locale.h
 )
 
 include(GetClangResourceDir)
diff --git a/clang/lib/Headers/zos_wrappers/locale.h 
b/clang/lib/Headers/zos_wrappers/locale.h
new file mode 100644
index 00..1381f6d47ac097
--- /dev/null
+++ b/clang/lib/Headers/zos_wrappers/locale.h
@@ -0,0 +1,19 @@
+/*===- locale.h 
--===
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+ 
*===-===
+ */
+
+#ifndef __ZOS_WRAPPERS_LOCALE_H
+#define __ZOS_WRAPPERS_LOCALE_H
+  #if defined(__MVS__)
+#include_next 
+#ifdef __locale
+  #undef __locale
+  #define __locale __locale
+#endif
+  #endif /* defined(__MVS__) */
+#endif /* __ZOS_WRAPPERS_LOCALE_H */
diff --git a/libcxx/include/__locale_dir/locale_base_api.h 
b/libcxx/include/__locale_dir/locale_base_api.h
index 8ed4c29cb8732f..9bd3420b65fcf8 100644
--- a/libcxx/include/__locale_dir/locale_base_api.h
+++ b/libcxx/include/__locale_dir/locale_base_api.h
@@ -39,41 +39,41 @@
 // Strtonum functions
 // --
 // namespace __locale {
-//  float   __strtof(const char*, char**, __locale_t);
-//  double  __strtod(const char*, char**, __locale_t);
-//  long double __strtold(const char*, char**, __locale_t);
-//  long long   __strtoll(const char*, char**, __locale_t);
-//  unsigned long long  __strtoull(const char*, char**, __locale_t);
+//  float   __libcpp_strtof(const char*, char**, __locale_t);
+//  double  __libcpp_strtod(const char*, char**, __locale_t);
+//  long double __libcpp_strtold(const char*, char**, __locale_t);
+//  long long   __libcpp_strtoll(const char*, char**, __locale_t);
+//  unsigned long long  __libcpp_strtoull(const char*, char**, __locale_t);
 // }
 //
 // Character manipulation functions
 // 
 // namespace __locale {
-//  int __islower(int, __locale_t);
-//  int __isupper(int, __locale_t);
-//  int __isdigit(int, __locale_t);
-//  int __isxdigit(int, __locale_t);
-//  int __toupper(int, __locale_t);
-//  int __tolower(int, __locale_t);
-//  int __strcoll(const char*, const char*, __locale_t);
-//  size_t  __strxfrm(char*, const char*, size_t, __locale_t);
+//  int __libcpp_islower(int, __locale_t);
+//  int __libcpp_isupper(int, __locale_t);
+//  int __libcpp_isdigit(int, __locale_t);
+//  int __libcpp_isxdigit(int, __locale_t);
+//  int __libcpp_toupper(int, __locale_t);
+//  int __libcpp_tolower(int, __locale_t);
+//  int __libcpp_strcoll(const char*, const char*, __locale_t);
+//  size_t  __libcpp_strxfrm(char*, const char*, size_t, __locale_t);
 //
-//  int __iswspace(wint_t, __locale_t);
-//  int __iswprint(wint_t, __locale_t);
-//  int __iswcntrl(wint_t, __locale_t);
-//  int __iswupper(wint_t, __locale_t);
-//  int __iswlower(wint_t, __locale_t);
-//  int __iswalpha(wint_t, __locale_t);
-//  int __iswblank(wint_t, __locale_t);
-//  int __iswdigit(wint_t, __locale_t);
-//  int __iswpunct(wint_t, __locale_t);
-//  int __iswxdigit(wint_t, __locale_t);
-//  wint_t  __towupper(wint_t, __locale_t);
-//  wint_t  __towlower(wint_t, __locale_t);
-//  int __wcscoll(const wchar_t*, const wchar_t*, __locale_t);
-//  size_t  __wcsxfrm(wchar_t*, const wchar_t*, size_t, __locale_t);
+//  int __libcpp_iswspace(wint_t, __locale_t);
+//  int __libcpp_iswprint(wint_t, __locale_t);
+//  int __libcpp_iswcntrl(wint_t, __locale_t);
+//  int __libcpp_iswupper(wint_t, __locale_t);
+//  int __lib

[clang] [libcxx] [libc++] Rename `__` prefix to `__libcpp_` for locale related functions (PR #119241)

2024-12-09 Thread Zibi Sarbinowski via cfe-commits

https://github.com/zibi2 created 
https://github.com/llvm/llvm-project/pull/119241

This PR is necessary to resolve name collisions between locale functions 
defined within libc++ and macros used in z/OS system   header, `locale.h`. 
Those macros cannot be changed since they are visible and out in the field for 
many releases. 

In addition, the zos wrapper locale.h header is created to remove conflict 
between `__locale` namespace and guard macro used by z/OS system header. This 
change is temporary until system header is altered to do the same.

The PR is to address build issues on z/OS caused by PR 
[114596](https://github.com/llvm/llvm-project/pull/114596).
The following is a sample of errors:
```
.../include/c++/v1/__locale_dir/locale_base_api.h:181:54: error: too many 
arguments provided to function-like macro invocation
  181 | inline _LIBCPP_HIDE_FROM_ABI int __islower(int __ch, __locale_t __loc) 
{ return islower_l(__ch, __loc); }
  |  ^
...util/usr/include/ctype.h:387:11: note: macro '__islower' defined here
  387 |   #define __islower(c) (_TYPCHK((c),__ISLOWER))
  |   ^
```

>From d3ee5e960bbf20286d726135423eb632ae45eafb Mon Sep 17 00:00:00 2001
From: Zbigniew Sarbinowski 
Date: Mon, 9 Dec 2024 18:17:47 +
Subject: [PATCH] Rename __ prefix to __libcpp_ for locale related functions to
 eliminate name collition with macors in system locale.h header

---
 clang/lib/Headers/CMakeLists.txt  |   1 +
 clang/lib/Headers/zos_wrappers/locale.h   |  19 +++
 libcxx/include/__locale_dir/locale_base_api.h | 119 +++
 .../__locale_dir/locale_base_api/ibm.h|  33 +
 libcxx/include/locale |   4 +-
 libcxx/src/locale.cpp | 140 +-
 6 files changed, 186 insertions(+), 130 deletions(-)
 create mode 100644 clang/lib/Headers/zos_wrappers/locale.h

diff --git a/clang/lib/Headers/CMakeLists.txt b/clang/lib/Headers/CMakeLists.txt
index 43124111b7ba5a..71f2ff268548d5 100644
--- a/clang/lib/Headers/CMakeLists.txt
+++ b/clang/lib/Headers/CMakeLists.txt
@@ -381,6 +381,7 @@ set(llvm_libc_wrapper_files
 
 set(zos_wrapper_files
   zos_wrappers/builtins.h
+  zos_wrappers/locale.h
 )
 
 include(GetClangResourceDir)
diff --git a/clang/lib/Headers/zos_wrappers/locale.h 
b/clang/lib/Headers/zos_wrappers/locale.h
new file mode 100644
index 00..1381f6d47ac097
--- /dev/null
+++ b/clang/lib/Headers/zos_wrappers/locale.h
@@ -0,0 +1,19 @@
+/*===- locale.h 
--===
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+ 
*===-===
+ */
+
+#ifndef __ZOS_WRAPPERS_LOCALE_H
+#define __ZOS_WRAPPERS_LOCALE_H
+  #if defined(__MVS__)
+#include_next 
+#ifdef __locale
+  #undef __locale
+  #define __locale __locale
+#endif
+  #endif /* defined(__MVS__) */
+#endif /* __ZOS_WRAPPERS_LOCALE_H */
diff --git a/libcxx/include/__locale_dir/locale_base_api.h 
b/libcxx/include/__locale_dir/locale_base_api.h
index 8ed4c29cb8732f..9bd3420b65fcf8 100644
--- a/libcxx/include/__locale_dir/locale_base_api.h
+++ b/libcxx/include/__locale_dir/locale_base_api.h
@@ -39,41 +39,41 @@
 // Strtonum functions
 // --
 // namespace __locale {
-//  float   __strtof(const char*, char**, __locale_t);
-//  double  __strtod(const char*, char**, __locale_t);
-//  long double __strtold(const char*, char**, __locale_t);
-//  long long   __strtoll(const char*, char**, __locale_t);
-//  unsigned long long  __strtoull(const char*, char**, __locale_t);
+//  float   __libcpp_strtof(const char*, char**, __locale_t);
+//  double  __libcpp_strtod(const char*, char**, __locale_t);
+//  long double __libcpp_strtold(const char*, char**, __locale_t);
+//  long long   __libcpp_strtoll(const char*, char**, __locale_t);
+//  unsigned long long  __libcpp_strtoull(const char*, char**, __locale_t);
 // }
 //
 // Character manipulation functions
 // 
 // namespace __locale {
-//  int __islower(int, __locale_t);
-//  int __isupper(int, __locale_t);
-//  int __isdigit(int, __locale_t);
-//  int __isxdigit(int, __locale_t);
-//  int __toupper(int, __locale_t);
-//  int __tolower(int, __locale_t);
-//  int __strcoll(const char*, const char*, __locale_t);
-//  size_t  __strxfrm(char*, const char*, size_t, __locale_t);
+//  int __libcpp_islower(int, __locale_t);
+//  int __libcpp_isupper(int, __locale_t);
+//  int __libcpp_isdigit(int, __locale_t);
+//  int __libcpp_isxdigit(int, __locale_t);
+//  int __libcpp_toupper(int, __locale_t);
+//  int _

[clang] [libcxx] [libc++] Rename `__` prefix to `__libcpp_` for locale related functions (PR #119241)

2024-12-09 Thread Zibi Sarbinowski via cfe-commits

https://github.com/zibi2 updated 
https://github.com/llvm/llvm-project/pull/119241

>From d3ee5e960bbf20286d726135423eb632ae45eafb Mon Sep 17 00:00:00 2001
From: Zbigniew Sarbinowski 
Date: Mon, 9 Dec 2024 18:17:47 +
Subject: [PATCH 1/4] Rename __ prefix to __libcpp_ for locale related
 functions to eliminate name collition with macors in system locale.h header

---
 clang/lib/Headers/CMakeLists.txt  |   1 +
 clang/lib/Headers/zos_wrappers/locale.h   |  19 +++
 libcxx/include/__locale_dir/locale_base_api.h | 119 +++
 .../__locale_dir/locale_base_api/ibm.h|  33 +
 libcxx/include/locale |   4 +-
 libcxx/src/locale.cpp | 140 +-
 6 files changed, 186 insertions(+), 130 deletions(-)
 create mode 100644 clang/lib/Headers/zos_wrappers/locale.h

diff --git a/clang/lib/Headers/CMakeLists.txt b/clang/lib/Headers/CMakeLists.txt
index 43124111b7ba5a..71f2ff268548d5 100644
--- a/clang/lib/Headers/CMakeLists.txt
+++ b/clang/lib/Headers/CMakeLists.txt
@@ -381,6 +381,7 @@ set(llvm_libc_wrapper_files
 
 set(zos_wrapper_files
   zos_wrappers/builtins.h
+  zos_wrappers/locale.h
 )
 
 include(GetClangResourceDir)
diff --git a/clang/lib/Headers/zos_wrappers/locale.h 
b/clang/lib/Headers/zos_wrappers/locale.h
new file mode 100644
index 00..1381f6d47ac097
--- /dev/null
+++ b/clang/lib/Headers/zos_wrappers/locale.h
@@ -0,0 +1,19 @@
+/*===- locale.h 
--===
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+ 
*===-===
+ */
+
+#ifndef __ZOS_WRAPPERS_LOCALE_H
+#define __ZOS_WRAPPERS_LOCALE_H
+  #if defined(__MVS__)
+#include_next 
+#ifdef __locale
+  #undef __locale
+  #define __locale __locale
+#endif
+  #endif /* defined(__MVS__) */
+#endif /* __ZOS_WRAPPERS_LOCALE_H */
diff --git a/libcxx/include/__locale_dir/locale_base_api.h 
b/libcxx/include/__locale_dir/locale_base_api.h
index 8ed4c29cb8732f..9bd3420b65fcf8 100644
--- a/libcxx/include/__locale_dir/locale_base_api.h
+++ b/libcxx/include/__locale_dir/locale_base_api.h
@@ -39,41 +39,41 @@
 // Strtonum functions
 // --
 // namespace __locale {
-//  float   __strtof(const char*, char**, __locale_t);
-//  double  __strtod(const char*, char**, __locale_t);
-//  long double __strtold(const char*, char**, __locale_t);
-//  long long   __strtoll(const char*, char**, __locale_t);
-//  unsigned long long  __strtoull(const char*, char**, __locale_t);
+//  float   __libcpp_strtof(const char*, char**, __locale_t);
+//  double  __libcpp_strtod(const char*, char**, __locale_t);
+//  long double __libcpp_strtold(const char*, char**, __locale_t);
+//  long long   __libcpp_strtoll(const char*, char**, __locale_t);
+//  unsigned long long  __libcpp_strtoull(const char*, char**, __locale_t);
 // }
 //
 // Character manipulation functions
 // 
 // namespace __locale {
-//  int __islower(int, __locale_t);
-//  int __isupper(int, __locale_t);
-//  int __isdigit(int, __locale_t);
-//  int __isxdigit(int, __locale_t);
-//  int __toupper(int, __locale_t);
-//  int __tolower(int, __locale_t);
-//  int __strcoll(const char*, const char*, __locale_t);
-//  size_t  __strxfrm(char*, const char*, size_t, __locale_t);
+//  int __libcpp_islower(int, __locale_t);
+//  int __libcpp_isupper(int, __locale_t);
+//  int __libcpp_isdigit(int, __locale_t);
+//  int __libcpp_isxdigit(int, __locale_t);
+//  int __libcpp_toupper(int, __locale_t);
+//  int __libcpp_tolower(int, __locale_t);
+//  int __libcpp_strcoll(const char*, const char*, __locale_t);
+//  size_t  __libcpp_strxfrm(char*, const char*, size_t, __locale_t);
 //
-//  int __iswspace(wint_t, __locale_t);
-//  int __iswprint(wint_t, __locale_t);
-//  int __iswcntrl(wint_t, __locale_t);
-//  int __iswupper(wint_t, __locale_t);
-//  int __iswlower(wint_t, __locale_t);
-//  int __iswalpha(wint_t, __locale_t);
-//  int __iswblank(wint_t, __locale_t);
-//  int __iswdigit(wint_t, __locale_t);
-//  int __iswpunct(wint_t, __locale_t);
-//  int __iswxdigit(wint_t, __locale_t);
-//  wint_t  __towupper(wint_t, __locale_t);
-//  wint_t  __towlower(wint_t, __locale_t);
-//  int __wcscoll(const wchar_t*, const wchar_t*, __locale_t);
-//  size_t  __wcsxfrm(wchar_t*, const wchar_t*, size_t, __locale_t);
+//  int __libcpp_iswspace(wint_t, __locale_t);
+//  int __libcpp_iswprint(wint_t, __locale_t);
+//  int __libcpp_iswcntrl(wint_t, __locale_t);
+//  int __libcpp_iswupper(wint_t, __locale_t);
+//  int __lib

[clang] [llvm] [SystemZ][z/OS] Update autoconversion functions to improve support for UTF-8 (PR #98652)

2024-12-09 Thread Zibi Sarbinowski via cfe-commits

https://github.com/zibi2 edited https://github.com/llvm/llvm-project/pull/98652
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [SystemZ][z/OS] Update autoconversion functions to improve support for UTF-8 (PR #98652)

2024-12-09 Thread Zibi Sarbinowski via cfe-commits


@@ -70,6 +70,13 @@ class FileEntryRef {
   const FileEntry &getFileEntry() const {
 return *getBaseMapEntry().second->V.get();
   }
+
+  // This is a non const version of getFileEntry() which is used if the buffer
+  // size needs to be increased due to potential z/OS EBCDIC -> UTF-8 
conversion
+  FileEntry &getFileEntryToUpdate() {

zibi2 wrote:

nit: Consider rename this to `updateFileEntry()`

https://github.com/llvm/llvm-project/pull/98652
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [SystemZ][z/OS] Update autoconversion functions to improve support for UTF-8 (PR #98652)

2024-12-09 Thread Zibi Sarbinowski via cfe-commits


@@ -70,6 +70,13 @@ class FileEntryRef {
   const FileEntry &getFileEntry() const {
 return *getBaseMapEntry().second->V.get();
   }
+
+  // This is a non const version of getFileEntry() which is used if the buffer
+  // size needs to be increased due to potential z/OS EBCDIC -> UTF-8 
conversion
+  FileEntry &getFileEntryToUpdate() {

zibi2 wrote:

We could convert this function to do the update by taking the `BufferSize` as 
parameter, isn't it?

https://github.com/llvm/llvm-project/pull/98652
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [SystemZ][z/OS] Update autoconversion functions to improve support for UTF-8 (PR #98652)

2024-12-09 Thread Zibi Sarbinowski via cfe-commits

https://github.com/zibi2 approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/98652
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [llvm] [SystemZ][z/OS] Update autoconversion functions to improve support for UTF-8 (PR #98652)

2024-12-09 Thread Zibi Sarbinowski via cfe-commits


@@ -70,6 +70,11 @@ class FileEntryRef {
   const FileEntry &getFileEntry() const {
 return *getBaseMapEntry().second->V.get();
   }
+
+  // This is a non const version of getFileEntry() which is used if the buffer
+  // size needs to be increased due to potential z/OS EBCDIC -> UTF-8 
conversion

zibi2 wrote:

```suggestion
  // This function is used if the buffer size needs to be increased 
  // due to potential z/OS EBCDIC -> UTF-8 conversion
```

https://github.com/llvm/llvm-project/pull/98652
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [libcxx] [libc++] Rename `__` prefix to `__libcpp_` for locale related functions (PR #119241)

2025-01-28 Thread Zibi Sarbinowski via cfe-commits

zibi2 wrote:

> ... the only bulletproof way of addressing this issue is push/pop

Thx, I will experiment with push/pop and handle only names we have in conflict.

https://github.com/llvm/llvm-project/pull/119241
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [libcxx] [libc++] Rename `__` prefix to `__libcpp_` for locale related functions (PR #119241)

2025-01-28 Thread Zibi Sarbinowski via cfe-commits

zibi2 wrote:

Louis, are you still in position of not accepting the rename proposal in this 
PR? 

I was able to resolve the `__locale_t`  name collision with a wrapper, but 
unfortunately, as Sean pointed out, we cannot undefine other macros conflicting 
with the inline functions in `libc++`. If we cannot use the `__libcpp_`  prefix 
anymore, what is the recommended way of resolving name collisions? When the use 
of the `__libcpp_` prefix was discouraged, was there any alternative for 
resolving name collisions with the underlying system C library?

https://github.com/llvm/llvm-project/pull/119241
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [SystemZ][z/OS] Mark text files as text in ClangScanDeps (PR #127514)

2025-02-18 Thread Zibi Sarbinowski via cfe-commits

https://github.com/zibi2 approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/127514
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Add back include for AutoConvert.h as it's needed for z/OS (PR #135430)

2025-04-11 Thread Zibi Sarbinowski via cfe-commits

https://github.com/zibi2 approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/135430
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Mark the file opened by DeserializedDeclsSourceRangePrinter as a text file (PR #135842)

2025-04-15 Thread Zibi Sarbinowski via cfe-commits

https://github.com/zibi2 created 
https://github.com/llvm/llvm-project/pull/135842

This PR will fix the following lit failure seeing on z/OS and most likely on 
Windows:

`FAIL: Clang :: Frontend/dump-minimization-hints.cpp`

Without `OF_TextWithCRLF` flag, a file is treated as binary and is read 
improperly.

>From b162b0476058c40b2fcbf7ef397696caead11a7f Mon Sep 17 00:00:00 2001
From: Zibi Sarbinowski 
Date: Tue, 15 Apr 2025 19:10:02 +
Subject: [PATCH] Mark the file opened by DeserializedDeclsSourceRangePrinter
 as a text file

---
 clang/lib/Frontend/FrontendAction.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Frontend/FrontendAction.cpp 
b/clang/lib/Frontend/FrontendAction.cpp
index bd084aa94fc37..1c4dec08575d1 100644
--- a/clang/lib/Frontend/FrontendAction.cpp
+++ b/clang/lib/Frontend/FrontendAction.cpp
@@ -312,7 +312,7 @@ FrontendAction::CreateWrappedASTConsumer(CompilerInstance 
&CI,
 std::error_code ErrorCode;
 auto FileStream = std::make_unique(
 DumpDeserializedDeclarationRangesPath, ErrorCode,
-llvm::sys::fs::OF_None);
+llvm::sys::fs::OF_TextWithCRLF);
 if (!ErrorCode) {
   
Consumers.push_back(std::make_unique(
   CI.getSourceManager(), std::move(FileStream)));

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits