[PATCH] D148435: [clang-repl] Do not assert if we have weak references left.

Vassil Vassilev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 8 02:13:41 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG743ff9c8bad3: [clang-repl] Do not assert if we have weak references left. (authored by v.g.vassilev).
Herald added a project: clang.

Changed prior to commit:
  https://reviews.llvm.org/D148435?vs=520286&id=520305#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148435/new/

https://reviews.llvm.org/D148435

Files:
  clang/lib/CodeGen/CodeGenModule.cpp
  clang/test/Interpreter/execute-weak.cpp


Index: clang/test/Interpreter/execute-weak.cpp
===================================================================
--- clang/test/Interpreter/execute-weak.cpp
+++ clang/test/Interpreter/execute-weak.cpp
@@ -2,11 +2,17 @@
 // RUN: clang-repl "int i = 10;" 'extern "C" int printf(const char*,...);' \
 // RUN:            'auto r1 = printf("i = %d\n", i);' | FileCheck --check-prefix=CHECK-DRIVER %s
 // CHECK-DRIVER: i = 10
+//
 // UNSUPPORTED: system-aix, system-windows
 // RUN: cat %s | clang-repl | FileCheck %s
+
 extern "C" int printf(const char *, ...);
 int __attribute__((weak)) bar() { return 42; }
 auto r4 = printf("bar() = %d\n", bar());
 // CHECK: bar() = 42
 
+int a = 12;
+static __typeof(a) b __attribute__((__weakref__("a")));
+int c = b;
+
 %quit
Index: clang/lib/CodeGen/CodeGenModule.cpp
===================================================================
--- clang/lib/CodeGen/CodeGenModule.cpp
+++ clang/lib/CodeGen/CodeGenModule.cpp
@@ -7230,7 +7230,6 @@
          "Newly created module should not have manglings");
   NewBuilder->Manglings = std::move(Manglings);
 
-  assert(WeakRefReferences.empty() && "Not all WeakRefRefs have been applied");
   NewBuilder->WeakRefReferences = std::move(WeakRefReferences);
 
   NewBuilder->TBAA = std::move(TBAA);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148435.520305.patch
Type: text/x-patch
Size: 1276 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230508/1cfd3ca0/attachment.bin>


More information about the cfe-commits mailing list