[PATCH] D159490: Fix warning in MSVC

2023-09-11 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi added a comment. In D159490#4643199 , @erichkeane wrote: > Fixed in 6c0b9e357617 > . I > didn't verify ahead of time, but hopefully the bots will yell at ME this ti

[PATCH] D159490: Fix warning in MSVC

2023-09-11 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi added a comment. In D159490#4643191 , @fdeazeve wrote: > I think this may have broken builds: > > worktrees/src1/clang/lib/AST/DeclPrinter.cpp:293:48: error: function > definition is not allowed here > static bool mustPrintOnLeftSid

[PATCH] D159490: Fix warning in MSVC

2023-09-08 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi created this revision. giulianobelinassi added reviewers: aaron.ballman, erichkeane. Herald added a project: All. giulianobelinassi requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Currently there is no `PrintOnLeft` attrib

[PATCH] D157191: Improve dumps of attributes

2023-09-08 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi updated this revision to Diff 556319. giulianobelinassi added a comment. Fix warning in MSVC Summary: Currently there is no `PrintOnLeft` attribute set, which results in an empty switch-case. When compiling this, MSVC issues a warning saying that the switch-case is empty. Fix th

[PATCH] D141714: Fix ast print of variables with attributes

2023-09-08 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi added inline comments. Comment at: clang/lib/AST/DeclPrinter.cpp:269-276 +static bool mustPrintOnLeftSide(attr::Kind kind) { + switch (kind) { +#include "clang/Basic/AttrLeftSideMustPrintList.inc" +return true; + default: +return false; + } --

[PATCH] D141714: Fix ast print of variables with attributes

2023-09-07 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi updated this revision to Diff 556197. giulianobelinassi added a comment. Fix `dangling-else` compilation warning. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141714/new/ https://reviews.llvm.org/D141714 Files: clang/include/c

[PATCH] D141714: Fix ast print of variables with attributes

2023-09-07 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi added inline comments. Comment at: clang/lib/AST/DeclPrinter.cpp:312 + // printing on the left side for readbility. +else if (const VarDecl *VD = dyn_cast(D); + VD && VD->getInit() && erichkeane wrote: > While

[PATCH] D141714: Fix ast print of variables with attributes

2023-09-07 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi added a comment. In D141714#4638225 , @erichkeane wrote: > Looks fine to me, please don't commit for a day or two to give @aaron.ballman > a chance to make a final comment. I am sorry, but how am I supposed to commit those changes to

[PATCH] D141714: Fix ast print of variables with attributes

2023-09-03 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi updated this revision to Diff 555642. giulianobelinassi added a comment. Apply @erichkeane suggestions Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141714/new/ https://reviews.llvm.org/D141714 Files: clang/include/clang/Basic/

[PATCH] D141714: Fix ast print of variables with attributes

2023-08-28 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi added a comment. Ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141714/new/ https://reviews.llvm.org/D141714 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[PATCH] D157394: [clang][DeclPrinter] Improve AST print of function attributes

2023-08-09 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi added inline comments. Comment at: clang/lib/AST/DeclPrinter.cpp:259 +case attr::Final: +case attr::Override: + return AttrLocation::AfterDecl; aaron.ballman wrote: > giulianobelinassi wrote: > > @aaron.ballman @erichkeane > > > >

[PATCH] D157394: [clang][DeclPrinter] Improve AST print of function attributes

2023-08-09 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi added subscribers: erichkeane, giulianobelinassi. giulianobelinassi added a comment. This patch do not address attributes in variables nor the __declspec case, as D141714 do. His patch looks cleaner and I can surely coordinate with @strimo378

[PATCH] D141714: Fix ast print of variables with attributes

2023-08-05 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi added a comment. Hello, It took me a while, but here it is the newer version of the patch with the tablegen stuff. Please reach to me if something needs to be changed in this regard. This also improves the readability of declarations of variables that have a parenthesis cons

[PATCH] D141714: Fix ast print of variables with attributes

2023-08-05 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi updated this revision to Diff 547477. giulianobelinassi added a comment. Herald added subscribers: wangpc, s.egerton, simoncook, asb. - Use tblgen to generate table of attributes that can or must be print on the left side of the Decl. - Use LLVM_MARK_AS_BITMASK_ENUM on AttrPrint

[PATCH] D157191: Improve dumps of attributes

2023-08-05 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi abandoned this revision. giulianobelinassi added a comment. This was open by mistake. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157191/new/ https://reviews.llvm.org/D157191 ___ cfe-

[PATCH] D157191: Improve dumps of attributes

2023-08-05 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi created this revision. Herald added subscribers: s.egerton, simoncook, asb. Herald added a reviewer: aaron.ballman. Herald added a project: All. giulianobelinassi requested review of this revision. Herald added a reviewer: jdoerfert. Herald added subscribers: cfe-commits, wangpc,

[PATCH] D141714: Fix ast print of variables with attributes

2023-05-17 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi marked 4 inline comments as done and 2 inline comments as done. giulianobelinassi added a comment. I will update the patch with the suggestions and send them again. Comment at: clang/lib/AST/DeclPrinter.cpp:270 + + // FIXME: Find a way to use the AttrLis

[PATCH] D141714: Fix ast print of variables with attributes

2023-05-13 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi added a comment. @aaron.ballman Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141714/new/ https://reviews.llvm.org/D141714 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[PATCH] D141714: Fix ast print of variables with attributes

2023-05-03 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi updated this revision to Diff 519131. giulianobelinassi added a comment. Incorporate some of Aron suggestions: - Replace isDeclspecAttribute with isStandardAttributeSyntax - Avoid multiple calls to getAsFunction - Use AttrPrintLoc:: instead of referencing the value directly - Al

[PATCH] D141714: Fix ast print of variables with attributes

2023-05-03 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi added a comment. Hi. See inline answers. I will send the new version in a few minutes. Comment at: clang/lib/AST/DeclPrinter.cpp:52-58 +enum AttrPrintLoc { + SIDE_NONE = 0, + SIDE_LEFT = 1, + SIDE_MIDDLE = 2, + SIDE_RIGHT = 4, + SI

[PATCH] D141714: Fix ast print of variables with attributes

2023-04-17 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi updated this revision to Diff 514473. giulianobelinassi added a comment. Herald added a reviewer: jdoerfert. Herald added subscribers: jplehr, sstefan1. Update patch with the agreements of last discussion. This new version includes code to handle the cases presented by Aron, wh

[PATCH] D141714: Fix ast print of variables with attributes

2023-03-07 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi added a comment. Hi, Aron. Just to make myself clear: What I need to do is that the clang dumps for C files are also accepted by GCC as input. Here is why I wanted to output the attribute on middle: https://godbolt.org/z/6aPc6aWcz As you can see, GCC complains of `__attribut

[PATCH] D141714: Fix ast print of variables with attributes

2023-03-07 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi added a comment. Hi, Alan. Thanks for your review again! With regard to middle, the patch sent in D145269 may answer your questions. Basically functions like: int* f(void) __attribute__((unused)); would be output as int* __attribute__(

[PATCH] D145269: Dump functions attribute right before their return type

2023-03-03 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi created this revision. Herald added a project: All. giulianobelinassi requested review of this revision. Herald added a reviewer: jdoerfert. Herald added subscribers: cfe-commits, sstefan1. Herald added a project: clang. GCC rejects the following kind of dumps: int f(void) __att

[PATCH] D141714: Fix ast print of variables with attributes

2023-03-02 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi updated this revision to Diff 501835. giulianobelinassi edited the summary of this revision. giulianobelinassi added a comment. Update to dump attributes right after the type specification, also fixing the __declspec case. Repository: rG LLVM Github Monorepo CHANGES SINCE LA

[PATCH] D141714: Fix ast print of variables with attributes

2023-01-24 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi added a comment. > The way Clang handles this is to mostly go back to the original source code > (through the source manager and source location information) to grab what the > user actually wrote. The pretty printing functionality loses information like > whether something

[PATCH] D141714: Fix ast print of variables with attributes

2023-01-24 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi added a comment. In D141714#4077204 , @aaron.ballman wrote: > In D141714#4077199 , > @giulianobelinassi wrote: > >> In D141714#4077150 , >> @aaron.bal

[PATCH] D141714: Fix ast print of variables with attributes

2023-01-24 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi added a comment. In D141714#4077150 , @aaron.ballman wrote: > Thank you for the fix! > > It looks like precommit CI found a related failure that needs to be > addressed: > https://buildkite.com/llvm-project/premerge-checks/builds/1305

[PATCH] D141714: Fix ast print of variables with attributes

2023-01-13 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi created this revision. Herald added a project: All. giulianobelinassi requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Previously clang AST prints the following declaration: int fun_var_unused() { int x __attribute__((u

[PATCH] D135784: Add option to reparse an ASTUnit keeping its SourceManager

2022-10-12 Thread Giuliano Belinassi via Phabricator via cfe-commits
giulianobelinassi created this revision. Herald added a project: All. giulianobelinassi requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. When issuing a reparse, the SourceManager is then rebuilt from the FileMgr object it had in ASTUnit. Thi