[PATCH] D63640: [clang] Improve Serialization/Imporing of APValues

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 2 07:01:40 PDT 2020


martong added inline comments.


================
Comment at: clang/lib/AST/ASTImporter.cpp:9010
+      ToPath[Idx] =
+          cast<const CXXRecordDecl>(const_cast<Decl *>(ImpDecl.get()));
+    }
----------------
Tyker wrote:
> rsmith wrote:
> > We want the path in an `APValue` to be canonical, but importing a canonical decl might result in a non-canonical decl.
> > but importing a canonical decl might result in a non-canonical decl.
> this is a quite surprising behavior.
> > but importing a canonical decl might result in a non-canonical decl.
> this is a quite surprising behavior.

If you already have an existing redecl chain in the destination ASTContext (let's say A->B->C, A is the canonical decl), then importing a canonical decl (let's say D) would result an A->B->C->D' chain. Where D' is the imported version of D.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63640



More information about the cfe-commits mailing list