riccibruno marked 2 inline comments as done.
riccibruno added inline comments.


================
Comment at: clang/lib/AST/Decl.cpp:2032
+  // additional complexity needed to prevent this is not worthwhile.
+  OS << (Policy.MSVCFormatting ? '`' : '(')
+     << (IsAnonymousStructOrUnion ? "anonymous" : "unnamed") << ' '
----------------
erichkeane wrote:
> This pattern is happening a bunch too....  Does it deserve some function?  
> Perhaps a function that either takes Policy, or a member of Policy to get the 
> formatting open-tick or close-tick?
Do you mean a member function of `PrintingPolicy`, something like `getOpenTick` 
and `getCloseTick`?


================
Comment at: clang/lib/AST/Decl.cpp:2074
+  if (Policy.AnonymousTagLocations && !SuppressLocation) {
+    PresumedLoc PLoc = 
Ctx.getSourceManager().getPresumedLoc(DD->getLocation());
+    if (PLoc.isValid()) {
----------------
erichkeane wrote:
> It seems this entire block can be pulled out of these two functions.  This is 
> probably worth while?
> 
> It seems that in this function, it would be:
> 
> if (!SuppressLocation)
>     printLocation(....);
> 
> And in the other, just a call to PrintLocation(....).
Good point yes. I will do so.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84658



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

Reply via email to