Ted Kremenek
22bd628056
Fix some bonehead bugs in summary generation in CFRefCount.
...
llvm-svn: 49503
2008-04-10 22:58:08 +00:00
Ted Kremenek
4a78c3ae11
Refactored all logic to run the GRSimpleVals and CFRef checker into a common
...
code path in the clang driver.
Renamed options --grsimple to -checker-simple and -check-cfref to -checker-cfref.
llvm-svn: 49500
2008-04-10 22:16:52 +00:00
Chris Lattner
4fdfbf7b89
silence some warnings when assertions are disabled.
...
llvm-svn: 49372
2008-04-08 05:52:18 +00:00
Ted Kremenek
3bcfc6edc0
Better handling for tabs with message bubbles.
...
llvm-svn: 49001
2008-03-31 23:14:05 +00:00
Ted Kremenek
c27815ca82
Inlined clang/Analysis/Analyses/GRSimpleVals.h into LocalCheckers.h and removed
...
GRSimpleVals.h
Added a PathDiagnosticClient option to the driver functions for the
CFRefCountChecker and the GRSimpleVals analysis. Both analyses now accept a "-o"
argument from the driver that specifies where HTML reports should be dumped.
llvm-svn: 48989
2008-03-31 18:26:32 +00:00
Ted Kremenek
9c7deb8d25
Disable timing diagnostics for GRSimpleVals.
...
llvm-svn: 48981
2008-03-31 16:00:32 +00:00
Ted Kremenek
ed9f054a9c
Don't emit any timings for GRSimple if the CFG is not going to be built.
...
llvm-svn: 48882
2008-03-27 17:14:42 +00:00
Chris Lattner
5bb4ee20cd
clean up iteration over propertydecls.
...
llvm-svn: 48435
2008-03-17 01:24:41 +00:00
Chris Lattner
ed0e16404c
clean up property memory allocation to move it into the ast classes
...
like the rest of the classes.
llvm-svn: 48434
2008-03-17 01:19:02 +00:00
Chris Lattner
8d1c04f53a
Convert more counts to be zero based instead of -1 based, make them unsigned.
...
llvm-svn: 48429
2008-03-16 21:08:55 +00:00
Chris Lattner
011b0f5c5a
Make the parameter count of ObjCMethodDecl unsigned, you
...
can't have negative arguments.
llvm-svn: 48407
2008-03-16 01:07:14 +00:00
Ted Kremenek
9abb59f9cc
Emit warnings for undefined control-flow.
...
llvm-svn: 48368
2008-03-14 18:14:50 +00:00
Ted Kremenek
7b00d15bc5
Path-sensitive analyses no longer take a FunctionDecl, but any Decl representing
...
a block of "code".
Patched various ASTConsumers (such as ASTDumper) to have more support for
processing ObjCMethodDecl. CFGVisitor now builds CFGs for ObjCMethodDecls.
llvm-svn: 48363
2008-03-14 17:31:00 +00:00
Ted Kremenek
1fdd0a480e
The LiveVariables analysis no longer requires a FunctionDecl&; this allows it
...
to be run on other declarations of blocks of code (e.g., Objective-C methods.)
llvm-svn: 48339
2008-03-13 16:55:07 +00:00
Ted Kremenek
b64d183803
Added bandaid support in CFG construction for ObjCForEachStmt and ObjCAtTryStmt:
...
we gracefully back out and return NULL for the CFG, allowing clients to skip
analyzing functions with these CFGs. We will add support later.
Modified base ASTConsumer "CFGVisitor" to detect when a CFG is not constructed
and to emit a warning.
llvm-svn: 48322
2008-03-13 03:04:22 +00:00
Ted Kremenek
2bdd77696e
Added --trim-path-graph to the driver to trim paths from the ExplodedGraph
...
that are not related to error nodes.
Fixed bug where we did not detect some NULL dereferences.
Added "ExplodedGraph::Trim" to trim all nodes that cannot transitively reach
a set of provided nodes.
Fixed subtle bug in ExplodedNodeImpl where we could create predecessor
iterators that included the mangled "sink" bit. The better fix is to integrate
this bit into the void* for the wrapped State, not the NodeGroups representing
a node's predecessors and successors.
llvm-svn: 48036
2008-03-07 22:58:01 +00:00
Ted Kremenek
ea6507fe04
Added boilerplate to execute the CF reference count checker (which isn't yet implemented).
...
llvm-svn: 47982
2008-03-06 00:08:09 +00:00
Chris Lattner
eb85ab44f2
convert tabs to spaces, patch by Mike Stump!
...
llvm-svn: 47560
2008-02-25 21:04:36 +00:00
Ted Kremenek
c77f34daad
Modified clang driver option -dump-live-variables to (optionally) use the
...
--analyze-function option to analyze specific functions.
llvm-svn: 47498
2008-02-22 20:13:09 +00:00
Ted Kremenek
88329bf0ea
clang driver options --dump-cfg and --view-cfg now (optionally) use the
...
--analyze-function option to dump/view the CFGs of specific functions.
llvm-svn: 47497
2008-02-22 20:00:31 +00:00
Ted Kremenek
76c03b4a55
When running the GRSimpleVals analysis, skip functions that do not
...
appear in a file.
llvm-svn: 47491
2008-02-22 19:10:58 +00:00
Ted Kremenek
dbb1a3724c
For now, --grsimple skips analyzing functions in header files.
...
llvm-svn: 47303
2008-02-19 02:33:31 +00:00
Ted Kremenek
0f7130adc4
--grsimple now reports the number of nodes in the ExplodedGraph for
...
an analyzed function.
GRExprEngine now records stores to "uninitialized lvalues" (which are sinks in
the ExplodedGraph).
llvm-svn: 47293
2008-02-19 00:22:37 +00:00
Ted Kremenek
86e793937a
Running -grsimple now emits diagnostics about the time spent analyzing each function. Will
...
probably make this a separate command line option later.
Added "--analyze-function" option to the driver to (gradually) allow different
analyses to only be run on specific functions. Currently only --grsimple uses
this option.
llvm-svn: 47285
2008-02-18 21:21:23 +00:00
Ted Kremenek
e161afc4dd
Added --grsimple-view option to clang driver; this is the same as
...
--grsimple except that it visualizes the ExplodedGraph using dot and
outputs the current function being analyzed. --grsimple is now silent
except when it emits diagnostics.
llvm-svn: 47146
2008-02-15 00:35:38 +00:00
Ted Kremenek
d3122cb83c
Renamed GRConstants => GRSimpleVals.
...
Moved driver logic for --grsimple to GRSimpleVals.cpp.
llvm-svn: 47137
2008-02-14 22:36:46 +00:00
Anders Carlsson
5c6c05956e
Put back the top-level asm code; all tests pass now.
...
llvm-svn: 46868
2008-02-08 00:33:21 +00:00
Anders Carlsson
0fae4f56df
Back out 46855 for now, it causes test failures on Darwin.
...
llvm-svn: 46867
2008-02-08 00:23:11 +00:00
Anders Carlsson
bcc3a4bf64
Handle top-level asm declarations.
...
llvm-svn: 46855
2008-02-07 17:19:11 +00:00
Ted Kremenek
d74da0838f
Added proof-of-concept NULL pointer diagnostics to GRConstants.
...
Modified the driver to pass the Diagnostic object to GRConstants.
llvm-svn: 46847
2008-02-07 06:33:19 +00:00
Chris Lattner
adf1f51fc5
move the codegen ASTConsumer out of the driver into libcodegen,
...
eliminating a bunch of forwarding methods and generally
simplifying things.
llvm-svn: 46792
2008-02-06 02:01:47 +00:00
Chris Lattner
b5eda6253b
pull .ll and .bc writing out of the ASTConsumer destructors into some top
...
level code in clang. This is a cleanup, but does implement "-o" for
-emit-llvm. One effect of this is that "clang foo.c -emit-llvm" will now
emit into foo.ll instead of stdout. Use "clang foo.c -emit-llvm -o -" or
"clang < foo.c -emit-llvm" to get the old behavior.
llvm-svn: 46791
2008-02-06 01:42:25 +00:00
Chris Lattner
b1537ebdd4
rewrite some of the type refinement code to eliminate dangling pointers
...
simplify the code and generally make it more robust.
llvm-svn: 46745
2008-02-05 08:06:13 +00:00
Ted Kremenek
8ff7705a6c
Modified LiveVariables to perform all of its base initialization in the ctor,
...
and now we require a FunctionDecl* object so that we can also keep track of
all of the ParmDecls.
Modified clients of LiveVariables to conform to the new interface.
llvm-svn: 46490
2008-01-29 05:13:23 +00:00
Ted Kremenek
997d872375
Driver now passes the top-level FunctionDecl* to GRConstants.
...
Refactoring: for GREngine and GRConstants, pushed references to CFG, ASTContext,
and the top-level FunctionDecl into ExplodedGraphImpl.
llvm-svn: 46475
2008-01-29 00:33:40 +00:00
Ted Kremenek
33d8285b8d
Added passing "ASTContext" to both GREngine and GRConstants.
...
Added initial support for integer casting operations to GRConstants.
llvm-svn: 46298
2008-01-24 02:02:54 +00:00
Ted Kremenek
2e12c2e790
Hooked up the GRConstants analysis to the driver.
...
Fixed some compilation errors with GREngine that showed up during
template instantiation.
llvm-svn: 46074
2008-01-16 18:18:48 +00:00
Chris Lattner
38376f1595
Add first pieces of support for parsing and representing
...
extern "C" in C++ mode. Patch by Mike Stump!
llvm-svn: 45904
2008-01-12 07:05:38 +00:00
Chris Lattner
bceeefdc9c
Fix some 80 col violations
...
llvm-svn: 45808
2008-01-10 01:43:14 +00:00
Ted Kremenek
7e41c29a86
Added most of the boilerplate to the driver needed to run the graph-reachability
...
constant propagation analysis.
llvm-svn: 45747
2008-01-08 18:04:06 +00:00
Ted Kremenek
1b0ea82459
Substituted all instances of the string "Objc" for "ObjC". This fixes
...
some naming inconsistencies in the names of classes pertaining to Objective-C
support in clang.
llvm-svn: 45715
2008-01-07 19:49:32 +00:00
Chris Lattner
54bb810997
Refactor the decl printer, patch by Mike Stump!
...
llvm-svn: 45497
2008-01-02 21:04:16 +00:00
Chris Lattner
5b12ab8c93
Don't attribute in file headers anymore. See llvmdev for the
...
discussion of this change.
llvm-svn: 45410
2007-12-29 19:59:25 +00:00
Christopher Lamb
2b84813441
Make output files binary mode for -emit-llvm-bc
...
llvm-svn: 45348
2007-12-24 23:49:33 +00:00
Christopher Lamb
d01dea749e
Almost the best possible handling of stdin/stdout for llvm-emit-bc!
...
llvm-svn: 45346
2007-12-24 20:59:36 +00:00
Christopher Lamb
1c0f5d2436
Better handing of stdin/stdout for -emit-llvm-bc
...
llvm-svn: 45345
2007-12-24 20:56:07 +00:00
Christopher Lamb
5a3416409f
Allow bitcode output to be redirected to stdout.
...
llvm-svn: 45340
2007-12-24 03:23:55 +00:00
Seo Sanghyeon
76270e6be6
Implement -emit-llvm-bc option
...
llvm-svn: 45339
2007-12-24 01:52:34 +00:00
Ted Kremenek
bf593f81fa
Directory restructing of Analysis files.
...
Created include/clang/Analysis/Analyses directory.
- Moved LiveVariables.h and UninitializedValues.h into this dir.
Moved ExprDeclBitVector.h into Analysis/Support.
Updated all clients who use these headers to reflect the new paths.
llvm-svn: 45292
2007-12-21 21:42:19 +00:00
Ted Kremenek
71d643f8b1
Converted uses of scoped_ptr to OwningPtr.
...
llvm-svn: 45265
2007-12-20 19:47:16 +00:00