[PATCH] D136886: [clang] [ASTImporter] RFC: Correct importer to not duplicate sugared types

Vince Bridgers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 29 03:39:50 PDT 2022


vabridgers added a comment.

In D136886#3892261 <https://reviews.llvm.org/D136886#3892261>, @balazske wrote:

> `ASTImporterLookupTable` do not contain an entry for `__va_list_tag`, I do not know why it is missing. If it is added "manually" the crash disappears (without fix in `VisitTypedefType`). Following code was used to add VaListTagDecl:
>
>   ASTImporterLookupTable::ASTImporterLookupTable(TranslationUnitDecl &TU) {
>     Builder B(*this);
>     B.TraverseDecl(&TU);
>     // Add __va_list_tag to the table, it is not visited by the builder.
>     if (NamedDecl *D = dyn_cast_or_null<NamedDecl>(TU.getASTContext().getVaListTagDecl()))
>       add(&TU, D);
>   }
>
> The problem probably existed before but did not have visible effect until the new assertion was added.

Nice find @balazske. Is this fix correct, and would you like to commandeer this crash for a correct fix? If so, we can wait for your patch and I'll just abandon this one. Thank you! - Vince


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136886



More information about the cfe-commits mailing list