|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1 |
|
| #
c74ab84e |
| 11-Oct-2021 |
Nico Weber <[email protected]> |
[clang] Omit most AttributedStatements from the CFG
`[[clang::fallthrough]]` has meaning for the CFG, but all other StmtAttrs we currently have don't. So omit them, as AttributedStatements with chil
[clang] Omit most AttributedStatements from the CFG
`[[clang::fallthrough]]` has meaning for the CFG, but all other StmtAttrs we currently have don't. So omit them, as AttributedStatements with children cause several issues and there's no benefit in including them.
Fixes PR52103 and PR49454. See PR52103 for details.
Differential Revision: https://reviews.llvm.org/D111568
show more ...
|
|
Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2 |
|
| #
9ed4a94d |
| 17-Aug-2021 |
Nathan Chancellor <[email protected]> |
[clang] Expose unreachable fallthrough annotation warning
The Linux kernel has a macro called IS_ENABLED(), which evaluates to a constant 1 or 0 based on Kconfig selections, allowing C code to be un
[clang] Expose unreachable fallthrough annotation warning
The Linux kernel has a macro called IS_ENABLED(), which evaluates to a constant 1 or 0 based on Kconfig selections, allowing C code to be unconditionally enabled or disabled at build time. For example:
int foo(struct *a, int b) { switch (b) { case 1: if (a->flag || !IS_ENABLED(CONFIG_64BIT)) return 1; __attribute__((fallthrough)); case 2: return 2; default: return 3; } }
There is an unreachable warning about the fallthrough annotation in the first case because !IS_ENABLED(CONFIG_64BIT) can be evaluated to 1, which looks like
return 1; __attribute__((fallthrough));
to clang.
This type of warning is pointless for the Linux kernel because it does this trick all over the place due to the sheer number of configuration options that it has.
Add -Wunreachable-code-fallthrough, enabled under -Wunreachable-code, so that projects that want to warn on unreachable code get this warning but projects that do not care about unreachable code can still use -Wimplicit-fallthrough without having to make changes to their code base.
Fixes PR51094.
Reviewed By: aaron.ballman, nickdesaulniers
Differential Revision: https://reviews.llvm.org/D107933
show more ...
|
|
Revision tags: llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4 |
|
| #
1b4800c2 |
| 25-Mar-2021 |
Timm Bäder <[email protected]> |
[clang][parser] Set source ranges for GNU-style attributes
Set the source ranges for parsed GNU-style attributes in ParseGNUAttributes(), the same way that ParseCXX11Attributes() does it.
Different
[clang][parser] Set source ranges for GNU-style attributes
Set the source ranges for parsed GNU-style attributes in ParseGNUAttributes(), the same way that ParseCXX11Attributes() does it.
Differential Revision: https://reviews.llvm.org/D75844
show more ...
|
| #
908a267b |
| 01-Apr-2021 |
Timm Bäder <[email protected]> |
Revert "[clang][parser] Set source ranges for GNU-style attributes"
This reverts commit 1ea9fa8c507ec360cf43faf46d13b149e37c950d.
|
| #
1ea9fa8c |
| 25-Mar-2021 |
Timm Bäder <[email protected]> |
[clang][parser] Set source ranges for GNU-style attributes
Set the source ranges for parsed GNU-style attributes in ParseGNUAttributes(), the same way that ParseCXX11Attributes() does it.
Different
[clang][parser] Set source ranges for GNU-style attributes
Set the source ranges for parsed GNU-style attributes in ParseGNUAttributes(), the same way that ParseCXX11Attributes() does it.
Differential Revision: https://reviews.llvm.org/D75844
show more ...
|
| #
fa4e7297 |
| 19-Mar-2021 |
Aaron Ballman <[email protected]> |
Automate common diagnostic checking for statement attributes
Clang currently automates a fair amount of diagnostic checking for declaration attributes based on the declarations in Attr.td. It checks
Automate common diagnostic checking for statement attributes
Clang currently automates a fair amount of diagnostic checking for declaration attributes based on the declarations in Attr.td. It checks for things like subject appertainment, number of arguments, language options, etc. This patch uses the same machinery to perform diagnostic checking on statement attributes.
show more ...
|
|
Revision tags: llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3, llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2, llvmorg-10.0.1-rc1, llvmorg-10.0.0, llvmorg-10.0.0-rc6, llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4, llvmorg-10.0.0-rc3, llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1, llvmorg-11-init, llvmorg-9.0.1, llvmorg-9.0.1-rc3, llvmorg-9.0.1-rc2, llvmorg-9.0.1-rc1, llvmorg-9.0.0, llvmorg-9.0.0-rc6, llvmorg-9.0.0-rc5, llvmorg-9.0.0-rc4, llvmorg-9.0.0-rc3 |
|
| #
1e0affb6 |
| 20-Aug-2019 |
Nathan Huckleberry <[email protected]> |
[Attr] Support _attribute__ ((fallthrough))
Summary: Fixed extraneous matches of non-NullStmt
Reviewers: aaron.ballman, rsmith, efriedma, xbolva00
Reviewed By: aaron.ballman, rsmith, xbolva00
Sub
[Attr] Support _attribute__ ((fallthrough))
Summary: Fixed extraneous matches of non-NullStmt
Reviewers: aaron.ballman, rsmith, efriedma, xbolva00
Reviewed By: aaron.ballman, rsmith, xbolva00
Subscribers: riccibruno, arphaman, ziangwan, ojeda, xbolva00, nickdesaulniers, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64838
llvm-svn: 369414
show more ...
|
|
Revision tags: llvmorg-9.0.0-rc2, llvmorg-9.0.0-rc1, llvmorg-10-init, llvmorg-8.0.1, llvmorg-8.0.1-rc4, llvmorg-8.0.1-rc3, llvmorg-8.0.1-rc2, llvmorg-8.0.1-rc1, llvmorg-8.0.0, llvmorg-8.0.0-rc5, llvmorg-8.0.0-rc4, llvmorg-8.0.0-rc3, llvmorg-7.1.0, llvmorg-7.1.0-rc1, llvmorg-8.0.0-rc2, llvmorg-8.0.0-rc1, llvmorg-7.0.1, llvmorg-7.0.1-rc3 |
|
| #
ac77dcd7 |
| 09-Nov-2018 |
Aaron Ballman <[email protected]> |
Allow a double-underscore spelling of Clang attributes using double square bracket syntax.
This matches a similar behavior with GCC accepting [[gnu::__attr__]] as a alias for [[gnu::attr]] in that c
Allow a double-underscore spelling of Clang attributes using double square bracket syntax.
This matches a similar behavior with GCC accepting [[gnu::__attr__]] as a alias for [[gnu::attr]] in that clang attributes can now be spelled with two leading and trailing underscores.
I had always intended for this to work, but missed the critical bit. We already had an existing test in test/Preprocessor/has_attribute.cpp for [[clang::__fallthrough__]] but using that spelling would still give an "unknown attribute" diagnostic.
llvm-svn: 346547
show more ...
|
|
Revision tags: llvmorg-7.0.1-rc2, llvmorg-7.0.1-rc1, llvmorg-7.0.0, llvmorg-7.0.0-rc3, llvmorg-7.0.0-rc2, llvmorg-7.0.0-rc1, llvmorg-6.0.1, llvmorg-6.0.1-rc3, llvmorg-6.0.1-rc2, llvmorg-6.0.1-rc1, llvmorg-5.0.2, llvmorg-5.0.2-rc2, llvmorg-5.0.2-rc1, llvmorg-6.0.0, llvmorg-6.0.0-rc3, llvmorg-6.0.0-rc2, llvmorg-6.0.0-rc1, llvmorg-5.0.1, llvmorg-5.0.1-rc3, llvmorg-5.0.1-rc2, llvmorg-5.0.1-rc1, llvmorg-5.0.0, llvmorg-5.0.0-rc5, llvmorg-5.0.0-rc4, llvmorg-5.0.0-rc3, llvmorg-5.0.0-rc2, llvmorg-5.0.0-rc1, llvmorg-4.0.1, llvmorg-4.0.1-rc3, llvmorg-4.0.1-rc2, llvmorg-4.0.1-rc1, llvmorg-4.0.0, llvmorg-4.0.0-rc4, llvmorg-4.0.0-rc3, llvmorg-4.0.0-rc2, llvmorg-4.0.0-rc1, llvmorg-3.9.1, llvmorg-3.9.1-rc3, llvmorg-3.9.1-rc2, llvmorg-3.9.1-rc1, llvmorg-3.9.0, llvmorg-3.9.0-rc3, llvmorg-3.9.0-rc2, llvmorg-3.9.0-rc1, llvmorg-3.8.1, llvmorg-3.8.1-rc1 |
|
| #
4f902c7e |
| 08-Mar-2016 |
Richard Smith <[email protected]> |
P0188R1: add support for standard [[fallthrough]] attribute. This is almost exactly the same as clang's existing [[clang::fallthrough]] attribute, which has been updated to have the same semantics. T
P0188R1: add support for standard [[fallthrough]] attribute. This is almost exactly the same as clang's existing [[clang::fallthrough]] attribute, which has been updated to have the same semantics. The one significant difference is that [[fallthrough]] is ill-formed if it's not used immediately before a switch label (even when -Wimplicit-fallthrough is disabled). To support that, we now build a CFG of any function that uses a '[[fallthrough]];' statement to check.
In passing, fix some bugs with our support for statement attributes -- in particular, diagnose their use on declarations, rather than asserting.
llvm-svn: 262881
show more ...
|
|
Revision tags: llvmorg-3.8.0, llvmorg-3.8.0-rc3, llvmorg-3.8.0-rc2, llvmorg-3.8.0-rc1, llvmorg-3.7.1, llvmorg-3.7.1-rc2, llvmorg-3.7.1-rc1, llvmorg-3.7.0, llvmorg-3.7.0-rc4, llvmorg-3.7.0-rc3, llvmorg-3.7.0-rc2, llvmorg-3.7.0-rc1, llvmorg-3.6.2, llvmorg-3.6.2-rc1, llvmorg-3.6.1, llvmorg-3.6.1-rc1 |
|
| #
f2a39a7b |
| 13-Apr-2015 |
Nico Weber <[email protected]> |
Revert r234786, it contained a bunch of stuff I did not mean to commit.
llvm-svn: 234787
|
| #
b31abb05 |
| 13-Apr-2015 |
Nico Weber <[email protected]> |
Revert r234613 (and follow-ups 234614, 234616, 234618), it caused PR23216.
llvm-svn: 234786
|
|
Revision tags: llvmorg-3.5.2, llvmorg-3.5.2-rc1, llvmorg-3.6.0, llvmorg-3.6.0-rc4, llvmorg-3.6.0-rc3, llvmorg-3.6.0-rc2, llvmorg-3.6.0-rc1, llvmorg-3.5.1, llvmorg-3.5.1-rc2, llvmorg-3.5.1-rc1, llvmorg-3.5.0, llvmorg-3.5.0-rc4, llvmorg-3.5.0-rc3, llvmorg-3.5.0-rc2, llvmorg-3.5.0-rc1 |
|
| #
bf91164f |
| 24-Jun-2014 |
Alexander Kornienko <[email protected]> |
Fix "warning: fallthrough annotation does not directly precede switch label" in lambdas.
Summary: This patch fixes http://llvm.org/PR17864 - "warning: fallthrough annotation does not directly preced
Fix "warning: fallthrough annotation does not directly precede switch label" in lambdas.
Summary: This patch fixes http://llvm.org/PR17864 - "warning: fallthrough annotation does not directly precede switch label" in lambdas.
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: rnk, cfe-commits
Differential Revision: http://reviews.llvm.org/D4258
llvm-svn: 211599
show more ...
|
|
Revision tags: llvmorg-3.4.2, llvmorg-3.4.2-rc1, llvmorg-3.4.1, llvmorg-3.4.1-rc2, llvmorg-3.4.1-rc1 |
|
| #
cdf1108b |
| 27-Feb-2014 |
Nick Lewycky <[email protected]> |
As of r202325, CFGBlock predecessors may be NULL. Ignore such preds. Fixes a crasher, PR18983.
llvm-svn: 202340
|
|
Revision tags: llvmorg-3.4.0, llvmorg-3.4.0-rc3, llvmorg-3.4.0-rc2, llvmorg-3.4.0-rc1, llvmorg-3.3.1-rc1, llvmorg-3.3.0, llvmorg-3.3.0-rc3, llvmorg-3.3.0-rc2, llvmorg-3.3.0-rc1 |
|
| #
1e05e86d |
| 02-Apr-2013 |
Alexander Kornienko <[email protected]> |
Moved fallthrough regression test to switch-implicit-fallthrough.cpp.
llvm-svn: 178554
|
| #
c121b9b7 |
| 07-Feb-2013 |
Alexander Kornienko <[email protected]> |
-Wimplicit-fallthrough: fixed two cases where "fallthrough annotation in unreachable code" was issued incorrectly.
Summary: -Wimplicit-fallthrough: fixed two cases where "fallthrough annotation in u
-Wimplicit-fallthrough: fixed two cases where "fallthrough annotation in unreachable code" was issued incorrectly.
Summary: -Wimplicit-fallthrough: fixed two cases where "fallthrough annotation in unreachable code" was issued incorrectly:
1. In actual unreachable code, but not immediately on a fall-through execution path "fallthrough annotation does not directly precede switch label" is better; 2. After default: in a switch with covered enum cases. Actually, these shouldn't be treated as unreachable code for our purpose.
Reviewers: rsmith
Reviewed By: rsmith
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D374
llvm-svn: 174575
show more ...
|
| #
527fa4f2 |
| 01-Feb-2013 |
Alexander Kornienko <[email protected]> |
Fixed segmentation fault when a CFGBlock has NULL successor.
llvm-svn: 174182
|
| #
afed1ddb |
| 30-Jan-2013 |
Alexander Kornienko <[email protected]> |
Don't warn on fall-through from unreachable code.
Summary: A motivating example: class ClassWithDtor { public: ~ClassWithDtor() {} }; void fallthrough3(int n) { switch (n) { case 2: do
Don't warn on fall-through from unreachable code.
Summary: A motivating example: class ClassWithDtor { public: ~ClassWithDtor() {} }; void fallthrough3(int n) { switch (n) { case 2: do { ClassWithDtor temp; return; } while (0); // This generates a chain of unreachable CFG blocks. case 3: break; } }
Reviewers: rsmith, doug.gregor, alexfh
Reviewed By: alexfh
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D330
llvm-svn: 173889
show more ...
|
| #
09f15f3e |
| 25-Jan-2013 |
Alexander Kornienko <[email protected]> |
Silence unintended fallthrough diagnostic on a case label preceded with a normal label.
Summary: It's unlikely that a fallthrough is unintended in the following code: switch (n) { ... label: cas
Silence unintended fallthrough diagnostic on a case label preceded with a normal label.
Summary: It's unlikely that a fallthrough is unintended in the following code: switch (n) { ... label: case 1: ... goto label; ... }
Reviewers: rsmith, doug.gregor
Reviewed By: doug.gregor
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D329
llvm-svn: 173486
show more ...
|
| #
55488793 |
| 25-Jan-2013 |
Alexander Kornienko <[email protected]> |
Don't suggest to insert [[clang::fallthrough]] before empty cases. Fix for multiple case labels.
llvm-svn: 173458
|
|
Revision tags: llvmorg-3.2.0, llvmorg-3.2.0-rc3, llvmorg-3.2.0-rc2, llvmorg-3.2.0-rc1 |
|
| #
9a34889e |
| 20-Jun-2012 |
Alexander Kornienko <[email protected]> |
Added test with sizeof conditions (relies on to-be-implemented functionality of CFG, discussion: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120507/057370.html)
llvm-svn: 158854
|
| #
246e85dd |
| 26-May-2012 |
Alexander Kornienko <[email protected]> |
Don't offer '[[clang::fallthrough]];' fix-it when a fall-through occurs to a switch label immediately followed by a 'break;'.
llvm-svn: 157508
|
|
Revision tags: llvmorg-3.1.0, llvmorg-3.1.0-rc3 |
|
| #
84837d5b |
| 03-May-2012 |
Richard Smith <[email protected]> |
Add -Wimplicit-fallthrough warning flag, which warns on fallthrough between cases in switch statements. Also add a [[clang::fallthrough]] attribute, which can be used to suppress the warning in the c
Add -Wimplicit-fallthrough warning flag, which warns on fallthrough between cases in switch statements. Also add a [[clang::fallthrough]] attribute, which can be used to suppress the warning in the case of intentional fallthrough.
Patch by Alexander Kornienko!
The handling of C++11 attribute namespaces in this patch is temporary, and will be replaced with a cleaner mechanism in a subsequent patch.
llvm-svn: 156086
show more ...
|