Skip to content

Commit c42c500

Browse files
alexander-penevvgvassilev
authored andcommitted
Backport a new patch D148435.
1 parent 7644cfa commit c42c500

File tree

4 files changed

+35
-1
lines changed

4 files changed

+35
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ jobs:
119119
cd llvm-project
120120
# Apply patches
121121
echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:"
122-
[ -f ../patches/llvm/clang${{ matrix.clang-runtime }}-*.patch ] && ls -1 ../patches/llvm/clang${{ matrix.clang-runtime }}-*.patch && git apply ../patches/llvm/clang${{ matrix.clang-runtime }}-*.patch
122+
compgen -G "../patches/llvm/clang${{ matrix.clang-runtime }}-*.patch" > /dev/null && find ../patches/llvm/clang${{ matrix.clang-runtime }}-*.patch -printf "%f\n" && git apply ../patches/llvm/clang${{ matrix.clang-runtime }}-*.patch
123123
# Build
124124
mkdir build
125125
cd build

patches/llvm/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
LLVM/Clang patches
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
2+
index 12d602fed693..e73102544361 100644
3+
--- a/clang/lib/CodeGen/CodeGenModule.cpp
4+
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
5+
@@ -7202,7 +7202,6 @@ void CodeGenModule::moveLazyEmissionStates(CodeGenModule *NewBuilder) {
6+
"Newly created module should not have manglings");
7+
NewBuilder->Manglings = std::move(Manglings);
8+
9+
- assert(WeakRefReferences.empty() && "Not all WeakRefRefs have been applied");
10+
NewBuilder->WeakRefReferences = std::move(WeakRefReferences);
11+
12+
NewBuilder->TBAA = std::move(TBAA);
13+
diff --git a/clang/test/Interpreter/execute-weak.cpp b/clang/test/Interpreter/execute-weak.cpp
14+
index 5b343512c545..66f2214ab03c 100644
15+
--- a/clang/test/Interpreter/execute-weak.cpp
16+
+++ b/clang/test/Interpreter/execute-weak.cpp
17+
@@ -2,11 +2,16 @@
18+
// RUN: clang-repl "int i = 10;" 'extern "C" int printf(const char*,...);' \
19+
// RUN: 'auto r1 = printf("i = %d\n", i);' | FileCheck --check-prefix=CHECK-DRIVER %s
20+
// CHECK-DRIVER: i = 10
21+
+//
22+
// UNSUPPORTED: system-aix, system-windows
23+
// RUN: cat %s | clang-repl | FileCheck %s
24+
+
25+
extern "C" int printf(const char *, ...);
26+
int __attribute__((weak)) bar() { return 42; }
27+
auto r4 = printf("bar() = %d\n", bar());
28+
// CHECK: bar() = 42
29+
30+
+int a = 12;
31+
+static __typeof(a) b __attribute__((__weakref__("a")));
32+
+int c = b;
33+
%quit

0 commit comments

Comments
 (0)