[PATCH] D95860: [clang][Frontend] Fix a crash in DiagnosticRenderer.

2021-02-16 Thread Balázs Kéri via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG085dcc82178f: [clang][Frontend] Fix a crash in DiagnosticRenderer. (authored by balazske). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D95860: [clang][Frontend] Fix a crash in DiagnosticRenderer.

2021-02-05 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 321685. balazske added a comment. Added explanation to source code. Added more test cases. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95860/new/ https://reviews.llvm.org/D95860 Files: clang/lib/Frontend/

[PATCH] D95860: [clang][Frontend] Fix a crash in DiagnosticRenderer.

2021-02-04 Thread Balázs Benics via Phabricator via cfe-commits
steakhal accepted this revision. steakhal added a comment. This revision is now accepted and ready to land. In D95860#2539453 , @balazske wrote: > Probably it is not worth to find a better solution. In the case of > CloneChecker the range starts and ends

[PATCH] D95860: [clang][Frontend] Fix a crash in DiagnosticRenderer.

2021-02-03 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. Probably it is not worth to find a better solution. In the case of CloneChecker the range starts and ends on different line that is not possible to print on a single line in the output. This code could work: // Then, crawl the expansion chain for the end of the range

[PATCH] D95860: [clang][Frontend] Fix a crash in DiagnosticRenderer.

2021-02-03 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. But I do not know if there is a better solution, if the file ID is different these are in different files, one included from the other. If the "include locations" are not accessible in the same way as macro locations we can not get the place (of the #include statement)

[PATCH] D95860: [clang][Frontend] Fix a crash in DiagnosticRenderer.

2021-02-03 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. I realized that the added test cases show different problems: One is when one of `Begin` or `End` is invalid, other if the FileID's are different. Probably we can find a better solution for the second problem. So the patch needs to be splitted and the case with the **c

[PATCH] D95860: [clang][Frontend] Fix a crash in DiagnosticRenderer.

2021-02-03 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D95860#2538802 , @balazske wrote: > Existing test moved to Frontend, added new test. Awesome, thanks! On the functional side of things, I'm not sure if we should skip or not. But simply skipping those seems like you are treat

[PATCH] D95860: [clang][Frontend] Fix a crash in DiagnosticRenderer.

2021-02-03 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 321041. balazske added a comment. Reformatting test file. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95860/new/ https://reviews.llvm.org/D95860 Files: clang/lib/Frontend/DiagnosticRenderer.cpp clang/te

[PATCH] D95860: [clang][Frontend] Fix a crash in DiagnosticRenderer.

2021-02-03 Thread Balázs Kéri via Phabricator via cfe-commits
balazske updated this revision to Diff 321039. balazske added a comment. Existing test moved to Frontend, added new test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95860/new/ https://reviews.llvm.org/D95860 Files: clang/lib/Frontend/Diagnost

[PATCH] D95860: [clang][Frontend] Fix a crash in DiagnosticRenderer.

2021-02-03 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. In D95860#2536721 , @balazske wrote: > In D95860#2536609 , @steakhal wrote: > >> Please, also add a regression test for Haoxin Tu's reproducer. >> >> // RUN: %clang %s >> >> // expec

[PATCH] D95860: [clang][Frontend] Fix a crash in DiagnosticRenderer.

2021-02-02 Thread Balázs Kéri via Phabricator via cfe-commits
balazske added a comment. In D95860#2536609 , @steakhal wrote: > Please, also add a regression test for Haoxin Tu's reproducer. > > // RUN: %clang %s > > // expected warning > volatile long a ( a .~b What about already the added test? Repos

[PATCH] D95860: [clang][Frontend] Fix a crash in DiagnosticRenderer.

2021-02-02 Thread Balázs Benics via Phabricator via cfe-commits
steakhal added a comment. Please, also add a regression test for Haoxin Tu's reproducer. // RUN: %clang %s // expected warning volatile long a ( a .~b Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95860/new/ https://reviews.llvm.org/D

[PATCH] D95860: [clang][Frontend] Fix a crash in DiagnosticRenderer.

2021-02-02 Thread Balázs Kéri via Phabricator via cfe-commits
balazske created this revision. Herald added subscribers: martong, gamesh411, Szelethus, dkrupp. Herald added a reviewer: Szelethus. balazske requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Displaying the problem range could crash if the be