Skip to content

Commit 8116223

Browse files
HEIR Teamcopybara-github
authored andcommitted
Updates LLVM usage to match [909041e4802c](llvm/llvm-project@909041e4802c) PiperOrigin-RevId: 863352459
1 parent 4f72d4c commit 8116223

2 files changed

Lines changed: 47 additions & 1 deletion

File tree

bazel/extensions.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
66

77
def _llvm_deps_impl(_):
88
"""Implementation of the llvm_deps module extension."""
9-
LLVM_COMMIT = "d43b29fc545d702b35b20802f92357bc4c4177fe"
9+
LLVM_COMMIT = "909041e4802c4b9a2223ca04099f35bf1dbbd460"
1010

1111
# Download LLVM/MLIR using a git repository
1212
new_git_repository(

patches/llvm.patch

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,47 @@
11
Auto generated patch. Do not edit or delete it, even if empty.
2+
diff -ruN --strip-trailing-cr a/libcxx/include/stdatomic.h b/libcxx/include/stdatomic.h
3+
--- a/libcxx/include/stdatomic.h
4+
+++ b/libcxx/include/stdatomic.h
5+
@@ -231,7 +231,7 @@
6+
using std::atomic_signal_fence _LIBCPP_USING_IF_EXISTS;
7+
using std::atomic_thread_fence _LIBCPP_USING_IF_EXISTS;
8+
9+
-# elif defined(_LIBCPP_COMPILER_CLANG_BASED)
10+
+# elif !defined(__cplusplus) || defined(_LIBCPP_COMPILER_CLANG_BASED)
11+
12+
// Before C++23, we include the next <stdatomic.h> on the path to avoid hijacking
13+
// the header. We do this because Clang has historically shipped a <stdatomic.h>
14+
diff -ruN --strip-trailing-cr a/libcxx/test/extensions/libcxx/depr/depr.c.headers/include_stdatomic_as_c.sh.cpp b/libcxx/test/extensions/libcxx/depr/depr.c.headers/include_stdatomic_as_c.sh.cpp
15+
--- a/libcxx/test/extensions/libcxx/depr/depr.c.headers/include_stdatomic_as_c.sh.cpp
16+
+++ b/libcxx/test/extensions/libcxx/depr/depr.c.headers/include_stdatomic_as_c.sh.cpp
17+
@@ -0,0 +1,30 @@
18+
+//===----------------------------------------------------------------------===//
19+
+//
20+
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
21+
+// See https://llvm.org/LICENSE.txt for license information.
22+
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
23+
+//
24+
+//===----------------------------------------------------------------------===//
25+
+
26+
+// We're building as C, so this test doesn't work when building with modules.
27+
+// UNSUPPORTED: clang-modules-build
28+
+
29+
+// GCC complains about unrecognized arguments because we're compiling the
30+
+// file as C, but we're passing C++ flags on the command-line.
31+
+// UNSUPPORTED: gcc
32+
+
33+
+// Test that stdatomic.h gets the C header with its definitions.
34+
+
35+
+// NOTE: It's not common or recommended to have libc++ in the header search
36+
+// path when compiling C files, but it does happen often enough.
37+
+
38+
+// RUN: %{cxx} -c -xc %s -fsyntax-only %{flags} %{compile_flags} -std=c99
39+
+
40+
+#include <stdatomic.h>
41+
+
42+
+int main(int argc, char** argv) {
43+
+ (void)argc;
44+
+ (void)argv;
45+
+ [[maybe_unused]] atomic_bool x;
46+
+ return 0;
47+
+}

0 commit comments

Comments
 (0)