[PATCH] D123674: Clang-Repl Error Recovery Bug Fix

Vassil Vassilev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat May 28 22:00:16 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG5ff27fe1ff03: [clang-repl] Recover the lookup tables of the primary context. (authored by Purva-Chaudhari, committed by v.g.vassilev).
Herald added a project: clang.

Changed prior to commit:
  https://reviews.llvm.org/D123674?vs=422486&id=432767#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123674

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


Index: clang/test/Interpreter/execute.cpp
===================================================================
--- clang/test/Interpreter/execute.cpp
+++ 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
Index: clang/lib/Interpreter/IncrementalParser.cpp
===================================================================
--- clang/lib/Interpreter/IncrementalParser.cpp
+++ clang/lib/Interpreter/IncrementalParser.cpp
@@ -188,7 +188,7 @@
     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();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123674.432767.patch
Type: text/x-patch
Size: 1093 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220529/28864a48/attachment.bin>


More information about the cfe-commits mailing list