[llvm-branch-commits] [clang] 7830c3e - Revert "[Driver] Add toolchain for X86_64 UEFI target (#76838)"

2024-09-19 Thread via llvm-branch-commits

Author: Prabhuk
Date: 2024-09-19T14:53:55-07:00
New Revision: 7830c3e9d61e168a1de1fa2b33acc3fd4e22f2ed

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

LOG: Revert "[Driver] Add toolchain for X86_64 UEFI target (#76838)"

This reverts commit d1335fb86466221b0499db5fc8f158f1f64d9542.

Added: 


Modified: 
clang/lib/Basic/Targets.cpp
clang/lib/Basic/Targets/OSTargets.h
clang/lib/Basic/Targets/X86.h
clang/lib/Driver/CMakeLists.txt
clang/lib/Driver/Driver.cpp
clang/unittests/Driver/ToolChainTest.cpp

Removed: 
clang/lib/Driver/ToolChains/UEFI.cpp
clang/lib/Driver/ToolChains/UEFI.h
clang/test/CodeGen/X86/uefi-data-layout.c
clang/test/Driver/uefi-constructed-args.c



diff  --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index 4917ef015941be..0b8e565345b6a4 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -613,9 +613,6 @@ std::unique_ptr AllocateTarget(const 
llvm::Triple &Triple,
 case llvm::Triple::Solaris:
   return std::make_unique>(Triple,
Opts);
-case llvm::Triple::UEFI:
-  return std::make_unique(Triple, Opts);
-
 case llvm::Triple::Win32: {
   switch (Triple.getEnvironment()) {
   case llvm::Triple::Cygnus:

diff  --git a/clang/lib/Basic/Targets/OSTargets.h 
b/clang/lib/Basic/Targets/OSTargets.h
index a83d6464e789d6..0a4f06967fff5a 100644
--- a/clang/lib/Basic/Targets/OSTargets.h
+++ b/clang/lib/Basic/Targets/OSTargets.h
@@ -778,21 +778,6 @@ class LLVM_LIBRARY_VISIBILITY ZOSTargetInfo : public 
OSTargetInfo {
   }
 };
 
-// UEFI target
-template 
-class LLVM_LIBRARY_VISIBILITY UEFITargetInfo : public OSTargetInfo {
-protected:
-  void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
-MacroBuilder &Builder) const override {}
-
-public:
-  UEFITargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
-  : OSTargetInfo(Triple, Opts) {
-this->WCharType = TargetInfo::UnsignedShort;
-this->WIntType = TargetInfo::UnsignedShort;
-  }
-};
-
 void addWindowsDefines(const llvm::Triple &Triple, const LangOptions &Opts,
MacroBuilder &Builder);
 

diff  --git a/clang/lib/Basic/Targets/X86.h b/clang/lib/Basic/Targets/X86.h
index a99ae62984c7d5..79fd5867cf6673 100644
--- a/clang/lib/Basic/Targets/X86.h
+++ b/clang/lib/Basic/Targets/X86.h
@@ -814,43 +814,6 @@ class LLVM_LIBRARY_VISIBILITY X86_64TargetInfo : public 
X86TargetInfo {
   }
 };
 
-// x86-64 UEFI target
-class LLVM_LIBRARY_VISIBILITY UEFIX86_64TargetInfo
-: public UEFITargetInfo {
-public:
-  UEFIX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
-  : UEFITargetInfo(Triple, Opts) {
-this->TheCXXABI.set(TargetCXXABI::Microsoft);
-this->MaxTLSAlign = 8192u * this->getCharWidth();
-this->resetDataLayout("e-m:w-p270:32:32-p271:32:32-p272:64:64-"
-  "i64:64-i128:128-f80:128-n8:16:32:64-S128");
-  }
-
-  void getTargetDefines(const LangOptions &Opts,
-MacroBuilder &Builder) const override {
-getOSDefines(Opts, X86TargetInfo::getTriple(), Builder);
-  }
-
-  BuiltinVaListKind getBuiltinVaListKind() const override {
-return TargetInfo::CharPtrBuiltinVaList;
-  }
-
-  CallingConvCheckResult checkCallingConvention(CallingConv CC) const override 
{
-switch (CC) {
-case CC_C:
-case CC_Win64:
-  return CCCR_OK;
-default:
-  return CCCR_Warning;
-}
-  }
-
-  TargetInfo::CallingConvKind
-  getCallingConvKind(bool ClangABICompat4) const override {
-return CCK_MicrosoftWin64;
-  }
-};
-
 // x86-64 Windows target
 class LLVM_LIBRARY_VISIBILITY WindowsX86_64TargetInfo
 : public WindowsTargetInfo {

diff  --git a/clang/lib/Driver/CMakeLists.txt b/clang/lib/Driver/CMakeLists.txt
index 4fd10bf671512f..32a4378ab499fa 100644
--- a/clang/lib/Driver/CMakeLists.txt
+++ b/clang/lib/Driver/CMakeLists.txt
@@ -78,7 +78,6 @@ add_clang_library(clangDriver
   ToolChains/Solaris.cpp
   ToolChains/SPIRV.cpp
   ToolChains/TCE.cpp
-  ToolChains/UEFI.cpp
   ToolChains/VEToolchain.cpp
   ToolChains/WebAssembly.cpp
   ToolChains/XCore.cpp

diff  --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 95723b9209d125..efe398dd531da7 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -45,7 +45,6 @@
 #include "ToolChains/SPIRV.h"
 #include "ToolChains/Solaris.h"
 #include "ToolChains/TCE.h"
-#include "ToolChains/UEFI.h"
 #include "ToolChains/VEToolchain.h"
 #include "ToolChains/WebAssembly.h"
 #include "ToolChains/XCore.h"
@@ -6417,9 +6416,6 @@ const ToolChain &Driver::getToolChain(const ArgList &Args,
 case llvm::Triple::Mesa3D:
   TC = std::

[llvm-branch-commits] [clang] release/19.x: [clang-format] Reimplement InsertNewlineAtEOF (#108513) (PR #109170)

2024-09-19 Thread Owen Pan via llvm-branch-commits

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


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


[llvm-branch-commits] [libcxx] [libc++] Adjust the version of __cpp_lib_ranges in C++20 mode (PR #109324)

2024-09-19 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)


Changes

This is a (very partial) cherry-pick of #101715 to fix this oversight 
in the LLVM 19 release.

---
Full diff: https://github.com/llvm/llvm-project/pull/109324.diff


9 Files Affected:

- (modified) libcxx/docs/FeatureTestMacroTable.rst (+1-1) 
- (modified) libcxx/include/version (+2-2) 
- (modified) 
libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
 (+7-7) 
- (modified) 
libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp
 (+7-7) 
- (modified) 
libcxx/test/std/language.support/support.limits/support.limits.general/iterator.version.compile.pass.cpp
 (+7-7) 
- (modified) 
libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.compile.pass.cpp
 (+7-7) 
- (modified) 
libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp
 (+7-7) 
- (modified) 
libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
 (+7-7) 
- (modified) libcxx/utils/generate_feature_test_macro_components.py (+1-1) 


``diff
diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index a1506e115fe70f..4d532e2bd7319e 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -266,7 +266,7 @@ Status
 -- 
-
 ``__cpp_lib_polymorphic_allocator````201902L``
 -- 
-
-``__cpp_lib_ranges``   ``202207L``
+``__cpp_lib_ranges``   ``202110L``
 -- 
-
 ``__cpp_lib_remove_cvref`` ``201711L``
 -- 
-
diff --git a/libcxx/include/version b/libcxx/include/version
index fe64343eafbc9c..f53557bbe23d8a 100644
--- a/libcxx/include/version
+++ b/libcxx/include/version
@@ -182,7 +182,7 @@ __cpp_lib_philox_engine 
202406L 
 __cpp_lib_polymorphic_allocator 201902L 

 __cpp_lib_print 202207L  

 __cpp_lib_quoted_string_io  201304L 
-__cpp_lib_ranges202207L  
 
+__cpp_lib_ranges202110L  
 
  

 __cpp_lib_ranges_as_const   202207L 
 __cpp_lib_ranges_as_rvalue  202207L 
@@ -428,7 +428,7 @@ __cpp_lib_void_t
201411L 
 # if _LIBCPP_AVAILABILITY_HAS_PMR
 #   define __cpp_lib_polymorphic_allocator  201902L
 # endif
-# define __cpp_lib_ranges   202207L
+# define __cpp_lib_ranges   202110L
 # define __cpp_lib_remove_cvref 201711L
 # if !defined(_LIBCPP_HAS_NO_THREADS) && _LIBCPP_AVAILABILITY_HAS_SYNC
 #   define __cpp_lib_semaphore  201907L
diff --git 
a/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
 
b/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
index ded80060632419..932dea1c5cf007 100644
--- 
a/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
+++ 
b/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
@@ -21,7 +21,7 @@
 __cpp_lib_default_template_type_for_algorithm_values202403L [C++26]
 __cpp_lib_freestanding_algorithm202311L [C++26]
 __cpp_lib_parallel_algorithm201603L [C++17]
-__cpp_lib_ranges202207L [C++20]
+__cpp_lib_ranges202110L [C++20]
 __cpp_lib_ranges_contains   202207L [C++23]
 __cpp_lib_ranges_find_last  202207L [C++23]
 __cpp_lib_ranges_starts_ends_with   202106L [C++23]
@@ -244,8 +244,8 @@
 # ifndef __cpp_lib_ranges
 #   error "__cpp_lib_ranges should be defined in c++20"
 # endif
-# if __cpp_lib_ranges != 202207L
-#   error "__cpp_lib_ranges should have the value 202207L in c++20"
+# if __cpp_lib_ranges != 202110L
+#   error "__cpp_lib_ranges should have the value 202110L in c++20"
 # endif
 
 # ifdef __cpp_lib_ranges_contains
@@ -321,8 +321,8 @@
 # ifndef __cpp_lib_ranges
 #   error "

[llvm-branch-commits] [libcxx] [libc++] Follow-up to "Poison Pills are Too Toxic" (PR #109291)

2024-09-19 Thread Louis Dionne via llvm-branch-commits

https://github.com/ldionne edited 
https://github.com/llvm/llvm-project/pull/109291
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] [libc++] Adjust the version of __cpp_lib_ranges in C++20 mode (PR #109324)

2024-09-19 Thread Louis Dionne via llvm-branch-commits

https://github.com/ldionne milestoned 
https://github.com/llvm/llvm-project/pull/109324
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libcxx] [libc++] Follow-up to "Poison Pills are Too Toxic" (PR #109291)

2024-09-19 Thread Louis Dionne via llvm-branch-commits


@@ -992,6 +992,7 @@ def add_version_header(tc):
 "name": "__cpp_lib_ranges",
 "values": {
 "c++20": 202207,
+"c++23": 202211,  # P2602R2 Poison Pills are Too Toxic

ldionne wrote:

Ack, we can fix that in a follow-up PR indeed.

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


[llvm-branch-commits] [libcxx] [libc++] Adjust the version of __cpp_lib_ranges in C++20 mode (PR #109324)

2024-09-19 Thread Louis Dionne via llvm-branch-commits

https://github.com/ldionne created 
https://github.com/llvm/llvm-project/pull/109324

This is a (very partial) cherry-pick of #101715 to fix this oversight in the 
LLVM 19 release.

>From f94aed192c413fc174d353c9f8f27766497a8c56 Mon Sep 17 00:00:00 2001
From: Louis Dionne 
Date: Thu, 19 Sep 2024 15:40:47 -0400
Subject: [PATCH] [libc++] Adjust the version of __cpp_lib_ranges in C++20 mode

This is a (very partial) cherry-pick of #101715 to fix this oversight
in the LLVM 19 release.
---
 libcxx/docs/FeatureTestMacroTable.rst  |  2 +-
 libcxx/include/version |  4 ++--
 .../algorithm.version.compile.pass.cpp | 14 +++---
 .../functional.version.compile.pass.cpp| 14 +++---
 .../iterator.version.compile.pass.cpp  | 14 +++---
 .../memory.version.compile.pass.cpp| 14 +++---
 .../ranges.version.compile.pass.cpp| 14 +++---
 .../version.version.compile.pass.cpp   | 14 +++---
 .../generate_feature_test_macro_components.py  |  2 +-
 9 files changed, 46 insertions(+), 46 deletions(-)

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index a1506e115fe70f..4d532e2bd7319e 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -266,7 +266,7 @@ Status
 -- 
-
 ``__cpp_lib_polymorphic_allocator````201902L``
 -- 
-
-``__cpp_lib_ranges``   ``202207L``
+``__cpp_lib_ranges``   ``202110L``
 -- 
-
 ``__cpp_lib_remove_cvref`` ``201711L``
 -- 
-
diff --git a/libcxx/include/version b/libcxx/include/version
index fe64343eafbc9c..f53557bbe23d8a 100644
--- a/libcxx/include/version
+++ b/libcxx/include/version
@@ -182,7 +182,7 @@ __cpp_lib_philox_engine 
202406L 
 __cpp_lib_polymorphic_allocator 201902L 

 __cpp_lib_print 202207L  

 __cpp_lib_quoted_string_io  201304L 
-__cpp_lib_ranges202207L  
 
+__cpp_lib_ranges202110L  
 
  

 __cpp_lib_ranges_as_const   202207L 
 __cpp_lib_ranges_as_rvalue  202207L 
@@ -428,7 +428,7 @@ __cpp_lib_void_t
201411L 
 # if _LIBCPP_AVAILABILITY_HAS_PMR
 #   define __cpp_lib_polymorphic_allocator  201902L
 # endif
-# define __cpp_lib_ranges   202207L
+# define __cpp_lib_ranges   202110L
 # define __cpp_lib_remove_cvref 201711L
 # if !defined(_LIBCPP_HAS_NO_THREADS) && _LIBCPP_AVAILABILITY_HAS_SYNC
 #   define __cpp_lib_semaphore  201907L
diff --git 
a/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
 
b/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
index ded80060632419..932dea1c5cf007 100644
--- 
a/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
+++ 
b/libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
@@ -21,7 +21,7 @@
 __cpp_lib_default_template_type_for_algorithm_values202403L [C++26]
 __cpp_lib_freestanding_algorithm202311L [C++26]
 __cpp_lib_parallel_algorithm201603L [C++17]
-__cpp_lib_ranges202207L [C++20]
+__cpp_lib_ranges202110L [C++20]
 __cpp_lib_ranges_contains   202207L [C++23]
 __cpp_lib_ranges_find_last  202207L [C++23]
 __cpp_lib_ranges_starts_ends_with   202106L [C++23]
@@ -244,8 +244,8 @@
 # ifndef __cpp_lib_ranges
 #   error "__cpp_lib_ranges should be defined in c++20"
 # endif
-# if __cpp_lib_ranges != 202207L
-#   error "__cpp_lib_ranges should have the value 202207L in c++20"
+# if __cpp_lib_ranges != 202110L
+#   error "__cpp_lib_ranges should have the value 202110L in c++20"
 # endif
 
 # ifdef __cpp_lib_ranges_contains
@@ -321,8 +321,8 @@
 # ifndef __cpp_lib_ranges
 #   error "__cpp_lib_ranges should be defined in c++23"
 # endif
-# if __cpp_lib_ranges != 2

[llvm-branch-commits] [clang] b83aea6 - Revert "Revert "[Driver] Add toolchain for X86_64 UEFI target" (#109340)"

2024-09-19 Thread via llvm-branch-commits

Author: Prabhuk
Date: 2024-09-19T19:53:59-07:00
New Revision: b83aea6a5853a5a532d9203cc90ee96dfedc418f

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

LOG: Revert "Revert "[Driver] Add toolchain for X86_64 UEFI target" (#109340)"

This reverts commit d2df2e41cae1413050935d6d27094569c29c473f.

Added: 
clang/lib/Driver/ToolChains/UEFI.cpp
clang/lib/Driver/ToolChains/UEFI.h
clang/test/CodeGen/X86/uefi-data-layout.c
clang/test/Driver/uefi-constructed-args.c

Modified: 
clang/lib/Basic/Targets.cpp
clang/lib/Basic/Targets/OSTargets.h
clang/lib/Basic/Targets/X86.h
clang/lib/Driver/CMakeLists.txt
clang/lib/Driver/Driver.cpp
clang/unittests/Driver/ToolChainTest.cpp

Removed: 




diff  --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index 0b8e565345b6a4..4917ef015941be 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -613,6 +613,9 @@ std::unique_ptr AllocateTarget(const 
llvm::Triple &Triple,
 case llvm::Triple::Solaris:
   return std::make_unique>(Triple,
Opts);
+case llvm::Triple::UEFI:
+  return std::make_unique(Triple, Opts);
+
 case llvm::Triple::Win32: {
   switch (Triple.getEnvironment()) {
   case llvm::Triple::Cygnus:

diff  --git a/clang/lib/Basic/Targets/OSTargets.h 
b/clang/lib/Basic/Targets/OSTargets.h
index 0a4f06967fff5a..a83d6464e789d6 100644
--- a/clang/lib/Basic/Targets/OSTargets.h
+++ b/clang/lib/Basic/Targets/OSTargets.h
@@ -778,6 +778,21 @@ class LLVM_LIBRARY_VISIBILITY ZOSTargetInfo : public 
OSTargetInfo {
   }
 };
 
+// UEFI target
+template 
+class LLVM_LIBRARY_VISIBILITY UEFITargetInfo : public OSTargetInfo {
+protected:
+  void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
+MacroBuilder &Builder) const override {}
+
+public:
+  UEFITargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
+  : OSTargetInfo(Triple, Opts) {
+this->WCharType = TargetInfo::UnsignedShort;
+this->WIntType = TargetInfo::UnsignedShort;
+  }
+};
+
 void addWindowsDefines(const llvm::Triple &Triple, const LangOptions &Opts,
MacroBuilder &Builder);
 

diff  --git a/clang/lib/Basic/Targets/X86.h b/clang/lib/Basic/Targets/X86.h
index 79fd5867cf6673..a99ae62984c7d5 100644
--- a/clang/lib/Basic/Targets/X86.h
+++ b/clang/lib/Basic/Targets/X86.h
@@ -814,6 +814,43 @@ class LLVM_LIBRARY_VISIBILITY X86_64TargetInfo : public 
X86TargetInfo {
   }
 };
 
+// x86-64 UEFI target
+class LLVM_LIBRARY_VISIBILITY UEFIX86_64TargetInfo
+: public UEFITargetInfo {
+public:
+  UEFIX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
+  : UEFITargetInfo(Triple, Opts) {
+this->TheCXXABI.set(TargetCXXABI::Microsoft);
+this->MaxTLSAlign = 8192u * this->getCharWidth();
+this->resetDataLayout("e-m:w-p270:32:32-p271:32:32-p272:64:64-"
+  "i64:64-i128:128-f80:128-n8:16:32:64-S128");
+  }
+
+  void getTargetDefines(const LangOptions &Opts,
+MacroBuilder &Builder) const override {
+getOSDefines(Opts, X86TargetInfo::getTriple(), Builder);
+  }
+
+  BuiltinVaListKind getBuiltinVaListKind() const override {
+return TargetInfo::CharPtrBuiltinVaList;
+  }
+
+  CallingConvCheckResult checkCallingConvention(CallingConv CC) const override 
{
+switch (CC) {
+case CC_C:
+case CC_Win64:
+  return CCCR_OK;
+default:
+  return CCCR_Warning;
+}
+  }
+
+  TargetInfo::CallingConvKind
+  getCallingConvKind(bool ClangABICompat4) const override {
+return CCK_MicrosoftWin64;
+  }
+};
+
 // x86-64 Windows target
 class LLVM_LIBRARY_VISIBILITY WindowsX86_64TargetInfo
 : public WindowsTargetInfo {

diff  --git a/clang/lib/Driver/CMakeLists.txt b/clang/lib/Driver/CMakeLists.txt
index 32a4378ab499fa..4fd10bf671512f 100644
--- a/clang/lib/Driver/CMakeLists.txt
+++ b/clang/lib/Driver/CMakeLists.txt
@@ -78,6 +78,7 @@ add_clang_library(clangDriver
   ToolChains/Solaris.cpp
   ToolChains/SPIRV.cpp
   ToolChains/TCE.cpp
+  ToolChains/UEFI.cpp
   ToolChains/VEToolchain.cpp
   ToolChains/WebAssembly.cpp
   ToolChains/XCore.cpp

diff  --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 1c64ceabad1bf4..44548fa9d706fb 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -45,6 +45,7 @@
 #include "ToolChains/SPIRV.h"
 #include "ToolChains/Solaris.h"
 #include "ToolChains/TCE.h"
+#include "ToolChains/UEFI.h"
 #include "ToolChains/VEToolchain.h"
 #include "ToolChains/WebAssembly.h"
 #include "ToolChains/XCore.h"
@@ -6422,6 +6423,9 @@ const ToolChain &Driver::getToolChain(const ArgList &Args,
 case llvm::Triple::Mesa3D:
   

[llvm-branch-commits] [clang] 6806606 - Fix MAC test failures related to the Clang driver changes.

2024-09-19 Thread via llvm-branch-commits

Author: prabhukr
Date: 2024-09-19T19:59:26-07:00
New Revision: 6806606a55a9c1c6cc1280f88130999cbf2036ac

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

LOG: Fix MAC test failures related to the Clang driver changes.

Added: 


Modified: 
clang/test/Driver/uefi-constructed-args.c

Removed: 




diff  --git a/clang/test/Driver/uefi-constructed-args.c 
b/clang/test/Driver/uefi-constructed-args.c
index bf0a9f4fbeb293..e90857bb6fb5b8 100644
--- a/clang/test/Driver/uefi-constructed-args.c
+++ b/clang/test/Driver/uefi-constructed-args.c
@@ -1,5 +1,4 @@
-// RUN: %clang_cl -### %s --target=x86_64-unknown-uefi \
-// RUN: --sysroot=%S/platform -fuse-ld=lld -g 2>&1 \
+// RUN: %clang_cl -### --target=x86_64-unknown-uefi -g -- %s 2>&1 \
 // RUN: | FileCheck -check-prefixes=CHECK %s
 // CHECK: "-cc1"
 // CHECK-SAME: "-triple" "x86_64-unknown-uefi"



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


[llvm-branch-commits] [CMake] Preserve clang.pre-bolt (PR #109351)

2024-09-19 Thread Amir Ayupov via llvm-branch-commits

https://github.com/aaupov created 
https://github.com/llvm/llvm-project/pull/109351

None


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


[llvm-branch-commits] [clang] 651d669 - Fix MAC test failures related to the Clang driver changes.

2024-09-19 Thread via llvm-branch-commits

Author: prabhukr
Date: 2024-09-19T20:17:02-07:00
New Revision: 651d669269a938b3777b7a68054b188ab02ef7a5

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

LOG: Fix MAC test failures related to the Clang driver changes.

Added: 


Modified: 
clang/test/Driver/uefi-constructed-args.c

Removed: 




diff  --git a/clang/test/Driver/uefi-constructed-args.c 
b/clang/test/Driver/uefi-constructed-args.c
index bf0a9f4fbeb293..e90857bb6fb5b8 100644
--- a/clang/test/Driver/uefi-constructed-args.c
+++ b/clang/test/Driver/uefi-constructed-args.c
@@ -1,5 +1,4 @@
-// RUN: %clang_cl -### %s --target=x86_64-unknown-uefi \
-// RUN: --sysroot=%S/platform -fuse-ld=lld -g 2>&1 \
+// RUN: %clang_cl -### --target=x86_64-unknown-uefi -g -- %s 2>&1 \
 // RUN: | FileCheck -check-prefixes=CHECK %s
 // CHECK: "-cc1"
 // CHECK-SAME: "-triple" "x86_64-unknown-uefi"



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


[llvm-branch-commits] [llvm] release/19.x: [ORC] Remove EDU from dependants list of dependencies before destroying. (PR #109355)

2024-09-19 Thread via llvm-branch-commits

https://github.com/llvmbot created 
https://github.com/llvm/llvm-project/pull/109355

Backport 7034ec491251e598d2867199f89fefa3eb16a1a0

Requested by: @lhames

>From ac0aff430e7e15c1102b1e0e255194b26778fde2 Mon Sep 17 00:00:00 2001
From: Lang Hames 
Date: Tue, 10 Sep 2024 13:47:17 +1000
Subject: [PATCH] [ORC] Remove EDU from dependants list of dependencies before
 destroying.

Dependant lists hold raw pointers back to EDUs that depend on them. We need to
remove these entries before destroying the EDU or we'll be left with a dangling
reference that can result in use-after-free bugs.

No testcase: This has only been observed in multi-threaded setups that
reproduce the issue inconsistently.

rdar://135403614
(cherry picked from commit 7034ec491251e598d2867199f89fefa3eb16a1a0)
---
 llvm/lib/ExecutionEngine/Orc/Core.cpp | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/llvm/lib/ExecutionEngine/Orc/Core.cpp 
b/llvm/lib/ExecutionEngine/Orc/Core.cpp
index 3e6de62c8b7dd9..f70c2890521d3d 100644
--- a/llvm/lib/ExecutionEngine/Orc/Core.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/Core.cpp
@@ -3592,6 +3592,21 @@ ExecutionSession::IL_failSymbols(JITDylib &JD,
   assert(MI.DefiningEDU->Symbols.count(NonOwningSymbolStringPtr(Name)) &&
  "Symbol does not appear in its DefiningEDU");
   MI.DefiningEDU->Symbols.erase(NonOwningSymbolStringPtr(Name));
+
+  // Remove this EDU from the dependants lists of its dependencies.
+  for (auto &[DepJD, DepSyms] : MI.DefiningEDU->Dependencies) {
+for (auto DepSym : DepSyms) {
+  assert(DepJD->Symbols.count(SymbolStringPtr(DepSym)) &&
+ "DepSym not in DepJD");
+  assert(DepJD->MaterializingInfos.count(SymbolStringPtr(DepSym)) &&
+ "DepSym has not MaterializingInfo");
+  auto &SymMI = DepJD->MaterializingInfos[SymbolStringPtr(DepSym)];
+  assert(SymMI.DependantEDUs.count(MI.DefiningEDU.get()) &&
+ "DefiningEDU missing from DependantEDUs list of dependency");
+  SymMI.DependantEDUs.erase(MI.DefiningEDU.get());
+}
+  }
+
   MI.DefiningEDU = nullptr;
 } else {
   // Otherwise if there are any EDUs waiting on this symbol then move

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


[llvm-branch-commits] [llvm] release/19.x: [ORC] Remove EDU from dependants list of dependencies before destroying. (PR #109355)

2024-09-19 Thread via llvm-branch-commits

https://github.com/llvmbot milestoned 
https://github.com/llvm/llvm-project/pull/109355
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] 5686cf3 - Reland "[Driver] Add toolchain for X86_64 UEFI target (#76838)"

2024-09-19 Thread via llvm-branch-commits

Author: Prabhuk
Date: 2024-09-19T20:15:47-07:00
New Revision: 5686cf3c8b4f2c9d92528d3d8b2d47e831600488

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

LOG: Reland "[Driver] Add toolchain for X86_64 UEFI target (#76838)"

Reverts the revert PR: #109340
This reverts commit d2df2e41cae1413050935d6d27094569c29c473f.

Added: 
clang/lib/Driver/ToolChains/UEFI.cpp
clang/lib/Driver/ToolChains/UEFI.h
clang/test/CodeGen/X86/uefi-data-layout.c
clang/test/Driver/uefi-constructed-args.c

Modified: 
clang/lib/Basic/Targets.cpp
clang/lib/Basic/Targets/OSTargets.h
clang/lib/Basic/Targets/X86.h
clang/lib/Driver/CMakeLists.txt
clang/lib/Driver/Driver.cpp
clang/unittests/Driver/ToolChainTest.cpp

Removed: 




diff  --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index 0b8e565345b6a4..4917ef015941be 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -613,6 +613,9 @@ std::unique_ptr AllocateTarget(const 
llvm::Triple &Triple,
 case llvm::Triple::Solaris:
   return std::make_unique>(Triple,
Opts);
+case llvm::Triple::UEFI:
+  return std::make_unique(Triple, Opts);
+
 case llvm::Triple::Win32: {
   switch (Triple.getEnvironment()) {
   case llvm::Triple::Cygnus:

diff  --git a/clang/lib/Basic/Targets/OSTargets.h 
b/clang/lib/Basic/Targets/OSTargets.h
index 0a4f06967fff5a..a83d6464e789d6 100644
--- a/clang/lib/Basic/Targets/OSTargets.h
+++ b/clang/lib/Basic/Targets/OSTargets.h
@@ -778,6 +778,21 @@ class LLVM_LIBRARY_VISIBILITY ZOSTargetInfo : public 
OSTargetInfo {
   }
 };
 
+// UEFI target
+template 
+class LLVM_LIBRARY_VISIBILITY UEFITargetInfo : public OSTargetInfo {
+protected:
+  void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
+MacroBuilder &Builder) const override {}
+
+public:
+  UEFITargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
+  : OSTargetInfo(Triple, Opts) {
+this->WCharType = TargetInfo::UnsignedShort;
+this->WIntType = TargetInfo::UnsignedShort;
+  }
+};
+
 void addWindowsDefines(const llvm::Triple &Triple, const LangOptions &Opts,
MacroBuilder &Builder);
 

diff  --git a/clang/lib/Basic/Targets/X86.h b/clang/lib/Basic/Targets/X86.h
index 79fd5867cf6673..a99ae62984c7d5 100644
--- a/clang/lib/Basic/Targets/X86.h
+++ b/clang/lib/Basic/Targets/X86.h
@@ -814,6 +814,43 @@ class LLVM_LIBRARY_VISIBILITY X86_64TargetInfo : public 
X86TargetInfo {
   }
 };
 
+// x86-64 UEFI target
+class LLVM_LIBRARY_VISIBILITY UEFIX86_64TargetInfo
+: public UEFITargetInfo {
+public:
+  UEFIX86_64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
+  : UEFITargetInfo(Triple, Opts) {
+this->TheCXXABI.set(TargetCXXABI::Microsoft);
+this->MaxTLSAlign = 8192u * this->getCharWidth();
+this->resetDataLayout("e-m:w-p270:32:32-p271:32:32-p272:64:64-"
+  "i64:64-i128:128-f80:128-n8:16:32:64-S128");
+  }
+
+  void getTargetDefines(const LangOptions &Opts,
+MacroBuilder &Builder) const override {
+getOSDefines(Opts, X86TargetInfo::getTriple(), Builder);
+  }
+
+  BuiltinVaListKind getBuiltinVaListKind() const override {
+return TargetInfo::CharPtrBuiltinVaList;
+  }
+
+  CallingConvCheckResult checkCallingConvention(CallingConv CC) const override 
{
+switch (CC) {
+case CC_C:
+case CC_Win64:
+  return CCCR_OK;
+default:
+  return CCCR_Warning;
+}
+  }
+
+  TargetInfo::CallingConvKind
+  getCallingConvKind(bool ClangABICompat4) const override {
+return CCK_MicrosoftWin64;
+  }
+};
+
 // x86-64 Windows target
 class LLVM_LIBRARY_VISIBILITY WindowsX86_64TargetInfo
 : public WindowsTargetInfo {

diff  --git a/clang/lib/Driver/CMakeLists.txt b/clang/lib/Driver/CMakeLists.txt
index 32a4378ab499fa..4fd10bf671512f 100644
--- a/clang/lib/Driver/CMakeLists.txt
+++ b/clang/lib/Driver/CMakeLists.txt
@@ -78,6 +78,7 @@ add_clang_library(clangDriver
   ToolChains/Solaris.cpp
   ToolChains/SPIRV.cpp
   ToolChains/TCE.cpp
+  ToolChains/UEFI.cpp
   ToolChains/VEToolchain.cpp
   ToolChains/WebAssembly.cpp
   ToolChains/XCore.cpp

diff  --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 1c64ceabad1bf4..44548fa9d706fb 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -45,6 +45,7 @@
 #include "ToolChains/SPIRV.h"
 #include "ToolChains/Solaris.h"
 #include "ToolChains/TCE.h"
+#include "ToolChains/UEFI.h"
 #include "ToolChains/VEToolchain.h"
 #include "ToolChains/WebAssembly.h"
 #include "ToolChains/XCore.h"
@@ -6422,6 +6423,9 @@ const ToolChain &Driver::getToolChain(const ArgList &Args,
 case llvm::Tr

[llvm-branch-commits] [libcxx] [libc++] Follow-up to "Poison Pills are Too Toxic" (PR #109291)

2024-09-19 Thread A. Jiang via llvm-branch-commits

https://github.com/frederick-vs-ja edited 
https://github.com/llvm/llvm-project/pull/109291
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] release/19.x: [ELF] --icf: don't fold a section without relocation and a section with relocations for SHT_CREL (PR #109309)

2024-09-19 Thread via llvm-branch-commits

https://github.com/llvmbot updated 
https://github.com/llvm/llvm-project/pull/109309

>From 235eb6b8cd6fc7bfbda079ce1ab0339c8452dafe Mon Sep 17 00:00:00 2001
From: Fangrui Song 
Date: Wed, 18 Sep 2024 23:06:12 -0700
Subject: [PATCH] [ELF] --icf: don't fold a section without relocation and a
 section with relocations for SHT_CREL

Similar to commit 686cff17cc310884e48ae963bf7507f96950cc90 for SHT_REL (#57693).
CREL hasn't been tested with ICF before.

And avoid a pitfall that eqClass[0] might interfere with ICF.

(cherry picked from commit e82f0838ae88ad69515ebec234765e3e2607bebf)
---
 lld/ELF/ICF.cpp  | 4 ++--
 lld/ELF/InputSection.cpp | 6 +++---
 lld/ELF/InputSection.h   | 4 
 lld/test/ELF/icf10.s | 3 +++
 4 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/lld/ELF/ICF.cpp b/lld/ELF/ICF.cpp
index 44e8a71cc62869..5591c5e71e0b1a 100644
--- a/lld/ELF/ICF.cpp
+++ b/lld/ELF/ICF.cpp
@@ -324,7 +324,7 @@ bool ICF::equalsConstant(const InputSection *a, const 
InputSection *b) {
 
   const RelsOrRelas ra = a->template relsOrRelas();
   const RelsOrRelas rb = b->template relsOrRelas();
-  if (ra.areRelocsCrel())
+  if (ra.areRelocsCrel() || rb.areRelocsCrel())
 return constantEq(a, ra.crels, b, rb.crels);
   return ra.areRelocsRel() || rb.areRelocsRel()
  ? constantEq(a, ra.rels, b, rb.rels)
@@ -376,7 +376,7 @@ template 
 bool ICF::equalsVariable(const InputSection *a, const InputSection *b) {
   const RelsOrRelas ra = a->template relsOrRelas();
   const RelsOrRelas rb = b->template relsOrRelas();
-  if (ra.areRelocsCrel())
+  if (ra.areRelocsCrel() || rb.areRelocsCrel())
 return variableEq(a, ra.crels, b, rb.crels);
   return ra.areRelocsRel() || rb.areRelocsRel()
  ? variableEq(a, ra.rels, b, rb.rels)
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index 570e485455bade..a165c813d4259c 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -150,12 +150,12 @@ RelsOrRelas InputSectionBase::relsOrRelas(bool 
supportsCrel) const {
 InputSectionBase *const &relSec = f->getSections()[relSecIdx];
 // Otherwise, allocate a buffer to hold the decoded RELA relocations. When
 // called for the first time, relSec is null (without --emit-relocs) or an
-// InputSection with zero eqClass[0].
-if (!relSec || !cast(relSec)->eqClass[0]) {
+// InputSection with false decodedCrel.
+if (!relSec || !cast(relSec)->decodedCrel) {
   auto *sec = makeThreadLocal(*f, shdr, name);
   f->cacheDecodedCrel(relSecIdx, sec);
   sec->type = SHT_RELA;
-  sec->eqClass[0] = SHT_RELA;
+  sec->decodedCrel = true;
 
   RelocsCrel entries(sec->content_);
   sec->size = entries.size() * sizeof(typename ELFT::Rela);
diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h
index 6659530a9c9c26..afa6ee5bd0826f 100644
--- a/lld/ELF/InputSection.h
+++ b/lld/ELF/InputSection.h
@@ -176,6 +176,10 @@ class InputSectionBase : public SectionBase {
 
   mutable bool compressed = false;
 
+  // Whether this section is SHT_CREL and has been decoded to RELA by
+  // relsOrRelas.
+  bool decodedCrel = false;
+
   // Whether the section needs to be padded with a NOP filler due to
   // deleteFallThruJmpInsn.
   bool nopFiller = false;
diff --git a/lld/test/ELF/icf10.s b/lld/test/ELF/icf10.s
index 3c18c431c3b9da..ff926d0e16b103 100644
--- a/lld/test/ELF/icf10.s
+++ b/lld/test/ELF/icf10.s
@@ -5,6 +5,9 @@
 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-freebsd %s -o %t.o
 # RUN: ld.lld --icf=all %t.o -o /dev/null --print-icf-sections 2>&1 | 
FileCheck %s
 
+# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o --crel
+# RUN: ld.lld --icf=all %t.o -o /dev/null --print-icf-sections 2>&1 | 
FileCheck %s
+
 # Checks that ICF does not merge 2 sections the offset of
 # the relocations of which differ.
 

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


[llvm-branch-commits] [libcxx] [libc++] Follow-up to "Poison Pills are Too Toxic" (PR #109291)

2024-09-19 Thread A. Jiang via llvm-branch-commits


@@ -992,6 +992,7 @@ def add_version_header(tc):
 "name": "__cpp_lib_ranges",
 "values": {
 "c++20": 202207,
+"c++23": 202211,  # P2602R2 Poison Pills are Too Toxic

frederick-vs-ja wrote:

(Not strictly related to this PR) I think the value is fine in C++23 mode, but 
perhaps it should be `202110L` in C++20 mode as explained in #101715.

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


[llvm-branch-commits] [clang] [llvm] [clang][OpenMP] Prototype #2 of directive splitting (PR #109288)

2024-09-19 Thread via llvm-branch-commits

github-actions[bot] wrote:




:warning: C/C++ code formatter, clang-format found issues in your code. 
:warning:



You can test this locally with the following command:


``bash
git-clang-format --diff bba25fe832489086d6a0b63c399c82057e1d3cfc 
915fe94064e727d3e75127ab4cb1786226297250 --extensions cpp,h -- 
clang/lib/Sema/SemaOpenMPExt.cpp clang/lib/Sema/SemaOpenMPExt.h 
clang/include/clang/AST/OpenMPClause.h clang/include/clang/AST/Stmt.h 
clang/include/clang/Basic/OpenMPKinds.h clang/include/clang/Sema/SemaOpenMP.h 
clang/lib/AST/Stmt.cpp clang/lib/Basic/OpenMPKinds.cpp 
clang/lib/CodeGen/CGStmtOpenMP.cpp clang/lib/Parse/ParseOpenMP.cpp 
clang/lib/Sema/SemaExpr.cpp clang/lib/Sema/SemaOpenMP.cpp 
clang/lib/Sema/TreeTransform.h 
llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h 
llvm/include/llvm/Frontend/OpenMP/OMP.h llvm/lib/Frontend/OpenMP/OMP.cpp
``





View the diff from clang-format here.


``diff
diff --git a/clang/include/clang/Sema/SemaOpenMP.h 
b/clang/include/clang/Sema/SemaOpenMP.h
index ced79e3df9..f8d9eb93d9 100644
--- a/clang/include/clang/Sema/SemaOpenMP.h
+++ b/clang/include/clang/Sema/SemaOpenMP.h
@@ -1432,9 +1432,9 @@ public:
 
 VariableImplicitInfo &include(const VariableImplicitInfo &Other);
 
-  #ifndef NDEBUG
+#ifndef NDEBUG
 bool empty() const;
-  #endif
+#endif
 
   private:
 std::pair getDecl(Expr *E);
diff --git a/llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h 
b/llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h
index e15f78909d..5b5960da9d 100644
--- a/llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h
+++ b/llvm/include/llvm/Frontend/OpenMP/ConstructDecompositionT.h
@@ -96,7 +96,8 @@ struct ConstructDecompositionT {
   llvm::omp::Directive dir,
   llvm::ArrayRef clauses,
   bool makeImplicit = true)
-  : version(ver), construct(dir), makeImplicit(makeImplicit), 
helper(helper) {
+  : version(ver), construct(dir), makeImplicit(makeImplicit),
+helper(helper) {
 for (const ClauseTy &clause : clauses)
   nodes.push_back(&clause);
 
@@ -253,7 +254,7 @@ private:
 
   uint32_t version;
   llvm::omp::Directive construct;
-  bool makeImplicit;   // Whether to create implicit clauses.
+  bool makeImplicit; // Whether to create implicit clauses.
   HelperType &helper;
   ListT leafs;
   tomp::ListT nodes;

``




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


[llvm-branch-commits] [libcxx] [libc++] Follow-up to "Poison Pills are Too Toxic" (PR #109291)

2024-09-19 Thread Louis Dionne via llvm-branch-commits

https://github.com/ldionne created 
https://github.com/llvm/llvm-project/pull/109291

* Update release notes and `Cxx23.html`
* Update `__cpp_lib_ranges` feature test macro

Cherry-pick of #88383 for LLVM 19.

>From 9558a97c93be4fb957a82476f5fc1861aff1ed5d Mon Sep 17 00:00:00 2001
From: Jakub Mazurkiewicz 
Date: Wed, 10 Apr 2024 23:12:22 +0200
Subject: [PATCH] [libc++] Follow-up to "Poison Pills are Too Toxic"

* Update release notes and `Cxx23.html`
* Update `__cpp_lib_ranges` feature test macro
---
 libcxx/docs/FeatureTestMacroTable.rst| 2 ++
 libcxx/docs/ReleaseNotes/19.rst  | 1 +
 libcxx/docs/Status/Cxx23.rst | 1 +
 libcxx/docs/Status/Cxx23Papers.csv   | 2 +-
 libcxx/include/version   | 5 -
 .../algorithm.version.compile.pass.cpp   | 9 +
 .../functional.version.compile.pass.cpp  | 9 +
 .../iterator.version.compile.pass.cpp| 9 +
 .../memory.version.compile.pass.cpp  | 9 +
 .../ranges.version.compile.pass.cpp  | 9 +
 .../version.version.compile.pass.cpp | 9 +
 libcxx/utils/generate_feature_test_macro_components.py   | 1 +
 12 files changed, 40 insertions(+), 26 deletions(-)

diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index a1506e115fe70f..7f95f0f4e1c17c 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -350,6 +350,8 @@ Status
 -- 
-
 ``__cpp_lib_print````202207L``
 -- 
-
+``__cpp_lib_ranges``   ``202211L``
+-- 
-
 ``__cpp_lib_ranges_as_const``  *unimplemented*
 -- 
-
 ``__cpp_lib_ranges_as_rvalue`` ``202207L``
diff --git a/libcxx/docs/ReleaseNotes/19.rst b/libcxx/docs/ReleaseNotes/19.rst
index 92896f6b0d11e7..26210ddb274e5f 100644
--- a/libcxx/docs/ReleaseNotes/19.rst
+++ b/libcxx/docs/ReleaseNotes/19.rst
@@ -77,6 +77,7 @@ Implemented Papers
 - P2602R2 - Poison Pills are Too Toxic
 - P1981R0 - Rename ``leap`` to ``leap_second``
 - P1982R0 - Rename ``link`` to ``time_zone_link``
+- P2602R2 - Poison Pills are Too Toxic (as DR against C++20)
 
 
 Improvements and New Features
diff --git a/libcxx/docs/Status/Cxx23.rst b/libcxx/docs/Status/Cxx23.rst
index 23d30c8128d71e..8c1cae8b3e3b2f 100644
--- a/libcxx/docs/Status/Cxx23.rst
+++ b/libcxx/docs/Status/Cxx23.rst
@@ -44,6 +44,7 @@ Paper Status
.. [#note-P1413R3] P1413R3: ``std::aligned_storage_t`` and 
``std::aligned_union_t`` are marked deprecated, but
   clang doesn't issue a diagnostic for deprecated using template 
declarations.
.. [#note-P2520R0] P2520R0: Libc++ implemented this paper as a DR in C++20 
as well.
+   .. [#note-P2602R2] P2602R2: Libc++ implemented this paper as a DR in C++20 
as well.
.. [#note-P2711R1] P2711R1: ``join_with_view`` hasn't been done yet since 
this type isn't implemented yet.
.. [#note-P2770R0] P2770R0: ``join_with_view`` hasn't been done yet since 
this type isn't implemented yet.
.. [#note-P2693R1] P2693R1: The formatter for ``std::thread::id`` is 
implemented.
diff --git a/libcxx/docs/Status/Cxx23Papers.csv 
b/libcxx/docs/Status/Cxx23Papers.csv
index 92f4908487ae72..f46bb844532029 100644
--- a/libcxx/docs/Status/Cxx23Papers.csv
+++ b/libcxx/docs/Status/Cxx23Papers.csv
@@ -100,7 +100,7 @@
 "`P2396R1 `__","LWG", "Concurrency TS 2 fixes ", 
"November 2022","","","|concurrency TS|"
 "`P2505R5 `__","LWG", "Monadic Functions for 
``std::expected``", "November 2022","|Complete|","17.0",""
 "`P2539R4 `__","LWG", "Should the output of 
``std::print`` to a terminal be synchronized with the underlying stream?", 
"November 2022","|Complete|","18.0","|format|"
-"`P2602R2 `__","LWG", "Poison Pills are Too Toxic", 
"November 2022","|Complete|","19.0","|ranges|"
+"`P2602R2 `__","LWG", "Poison Pills are Too Toxic", 
"November 2022","|Complete| [#note-P2602R2]_","19.0","|ranges| |DR|"
 "`P2708R1 `__","LWG", "No Further Fundamentals 
TSes", "November 2022","|Nothing to do|","",""
 "","","","","","",""
 "`P0290R4 `__","LWG", "``apply()`` for 
``synchronized_value``","February 2023","","","|concurrency TS|"
diff --git a/libcxx/include/version b/libcxx/include/version
index fe64343eafbc9c..c8a31f77a915e1 100644
--- 

[llvm-branch-commits] [libcxx] [libc++] Follow-up to "Poison Pills are Too Toxic" (PR #109291)

2024-09-19 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)


Changes

* Update release notes and `Cxx23.html`
* Update `__cpp_lib_ranges` feature test macro

Cherry-pick of #88383 for LLVM 19.

---
Full diff: https://github.com/llvm/llvm-project/pull/109291.diff


12 Files Affected:

- (modified) libcxx/docs/FeatureTestMacroTable.rst (+2) 
- (modified) libcxx/docs/ReleaseNotes/19.rst (+1) 
- (modified) libcxx/docs/Status/Cxx23.rst (+1) 
- (modified) libcxx/docs/Status/Cxx23Papers.csv (+1-1) 
- (modified) libcxx/include/version (+4-1) 
- (modified) 
libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.compile.pass.cpp
 (+5-4) 
- (modified) 
libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.compile.pass.cpp
 (+5-4) 
- (modified) 
libcxx/test/std/language.support/support.limits/support.limits.general/iterator.version.compile.pass.cpp
 (+5-4) 
- (modified) 
libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.compile.pass.cpp
 (+5-4) 
- (modified) 
libcxx/test/std/language.support/support.limits/support.limits.general/ranges.version.compile.pass.cpp
 (+5-4) 
- (modified) 
libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
 (+5-4) 
- (modified) libcxx/utils/generate_feature_test_macro_components.py (+1) 


``diff
diff --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index a1506e115fe70f..7f95f0f4e1c17c 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -350,6 +350,8 @@ Status
 -- 
-
 ``__cpp_lib_print````202207L``
 -- 
-
+``__cpp_lib_ranges``   ``202211L``
+-- 
-
 ``__cpp_lib_ranges_as_const``  *unimplemented*
 -- 
-
 ``__cpp_lib_ranges_as_rvalue`` ``202207L``
diff --git a/libcxx/docs/ReleaseNotes/19.rst b/libcxx/docs/ReleaseNotes/19.rst
index 92896f6b0d11e7..26210ddb274e5f 100644
--- a/libcxx/docs/ReleaseNotes/19.rst
+++ b/libcxx/docs/ReleaseNotes/19.rst
@@ -77,6 +77,7 @@ Implemented Papers
 - P2602R2 - Poison Pills are Too Toxic
 - P1981R0 - Rename ``leap`` to ``leap_second``
 - P1982R0 - Rename ``link`` to ``time_zone_link``
+- P2602R2 - Poison Pills are Too Toxic (as DR against C++20)
 
 
 Improvements and New Features
diff --git a/libcxx/docs/Status/Cxx23.rst b/libcxx/docs/Status/Cxx23.rst
index 23d30c8128d71e..8c1cae8b3e3b2f 100644
--- a/libcxx/docs/Status/Cxx23.rst
+++ b/libcxx/docs/Status/Cxx23.rst
@@ -44,6 +44,7 @@ Paper Status
.. [#note-P1413R3] P1413R3: ``std::aligned_storage_t`` and 
``std::aligned_union_t`` are marked deprecated, but
   clang doesn't issue a diagnostic for deprecated using template 
declarations.
.. [#note-P2520R0] P2520R0: Libc++ implemented this paper as a DR in C++20 
as well.
+   .. [#note-P2602R2] P2602R2: Libc++ implemented this paper as a DR in C++20 
as well.
.. [#note-P2711R1] P2711R1: ``join_with_view`` hasn't been done yet since 
this type isn't implemented yet.
.. [#note-P2770R0] P2770R0: ``join_with_view`` hasn't been done yet since 
this type isn't implemented yet.
.. [#note-P2693R1] P2693R1: The formatter for ``std::thread::id`` is 
implemented.
diff --git a/libcxx/docs/Status/Cxx23Papers.csv 
b/libcxx/docs/Status/Cxx23Papers.csv
index 92f4908487ae72..f46bb844532029 100644
--- a/libcxx/docs/Status/Cxx23Papers.csv
+++ b/libcxx/docs/Status/Cxx23Papers.csv
@@ -100,7 +100,7 @@
 "`P2396R1 `__","LWG", "Concurrency TS 2 fixes ", 
"November 2022","","","|concurrency TS|"
 "`P2505R5 `__","LWG", "Monadic Functions for 
``std::expected``", "November 2022","|Complete|","17.0",""
 "`P2539R4 `__","LWG", "Should the output of 
``std::print`` to a terminal be synchronized with the underlying stream?", 
"November 2022","|Complete|","18.0","|format|"
-"`P2602R2 `__","LWG", "Poison Pills are Too Toxic", 
"November 2022","|Complete|","19.0","|ranges|"
+"`P2602R2 `__","LWG", "Poison Pills are Too Toxic", 
"November 2022","|Complete| [#note-P2602R2]_","19.0","|ranges| |DR|"
 "`P2708R1 `__","LWG", "No Further Fundamentals 
TSes", "November 2022","|Nothing to do|","",""
 "","","","","","",""
 "`P0290R4 `__","LWG", "``apply()`` for 
``synchronized_value``","February 2023","","","|concurrency TS|"
diff --git a/libcxx/include/version b/libcxx/include/version
index fe6434

[llvm-branch-commits] [libcxx] [libc++] Follow-up to "Poison Pills are Too Toxic" (PR #109291)

2024-09-19 Thread Louis Dionne via llvm-branch-commits

ldionne wrote:

CC @JMazurkiewicz @frederick-vs-ja 

@frederick-vs-ja Does the FTM change seem correct to you? IIUC this should have 
been done before the LLVM 19 branch but it slipped through the cracks, so this 
ought to be correct?

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


[llvm-branch-commits] [libcxx] [libc++] Follow-up to "Poison Pills are Too Toxic" (PR #109291)

2024-09-19 Thread Louis Dionne via llvm-branch-commits

https://github.com/ldionne milestoned 
https://github.com/llvm/llvm-project/pull/109291
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] release/19.x: [ELF] --icf: don't fold a section without relocation and a section with relocations for SHT_CREL (PR #109309)

2024-09-19 Thread via llvm-branch-commits

https://github.com/llvmbot created 
https://github.com/llvm/llvm-project/pull/109309

Backport e82f0838ae88ad69515ebec234765e3e2607bebf

Requested by: @MaskRay

>From 119843a88fc06832df46a423d0d0de6e28a60b43 Mon Sep 17 00:00:00 2001
From: Fangrui Song 
Date: Wed, 18 Sep 2024 23:06:12 -0700
Subject: [PATCH] [ELF] --icf: don't fold a section without relocation and a
 section with relocations for SHT_CREL

Similar to commit 686cff17cc310884e48ae963bf7507f96950cc90 for SHT_REL (#57693).
CREL hasn't been tested with ICF before.

And avoid a pitfall that eqClass[0] might interfere with ICF.

(cherry picked from commit e82f0838ae88ad69515ebec234765e3e2607bebf)
---
 lld/ELF/ICF.cpp  | 4 ++--
 lld/ELF/InputSection.cpp | 6 +++---
 lld/ELF/InputSection.h   | 4 
 lld/test/ELF/icf10.s | 3 +++
 4 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/lld/ELF/ICF.cpp b/lld/ELF/ICF.cpp
index 44e8a71cc62869..5591c5e71e0b1a 100644
--- a/lld/ELF/ICF.cpp
+++ b/lld/ELF/ICF.cpp
@@ -324,7 +324,7 @@ bool ICF::equalsConstant(const InputSection *a, const 
InputSection *b) {
 
   const RelsOrRelas ra = a->template relsOrRelas();
   const RelsOrRelas rb = b->template relsOrRelas();
-  if (ra.areRelocsCrel())
+  if (ra.areRelocsCrel() || rb.areRelocsCrel())
 return constantEq(a, ra.crels, b, rb.crels);
   return ra.areRelocsRel() || rb.areRelocsRel()
  ? constantEq(a, ra.rels, b, rb.rels)
@@ -376,7 +376,7 @@ template 
 bool ICF::equalsVariable(const InputSection *a, const InputSection *b) {
   const RelsOrRelas ra = a->template relsOrRelas();
   const RelsOrRelas rb = b->template relsOrRelas();
-  if (ra.areRelocsCrel())
+  if (ra.areRelocsCrel() || rb.areRelocsCrel())
 return variableEq(a, ra.crels, b, rb.crels);
   return ra.areRelocsRel() || rb.areRelocsRel()
  ? variableEq(a, ra.rels, b, rb.rels)
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index 570e485455bade..a165c813d4259c 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -150,12 +150,12 @@ RelsOrRelas InputSectionBase::relsOrRelas(bool 
supportsCrel) const {
 InputSectionBase *const &relSec = f->getSections()[relSecIdx];
 // Otherwise, allocate a buffer to hold the decoded RELA relocations. When
 // called for the first time, relSec is null (without --emit-relocs) or an
-// InputSection with zero eqClass[0].
-if (!relSec || !cast(relSec)->eqClass[0]) {
+// InputSection with false decodedCrel.
+if (!relSec || !cast(relSec)->decodedCrel) {
   auto *sec = makeThreadLocal(*f, shdr, name);
   f->cacheDecodedCrel(relSecIdx, sec);
   sec->type = SHT_RELA;
-  sec->eqClass[0] = SHT_RELA;
+  sec->decodedCrel = true;
 
   RelocsCrel entries(sec->content_);
   sec->size = entries.size() * sizeof(typename ELFT::Rela);
diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h
index 6659530a9c9c26..afa6ee5bd0826f 100644
--- a/lld/ELF/InputSection.h
+++ b/lld/ELF/InputSection.h
@@ -176,6 +176,10 @@ class InputSectionBase : public SectionBase {
 
   mutable bool compressed = false;
 
+  // Whether this section is SHT_CREL and has been decoded to RELA by
+  // relsOrRelas.
+  bool decodedCrel = false;
+
   // Whether the section needs to be padded with a NOP filler due to
   // deleteFallThruJmpInsn.
   bool nopFiller = false;
diff --git a/lld/test/ELF/icf10.s b/lld/test/ELF/icf10.s
index 3c18c431c3b9da..ff926d0e16b103 100644
--- a/lld/test/ELF/icf10.s
+++ b/lld/test/ELF/icf10.s
@@ -5,6 +5,9 @@
 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-freebsd %s -o %t.o
 # RUN: ld.lld --icf=all %t.o -o /dev/null --print-icf-sections 2>&1 | 
FileCheck %s
 
+# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o --crel
+# RUN: ld.lld --icf=all %t.o -o /dev/null --print-icf-sections 2>&1 | 
FileCheck %s
+
 # Checks that ICF does not merge 2 sections the offset of
 # the relocations of which differ.
 

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


[llvm-branch-commits] [lld] release/19.x: [ELF] --icf: don't fold a section without relocation and a section with relocations for SHT_CREL (PR #109309)

2024-09-19 Thread via llvm-branch-commits

https://github.com/llvmbot milestoned 
https://github.com/llvm/llvm-project/pull/109309
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lld] release/19.x: [ELF] --icf: don't fold a section without relocation and a section with relocations for SHT_CREL (PR #109309)

2024-09-19 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-lld-elf

Author: None (llvmbot)


Changes

Backport e82f0838ae88ad69515ebec234765e3e2607bebf

Requested by: @MaskRay

---
Full diff: https://github.com/llvm/llvm-project/pull/109309.diff


4 Files Affected:

- (modified) lld/ELF/ICF.cpp (+2-2) 
- (modified) lld/ELF/InputSection.cpp (+3-3) 
- (modified) lld/ELF/InputSection.h (+4) 
- (modified) lld/test/ELF/icf10.s (+3) 


``diff
diff --git a/lld/ELF/ICF.cpp b/lld/ELF/ICF.cpp
index 44e8a71cc62869..5591c5e71e0b1a 100644
--- a/lld/ELF/ICF.cpp
+++ b/lld/ELF/ICF.cpp
@@ -324,7 +324,7 @@ bool ICF::equalsConstant(const InputSection *a, const 
InputSection *b) {
 
   const RelsOrRelas ra = a->template relsOrRelas();
   const RelsOrRelas rb = b->template relsOrRelas();
-  if (ra.areRelocsCrel())
+  if (ra.areRelocsCrel() || rb.areRelocsCrel())
 return constantEq(a, ra.crels, b, rb.crels);
   return ra.areRelocsRel() || rb.areRelocsRel()
  ? constantEq(a, ra.rels, b, rb.rels)
@@ -376,7 +376,7 @@ template 
 bool ICF::equalsVariable(const InputSection *a, const InputSection *b) {
   const RelsOrRelas ra = a->template relsOrRelas();
   const RelsOrRelas rb = b->template relsOrRelas();
-  if (ra.areRelocsCrel())
+  if (ra.areRelocsCrel() || rb.areRelocsCrel())
 return variableEq(a, ra.crels, b, rb.crels);
   return ra.areRelocsRel() || rb.areRelocsRel()
  ? variableEq(a, ra.rels, b, rb.rels)
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index 570e485455bade..a165c813d4259c 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -150,12 +150,12 @@ RelsOrRelas InputSectionBase::relsOrRelas(bool 
supportsCrel) const {
 InputSectionBase *const &relSec = f->getSections()[relSecIdx];
 // Otherwise, allocate a buffer to hold the decoded RELA relocations. When
 // called for the first time, relSec is null (without --emit-relocs) or an
-// InputSection with zero eqClass[0].
-if (!relSec || !cast(relSec)->eqClass[0]) {
+// InputSection with false decodedCrel.
+if (!relSec || !cast(relSec)->decodedCrel) {
   auto *sec = makeThreadLocal(*f, shdr, name);
   f->cacheDecodedCrel(relSecIdx, sec);
   sec->type = SHT_RELA;
-  sec->eqClass[0] = SHT_RELA;
+  sec->decodedCrel = true;
 
   RelocsCrel entries(sec->content_);
   sec->size = entries.size() * sizeof(typename ELFT::Rela);
diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h
index 6659530a9c9c26..afa6ee5bd0826f 100644
--- a/lld/ELF/InputSection.h
+++ b/lld/ELF/InputSection.h
@@ -176,6 +176,10 @@ class InputSectionBase : public SectionBase {
 
   mutable bool compressed = false;
 
+  // Whether this section is SHT_CREL and has been decoded to RELA by
+  // relsOrRelas.
+  bool decodedCrel = false;
+
   // Whether the section needs to be padded with a NOP filler due to
   // deleteFallThruJmpInsn.
   bool nopFiller = false;
diff --git a/lld/test/ELF/icf10.s b/lld/test/ELF/icf10.s
index 3c18c431c3b9da..ff926d0e16b103 100644
--- a/lld/test/ELF/icf10.s
+++ b/lld/test/ELF/icf10.s
@@ -5,6 +5,9 @@
 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-freebsd %s -o %t.o
 # RUN: ld.lld --icf=all %t.o -o /dev/null --print-icf-sections 2>&1 | 
FileCheck %s
 
+# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o --crel
+# RUN: ld.lld --icf=all %t.o -o /dev/null --print-icf-sections 2>&1 | 
FileCheck %s
+
 # Checks that ICF does not merge 2 sections the offset of
 # the relocations of which differ.
 

``




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