[PATCH] D143347: [lldb][DWARF] Infer no_unique_address attribute

Pavel Kosov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 20 20:43:52 PST 2023


kpdev42 added inline comments.


================
Comment at: clang/lib/AST/ASTImporter.cpp:3896
+  if (D->hasAttrs())
+    ToField->setAttrs(D->getAttrs());
   ToField->setAccess(D->getAccess());
----------------
balazske wrote:
> The import of attributes is handled in function `ASTImporter::Import(Decl*)`. This new line will probably copy all attributes, that may not work in all cases dependent on the attribute types. This may interfere with the later import of attributes, probably these will be duplicated. What was the need for this line? (Simple attributes that do not have references to other nodes could be copied at this place.)
Unfortunately it is too late to copy attribute in `ASTImporter::Import(Decl*)`, because field has already been added to record in a call to `ImportImpl (VisitFieldDecl/addDeclInternal)`. I've reused the current way of cloning attributes in `VisitFieldDecl`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143347



More information about the llvm-commits mailing list