[PATCH] D69360: [NFC] Refactor representation of materialized temporaries

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 29 09:38:55 PDT 2019


martong added inline comments.
Herald added a subscriber: rnkovacs.


================
Comment at: clang/lib/AST/ASTImporter.cpp:7004
+  // FIXME: Should ManglingNumber get numbers associated with 'to' context?
+  auto* To = MaterializeTemporaryDecl::Create(Temporary, ExtendingDecl,
+                                          D->getManglingNumber());
----------------
Could you please use `GetImportedOrCreateDecl<MaterializeTemporaryDecl>(...)` instead? We wrap every Decl creation in the ASTImporter so things that must be done right after creating a node is handled in one place.
Also, you can remove the next statement with `MapImported`.



================
Comment at: clang/lib/AST/ASTImporter.cpp:7021
   Expr *ToTemporaryExpr;
-  const ValueDecl *ToExtendingDecl;
-  std::tie(ToType, ToTemporaryExpr, ToExtendingDecl) = *Imp;
+  MaterializeTemporaryDecl *MaterialzedDecl;
+  std::tie(ToType, ToTemporaryExpr, MaterialzedDecl) = *Imp;
----------------
(An `i` is missing in `MaterialzedDecl`) And for consistency with the previous lines, perhaps it should be called as `ToMaterializedDecl`.


Repository:
  rC Clang

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

https://reviews.llvm.org/D69360





More information about the cfe-commits mailing list