[modules] Correctly parse LateParsedTemplates in case of dependent modules.
authorVaibhav Garg <gargvaibhav64@gmail.com>
Fri, 4 Sep 2020 10:49:11 +0000 (10:49 +0000)
committerVassil Vassilev <v.g.vassilev@gmail.com>
Fri, 4 Sep 2020 11:39:04 +0000 (11:39 +0000)
commit2c9dbcda4f71497d4a58020bb093af438fb6e967
tree4d227c347c3d82a4bafaa02353e21de3504b7a12
parent7582c5c023a8d6bff224e80dc5ded916122d8c99
[modules] Correctly parse LateParsedTemplates in case of dependent modules.

While parsing LateParsedTemplates, Clang assumes that the Global DeclID matches
with the Local DeclID of a Decl. This is not the case when we have multiple
dependent modules , each having their own LateParsedTemplate section. In such a
case, a Local/Global DeclID confusion occurs which leads to improper casting of
FunctionDecl's.

This commit creates a Vector to map the LateParsedTemplate section of each
Module with their module file and therefore resolving the Global/Local DeclID
confusion.

Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D86514
clang/include/clang/Serialization/ASTReader.h
clang/lib/Serialization/ASTReader.cpp