Ted Kremenek [Wed, 5 Mar 2008 05:05:04 +0000 (05:05 +0000)]
Reverted patch 47926 for ProgramPoint.h because it is currently buggy. May add back (fixed) later.
Updated CFGStmtVisitor to be in accord with rr47913: CallExprs are no longer (automatically) block-level expressions in the CFG.
Chris Lattner [Wed, 5 Mar 2008 01:18:20 +0000 (01:18 +0000)]
Remove the first layer of support for "portability" warnings. This is
theoretically useful, but not useful in practice. It adds a bunch of
complexity, and not much value. It's best to nuke it. One big advantage
is that it means the target interfaces will soon lose their SLoc arguments
and target queries can never emit diagnostics anymore (yay). Removing this
also simplifies some of the core preprocessor which should make it slightly
faster.
Ted, I didn't simplify TripleProcessor, which can now have at most one
triple, and can probably just be removed. Please poke at it when you have
time.
Ted Kremenek [Wed, 5 Mar 2008 00:59:43 +0000 (00:59 +0000)]
Added support for ProgramPoints to represent ExplodedNodes in another
ExplodedGraph. This allows us to build "layered" ExplodedGraphs where one
simulation is layered on another.
Ted Kremenek [Wed, 5 Mar 2008 00:33:14 +0000 (00:33 +0000)]
Plug-in transfer function "EvalCall" now takes as an argument the current
GRStmtNodeBuilder and is now responsible for adding its own nodes to the graph.
Ted Kremenek [Wed, 5 Mar 2008 00:11:33 +0000 (00:11 +0000)]
Cleaned up typedefs involving StateTy so that we always use "StateTy*" instead of StateTy.
This is conceptually much cleaner, as it shows that the state is always a pointer.
It also makes it easier to marshall these values around across the internal APIs
of the path-sensitive engine.
Ted Kremenek [Tue, 4 Mar 2008 23:39:43 +0000 (23:39 +0000)]
Moved implementation of GRExprEngine::Nodify into GRStmtNodeBuilder. This will
allow us to pass the builder to plug-in transfer functions and allow those
functions to create intermediate nodes.
Ted Kremenek [Tue, 4 Mar 2008 23:13:06 +0000 (23:13 +0000)]
Moved GRExprEngine::NodeSet out of GRExprEngine and made it a standalone class: ExplodedNodeSet.
Made GRExprEngine::NodeSet a typedef of ExplodedNodeSet.
Ted Kremenek [Tue, 4 Mar 2008 20:40:11 +0000 (20:40 +0000)]
For the transfer function of DeclStmt, for now initialize the values of
structs (local variables) to Unknown instead of Undefined. (added FIXME to initialize *members* of struct to undefined)
Ted Kremenek [Tue, 4 Mar 2008 17:47:18 +0000 (17:47 +0000)]
TargetInfo objects now own the TargetInfoImpl objects they refer to.
TargetInfo::AddSecondaryTarget is now private, as it is only used during
object construction.
Anders Carlsson [Mon, 3 Mar 2008 19:34:30 +0000 (19:34 +0000)]
Temporarily rename mmintrin.h so that it won't clash with the system header. It will be renamed back once the few remaining methods have been implemented.
Chris Lattner [Mon, 3 Mar 2008 03:16:03 +0000 (03:16 +0000)]
Find clang headers in the clang headers dir, search it before
the system headers dir. This produces an annoying warning:
clang.cpp:883: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object
Chris Lattner [Sat, 1 Mar 2008 08:07:28 +0000 (08:07 +0000)]
Add support for the CPATH, C_INCLUDE_PATH, CPLUS_INCLUDE_PATH,
OBJC_INCLUDE_PATH, and OBJCPLUS_INCLUDE_PATH environment variables.
Patch by Sam Bishop!
Ted Kremenek [Fri, 29 Feb 2008 23:14:48 +0000 (23:14 +0000)]
Add checks for function calls via a function pointer that is NULL, Undefined,
or otherwise a constant integer value that doesn't evaluate to an address.
Ted Kremenek [Thu, 28 Feb 2008 20:38:16 +0000 (20:38 +0000)]
Added simple hack to reduce redundant warnings from the checker:
Cache the location of the error. Don't emit the same
warning for the same error type that occurs at the same program
location but along a different path.
Ted Kremenek [Thu, 28 Feb 2008 20:32:03 +0000 (20:32 +0000)]
Added checking for undefined results of '<<' and '>>' (shifting by too many bits, etc.)
This current implementation only works when both operands are concrete values; later we will add support for symbolic values.
Ted Kremenek [Wed, 27 Feb 2008 19:21:33 +0000 (19:21 +0000)]
Small tweaks to the transfer function for DeclStmt: do not mark external global
variables as uninitialized, and only "initialize" static function variables.
Ted Kremenek [Wed, 27 Feb 2008 18:39:48 +0000 (18:39 +0000)]
Removed VarDecl::hasStaticStorage() (redundant with hasGlobalStorage())
Removed VarDecl::hasAutoStorage() (only used by hasLocalStorage())
Merged logic from VarDecl::hasAutoStorage() into VarDecl::hasLocalStorage(),
and expanded (fixed) the logic of hasLocalStorage() to handle Extern and PrivateExtern.
Renamed Expr::hasStaticStorage() to Expr::hasGlobalStorage().
Ted Kremenek [Wed, 27 Feb 2008 00:46:25 +0000 (00:46 +0000)]
Similar bug fix to r47650; when processing CallExprs if we did not generate an
ExplodedNode for the Callee subexpression we would not evaluate the CallExpr
transfer function.
Ted Kremenek [Wed, 27 Feb 2008 00:44:11 +0000 (00:44 +0000)]
Fixed bug in the core transfer function logic for CallExprs where we would
sometimes skip evaluating all the arguments when some arguments would not
create new ExplodedNodes.
Ted Kremenek [Wed, 27 Feb 2008 00:28:17 +0000 (00:28 +0000)]
Fixed CFG construction bug that occurred when a condition for a loop spanned
multiple basic blocks (which can happen when they contain '&&', '||', '?'). The
bug was that the loop backedge when to the last block in the loop condition, not
the first.
Ted Kremenek [Tue, 26 Feb 2008 23:04:29 +0000 (23:04 +0000)]
Added boilerplate for plug-in transfer function support for CallExprs.
GRSimpleVals performs the following action: invalidate all values passed-by-reference.
Ted Kremenek [Tue, 26 Feb 2008 21:57:11 +0000 (21:57 +0000)]
Changed VarDecl::hasGlobalStorage() to be the negation of hasLocalStorage().
Before it was the negation of hasAutoStorage(), which is incorrect.
"Register" storage for Decls do not indicate global variables.
Ted Kremenek [Tue, 26 Feb 2008 21:31:18 +0000 (21:31 +0000)]
Removed static analysis-specific diagnostics from DiagnosticKinds.def.
Use custom diagnostics for static analysis checkers. Added warnings
for dereferencing uninitialized values and divide-by-zeroes.
Ted Kremenek [Tue, 26 Feb 2008 21:04:29 +0000 (21:04 +0000)]
Removed hack with toggling the signedness flag of the APSInt stored
in an EnumConstantDecl. This was made possible because of a recent fix
in the parser:
Ted Kremenek [Tue, 26 Feb 2008 19:05:15 +0000 (19:05 +0000)]
Major cleanup of the transfer function logic for '&&', '||', and '?'. We
now store in the state essentially which branch we took. This removes
a bunch of bogus assumptions (and likely bugs), reduces the complexity of
the implementation, and facilitates more optimizations.
Chris Lattner [Tue, 26 Feb 2008 00:33:57 +0000 (00:33 +0000)]
Fix PR2092 by making sure the sign of the enum value follows the
sign of its type in the early exit case. No testcase, because this
doesn't manifest as a failure.