[clang] [clang][frontend] Add support for attribute plugins for statement attributes (PR #110334)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 9 10:13:11 PDT 2024


================
@@ -2125,6 +2126,19 @@ TemplateInstantiator::TransformTemplateParmRefExpr(DeclRefExpr *E,
                                          Arg, PackIndex);
 }
 
+const AnnotateAttr *
+TemplateInstantiator::TransformAnnotateAttr(const AnnotateAttr *AA) {
+  SmallVector<Expr *> Args;
+  for (Expr *Arg : AA->args()) {
+    ExprResult Res = getDerived().TransformExpr(Arg);
+    if (!Res.isUsable())
+      return AA;
+    Args.push_back(Res.get());
+  }
+  return AnnotateAttr::CreateImplicit(getSema().Context, AA->getAnnotation(),
----------------
erichkeane wrote:

we probably want to transform the annotation as well?  or does `StringArgument` not work for dependent values?

https://github.com/llvm/llvm-project/pull/110334


More information about the cfe-commits mailing list