v.g.vassilev created this revision. v.g.vassilev added reviewers: aaron.ballman, rjmccall, rsmith, junaire. Herald added a project: All. v.g.vassilev requested review of this revision.
Non-incremental Clang can also exit with the WeakRefReferences not empty upon such example. This patch makes clang-repl consistent to what Clang does. Repository: rC Clang 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 @@ -9,4 +9,7 @@ auto r4 = printf("bar() = %d\n", bar()); // CHECK: bar() = 42 +static int a() __attribute__((weakref("a"))); +int b = a(); + %quit Index: clang/lib/CodeGen/CodeGenModule.cpp =================================================================== --- clang/lib/CodeGen/CodeGenModule.cpp +++ clang/lib/CodeGen/CodeGenModule.cpp @@ -7232,7 +7232,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);
Index: clang/test/Interpreter/execute-weak.cpp =================================================================== --- clang/test/Interpreter/execute-weak.cpp +++ clang/test/Interpreter/execute-weak.cpp @@ -9,4 +9,7 @@ auto r4 = printf("bar() = %d\n", bar()); // CHECK: bar() = 42 +static int a() __attribute__((weakref("a"))); +int b = a(); + %quit Index: clang/lib/CodeGen/CodeGenModule.cpp =================================================================== --- clang/lib/CodeGen/CodeGenModule.cpp +++ clang/lib/CodeGen/CodeGenModule.cpp @@ -7232,7 +7232,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);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits