[PATCH] D12922: Add support for function attribute "notail"

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 1 17:32:24 PST 2015

aaron.ballman added inline comments.

Comment at: lib/Sema/SemaDecl.cpp:5374
@@ +5373,3 @@
+  // Virtual functions cannot be marked as 'notail'.
+  if (auto *Attr = ND.getAttr<NotTailCalledAttr>())
Is there a reason this is here instead of SemaDeclAttr.cpp? It seems like the decl passed in with the attribute attached to it should already be known to be virtual or not?

Comment at: test/Sema/attr-notail.c:8
@@ +7,2 @@
+  return a ? callee0() : callee1();
Missing a test case for the attribute being specified on something other than a function, and one for being passed arguments.

Comment at: test/SemaCXX/attr-notail.cpp:5
@@ +4,3 @@
+  [[clang::not_tail_called]] virtual int foo1(); // expected-error {{'not_tail_called' attribute cannot be applied to virtual function}}
+  virtual int foo2();
Missing the "s" on virtual functions.


More information about the cfe-commits mailing list