[PATCH] D110528: [clang][ASTImporter] Add import of thread safety attributes.

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 27 06:04:01 PDT 2021


balazske added a comment.

The code can be made better in a way that only lines similar to

  Expected<Attr *> ToAttrOrErr = AI.createImportedAttr(
      From, AI.importArg(From->getSuccessValue()).value(),
      AI.importArrayArg(From->args(), From->args_size()).value(),
      From->args_size());

are needed. If there is an AttrVisitor the switch can be removed. No one import function is possible that works with every `Attr`, in the same way as there is a separate function for import of every `Stmt` (`Decl` and others are more complicated) there must be something for every `Attr` (if it has custom arguments). Even now the import of an `Attr` needs much less code than import of a `Stmt` (that could be done in similar way). There are cases that need special handling, like `AlignedAttr`. If the current code is included we can see enough cases to make a better generalization, but after splitting the **ASTImporter.cpp** into multiple files.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110528



More information about the cfe-commits mailing list