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

Eric Astor via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 9 10:36:00 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(),
----------------
ericastor wrote:

I think `StringArgument` only handles `StringRef`s? I don't see a way it could be given a dependent value.

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


More information about the cfe-commits mailing list