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

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to