MyDeveloperDay added a comment.

In D105479#2862819 <https://reviews.llvm.org/D105479#2862819>, @aaron.ballman 
wrote:

> Thank you for working on this!

So I looked into do what you suggested originally, but it became a little more 
involved, partially because you have to look inside the AttrbutedStmt but then 
getting the `{}` to cuddle the statement and not the attributes (and this means 
a lot more code has to be changed because you have to move the position of S to 
that statement so that you determine the correct place to put replacements, 
(and then this got way beyond my pay grade!)

So for this patch I was limiting it just to fixing the issue (that was actually 
incorrectly raised against #clang-format 
<https://reviews.llvm.org/tag/clang-format/> , hence why I'm here!)

I don't personally use the `[[likely]]` attributes yet so I wasn't completely 
sure of all the places it COULD be added.

For the case you raised I also don't believe it will do the correct thing,  
https://godbolt.org/z/xb1qrTe3j    infact it will generate:

  if (b) {
     [[likely]]
     return;
  }

Use https://godbolt.org/z/YzrKzKoTe then add -fix to the clang-tidy Arguments 
(it will destroy your original source)

Which I wasn't sure if this is then still valid syntax? Although it may compile 
I couldn't really tell if it was then being ignored.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105479

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to