VitaNuo

Results comments of VitaNuo

I've tried to compare the deserialisation of A in the versions of code with and without the `preferred_name` attribute. The primary difference is that the version _without_ the attribute does...

Some elaboration on the reason why deserialization of the `string_view` typedef doesn't loop. At some point in the deserialization of the A module in Use.cppm, `VisitCXXRecordDecl` is called for the...

I've been trying to find the location where the two typedefs (global and imported) should be linked as one (imported) being a redeclaration of the other (global), but this doesn't...

Continuing on the previous comment, I believe that the linking of imported decls with their global counterparts happens in [`attachPreviousDecl`](https://github.com/llvm/llvm-project/blob/main/clang/lib/Serialization/ASTReaderDecl.cpp#L3556), which is triggered by [loading pending decl chains](https://github.com/llvm/llvm-project/blob/main/clang/lib/Serialization/ASTReader.cpp#L10091) (via [this](https://github.com/llvm/llvm-project/blob/main/clang/lib/Serialization/ASTReaderDecl.cpp#L4409)...

> We've also concluded they they are different because the [TypeForDecl](https://github.com/llvm/llvm-project/blob/6db1b2035bbef5ec477a1e645e249ebf7b29688c/clang/lib/AST/ASTContext.cpp#L5127) is assigned before we set the previous link for the redecl chain. Normally, this should not happen and it...

Also tried to assert that the types of `D` and the previous declaration are the same: ``` assert((TD->getTypeForDecl() == PTD->getTypeForDecl()) && "Types must be the same"); ``` In this case,...

> I think that the obvious fix would be to postpone deserializing and setting the preferred_name attribute with a mechanism similar to [PendingUpdateRecords](https://github.com/llvm/llvm-project/blob/6db1b2035bbef5ec477a1e645e249ebf7b29688c/clang/include/clang/Serialization/ASTReader.h#L562). I've looked in a bit more detail...

The other mechanisms (other than [PendingUpdateRecords](https://github.com/llvm/llvm-project/blob/6db1b2035bbef5ec477a1e645e249ebf7b29688c/clang/include/clang/Serialization/ASTReader.h#L562)) are, e.g., [PendingDeducedVarTypes](https://github.com/llvm/llvm-project/blob/6db1b2035bbef5ec477a1e645e249ebf7b29688c/clang/include/clang/Serialization/ASTReader.h#L1182) or [PendingDeclContextInfos](https://github.com/llvm/llvm-project/blob/6db1b2035bbef5ec477a1e645e249ebf7b29688c/clang/include/clang/Serialization/ASTReader.h#L1181). In my understanding, they allow to skip deserialization of a specific Decl or QualType. The way it works: -...

The linked PR delays reading the type source info of the preferred_name attribute. It does so by reading the type ID of the typedef from the Record stream, as well...