[PATCH] D104918: [clang-repl] Implement partial translation units and error recovery.

Raphael Isemann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 12 02:07:03 PDT 2021


teemperor added a comment.

@v.g.vassilev For LLDB you need to change the `TypeSystemClang::SetExternalSource` function to this (it just moves the `setHasExternalLexicalStorage` one line up. You can just add that change and the compilation fix to this commit.

  void TypeSystemClang::SetExternalSource(
      llvm::IntrusiveRefCntPtr<ExternalASTSource> &ast_source_up) {
    ASTContext &ast = getASTContext();
    ast.getTranslationUnitDecl()->setHasExternalLexicalStorage(true);
    ast.setExternalSource(ast_source_up);
  }

The problem is that a few ASTs in LLDB change the ExternalSource that is originally set, but the LazyGenerationalUpdatePtr remembers the initial ExternalSource and tries to access it to complete the redecl chain (but the original ExternalSource just got replaced and deleted). The better fix is to not even create that original ExternalSource, but I can fix that in a follow up as that seems out of scope for this patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104918



More information about the cfe-commits mailing list