Zhongxing Xu
2cd7a78c76
Introduce new CFGElement hierarchy to support C++ CFG, based on Marcin's patch
...
and discussions with Ted and Jordy.
llvm-svn: 114056
2010-09-16 01:25:47 +00:00
Ted Kremenek
50205744c3
Enhance -Wreturn-type to not warn when control-flow is most likely limited by a switch statement explicitly covering
...
all the cases for an enum value.
llvm-svn: 113450
2010-09-09 00:06:07 +00:00
John McCall
8302463dc6
Split out a header to hold APIs meant for the Sema implementation from Sema.h.
...
Clients of Sema don't need to know (for example) the list of diagnostics we
support.
llvm-svn: 112093
2010-08-25 22:03:47 +00:00
John McCall
28a0cf7825
Remove Sema.h's dependency on DeclCXX.h.
...
llvm-svn: 112032
2010-08-25 07:42:41 +00:00
John McCall
1d570a7e16
Remove AnalysisBasedWarnings.h's dependency on Type.h
...
llvm-svn: 112027
2010-08-25 05:56:39 +00:00
John McCall
de6836a384
Struggle mightily against header inclusion in Sema.h.
...
llvm-svn: 111904
2010-08-24 07:21:54 +00:00
Douglas Gregor
c3a6ade0bb
Move Sema's headers into include/clang/Sema, renaming a few along the way.
...
llvm-svn: 110945
2010-08-12 20:07:10 +00:00
Dan Gohman
28ade550f4
Fix namespace polution.
...
llvm-svn: 109440
2010-07-26 21:25:24 +00:00
Zhongxing Xu
eb2528104a
Fix construction of AnalysisContext. Thanks Daniel.
...
llvm-svn: 108694
2010-07-19 13:16:50 +00:00
Chandler Carruth
3b43338870
Add a hack to silence warnings about failing to return from functions after
...
a temporary with a noreturn destructor has been created. Fixes PR6884 for now.
llvm-svn: 104000
2010-05-17 23:51:52 +00:00
John McCall
5c6ec8c797
Don't emit any fallthrough / missing-noreturn warnings if we can't
...
compute a CFG for a function.
llvm-svn: 103905
2010-05-16 09:34:11 +00:00
Ted Kremenek
b802192a7e
Don't perform AnalysisBasedWarnings in Sema or run the static analyzer when a
...
fatal error has occurred.
llvm-svn: 102778
2010-04-30 21:49:25 +00:00
John McCall
5af1aa6393
An edge from a call expression to the exit block is only an abnormal edge
...
if *none* of the successors of the call expression is the exit block.
This matters when a call of bool type is the condition of (say) a while
loop in a function with no statements after the loop. This *can* happen
in C, but it's much more common in C++ because of overloaded operators.
Suppresses some substantial number of spurious -Wmissing-noreturn warnings.
llvm-svn: 102696
2010-04-30 07:10:06 +00:00
Douglas Gregor
24f27696db
If a non-noreturn virtual member function is guaranteed not to return,
...
do *not* suggest that the function could be attribute 'noreturn';
overridden functions may end up returning.
llvm-svn: 101572
2010-04-16 23:28:44 +00:00
Ted Kremenek
afed24b472
Remove micro-optimization for not issueing CFG-based warnings for 'static inline' functions
...
unless they are used. I discussed this with Daniel Dunbar, and we agreed that this
provides an inconsistent warnings experience for the user and that there were
genuine cases where we wouldn't want to do this optimization.
llvm-svn: 100800
2010-04-08 18:51:44 +00:00
Ted Kremenek
fc58c37b8c
Removed unused object.
...
llvm-svn: 100750
2010-04-08 07:30:50 +00:00
Ted Kremenek
465dffa736
Use SmallVector instead of an std::queue.
...
llvm-svn: 100730
2010-04-08 00:05:00 +00:00
Rafael Espindola
c50c27cca8
the big refactoring bits of PR3782.
...
This introduces FunctionType::ExtInfo to hold the calling convention and the
noreturn attribute. The next patch will extend it to include the regparm
attribute and fix the bug.
llvm-svn: 99920
2010-03-30 20:24:48 +00:00
Rafael Espindola
8756268ee5
Be a bit more consistent in using operator->
...
This patch moves some methods from QualType to Type and changes the users to
use -> instead of .
llvm-svn: 99805
2010-03-29 03:39:46 +00:00
Ted Kremenek
a3ab0d7666
For forward-declared static inline functions, delay CFG-based warnings until we
...
encounter a definition.
llvm-svn: 99243
2010-03-23 01:37:12 +00:00
Ted Kremenek
0b40532b5e
Only perform CFG-based warnings on 'static inline' functions that
...
are called (transitively) by regular functions/blocks within a
translation untion.
llvm-svn: 99233
2010-03-23 00:13:23 +00:00
Ted Kremenek
b45ebee521
Don't bother running the analysis for CFG-based warnings if the
...
declaration is in a system header.
llvm-svn: 99087
2010-03-20 21:11:09 +00:00
Ted Kremenek
918fe8498d
Refactor CFG-based warnings in Sema to be run by a worked object called AnalysisBasedWarnings.
...
This object controls when the warnings are executed, allowing the client code
in Sema to selectively disable warnings as needed.
Centralizing the logic for analysis-based warnings allows us to optimize
when and how they are run.
Along the way, remove the redundant logic for the 'check fall-through' warning
for blocks; now the same logic is used for both blocks and functions.
llvm-svn: 99085
2010-03-20 21:06:02 +00:00