[clang] ac6c5c5 - Reland "[clang-repl] Recover the lookup tables of the primary context."

Vassil Vassilev via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 24 01:36:06 PDT 2022


Author: Vassil Vassilev
Date: 2022-06-24T08:35:41Z
New Revision: ac6c5c5e8f20d0550d99778583b83c3856ea353b

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

LOG: Reland "[clang-repl] Recover the lookup tables of the primary context."

The asan issue was fixed in llvm/llvm-project at 7bc00ce5cd41

This reverts commit 575e297fcb289f0a9b0ac4b01d1d0fa051f5cc29.

Differential revision: https://reviews.llvm.org/D123674

Added: 
    

Modified: 
    clang/lib/Interpreter/IncrementalParser.cpp
    clang/test/Interpreter/execute.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Interpreter/IncrementalParser.cpp b/clang/lib/Interpreter/IncrementalParser.cpp
index e5712303cbbb2..122cf7b065bb0 100644
--- a/clang/lib/Interpreter/IncrementalParser.cpp
+++ b/clang/lib/Interpreter/IncrementalParser.cpp
@@ -191,7 +191,7 @@ IncrementalParser::ParseOrWrapTopLevelDecl() {
     S.TUScope->setEntity(PreviousTU);
 
     // Clean up the lookup table
-    if (StoredDeclsMap *Map = PreviousTU->getLookupPtr()) {
+    if (StoredDeclsMap *Map = PreviousTU->getPrimaryContext()->getLookupPtr()) {
       for (auto I = Map->begin(); I != Map->end(); ++I) {
         StoredDeclsList &List = I->second;
         DeclContextLookupResult R = List.getLookupResult();

diff  --git a/clang/test/Interpreter/execute.cpp b/clang/test/Interpreter/execute.cpp
index 61e68990acf96..f5d75074947d4 100644
--- a/clang/test/Interpreter/execute.cpp
+++ b/clang/test/Interpreter/execute.cpp
@@ -1,3 +1,4 @@
+// RUN: clang-repl "int x = 10;" "int y=7; err;" "int y = 10;"
 // 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
 // REQUIRES: host-supports-jit


        


More information about the cfe-commits mailing list