Ted Kremenek
88ba750f74
Compute alignment in bytes, not bits.
...
llvm-svn: 48387
2008-03-15 03:13:55 +00:00
Ted Kremenek
ae5b78615c
Implement transfer function logic for alignof operator (types).
...
llvm-svn: 48386
2008-03-15 03:13:20 +00:00
Ted Kremenek
5c98d1d641
Added transfer function support in GRExprEngine for __extension__.
...
llvm-svn: 48385
2008-03-15 03:05:30 +00:00
Steve Naroff
dad80ba9b1
Link against the correct ObjC string class (__CFConstantStringClassReference) and fix length computation (removing a FIXME).
...
llvm-svn: 48384
2008-03-15 01:36:04 +00:00
Steve Naroff
ce8e886731
Remove ObjC rewriter dependency on GCC's __builtin___CFStringMakeConstantString.
...
llvm-svn: 48383
2008-03-15 00:55:56 +00:00
Ted Kremenek
9e0461cd6e
"panic" has 5 letters, not 4. Bug pointed out by Nuno Lopes!
...
llvm-svn: 48377
2008-03-14 23:25:49 +00:00
Ted Kremenek
9318f68ad4
Hack to hardwire in some panic functions that are not marked noreturn.
...
llvm-svn: 48374
2008-03-14 21:58:42 +00:00
Ted Kremenek
9abb59f9cc
Emit warnings for undefined control-flow.
...
llvm-svn: 48368
2008-03-14 18:14:50 +00:00
Nate Begeman
b561de7455
Correctly error on arrays with automatic storage full of objects with
...
non-default address space, and fix comment.
Add a test for this.
llvm-svn: 48366
2008-03-14 18:07:10 +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
Chris Lattner
5ff2d5defa
add initial support for generating an llvm.globalctors list. Patch by David Chisnall
...
llvm-svn: 48362
2008-03-14 17:18:18 +00:00
Chris Lattner
e8ec280627
Only compute targetinfo once and don't leak it. Patch by Sam Bishop!
...
llvm-svn: 48358
2008-03-14 06:12:05 +00:00
Chris Lattner
221929310b
Make the preprocessor own its PPCallbacks, fixing a memory leak.
...
Patch by Sam Bishop!
llvm-svn: 48357
2008-03-14 06:07:05 +00:00
Nate Begeman
144625ef9b
ISO/IEC TR 18037
...
An address space name cannot be used to qualify an object that has automatic
storage duration. Still not catching ASQual'd allocas of array type, just
scalars at the moment.
llvm-svn: 48350
2008-03-14 00:22:18 +00:00
Nate Begeman
65b0a6423f
Fix comment
...
llvm-svn: 48347
2008-03-13 23:56:36 +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
Chris Lattner
fdc0748940
handle __extension__ properly at block scope.
...
llvm-svn: 48332
2008-03-13 06:32:11 +00:00
Chris Lattner
b943aa8c6c
instead of passing in null end location info, pass in the same as start.
...
This still isn't right, but is slightly nicer.
llvm-svn: 48331
2008-03-13 06:29:54 +00:00
Chris Lattner
2e23209df1
improve DeclStmt to be able to store SourceRange info correctly.
...
Set the start of DeclStmt range. Right now the end is meaningless
though.
llvm-svn: 48330
2008-03-13 06:29:04 +00:00
Anders Carlsson
8ec6a6ffe9
Add note about asm constraints.
...
llvm-svn: 48324
2008-03-13 03:45:48 +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
Steve Naroff
35cb7960e3
Two fixes to RewriteTest::RewriteObjCIvarRefExpr():
...
- For explicit ivar refers, make sure the cast is propagated to the AST.
- Don't free the base (since it is still in use).
This fixes the recent regression to test/Rewriter/objc-ivar-receiver-1.m.
llvm-svn: 48309
2008-03-12 23:15:19 +00:00
Ted Kremenek
e2f6d6cdb8
Changed CallRetValSymbol to SymbolConjured to allow "conjured" symbols to be created for any expression, not just CallExprs.
...
Added experimental support for conjuring symbols during assingments where the RHS is "unknown". This allows more value tracking for path-sensitivity.
Fixed bug in "assumption" logic when processing symbolic constraints; we would improperly mark constraints we didn't support as infeasible.
llvm-svn: 48306
2008-03-12 21:45:47 +00:00
Steve Naroff
ffb5f9ad93
Minor aesthetic improvement (after I reviewed my last commit).
...
llvm-svn: 48304
2008-03-12 21:22:52 +00:00
Steve Naroff
9f33bd2c34
Avoid using the "unnamed struct field" extension (enabled with -fms-extensions). This feature/extension silently does the wrong thing in g++. As far as I can tell, g++ simply throws the field away entirely (note that it works fine with gcc). Since I am now always casting the object (for other reasons), accessing protected/public fields simply requires the cast refer to the defining class. This solution is simpler all around (thanks to Chris for suggesting it).
...
llvm-svn: 48302
2008-03-12 21:09:20 +00:00
Ted Kremenek
626bd2d33e
Added generation of symbolic values for the return values of functions that have
...
no summaries (useful for false-path pruning).
llvm-svn: 48301
2008-03-12 21:06:49 +00:00
Ted Kremenek
86f1d0cd80
In GRSimpleVals, added the generation of symbolic values for the return values
...
of function calls. This is useful in pruning paths.
llvm-svn: 48299
2008-03-12 21:04:07 +00:00
Chris Lattner
28842b7c0d
Update to reflect changes in parameter attribute api.
...
llvm-svn: 48290
2008-03-12 17:46:07 +00:00
Steve Naroff
b327e49047
Use the "used" attribute. Without it, g++ removes all the meta-data:-( This doesn't happen when compiling straight C code.
...
llvm-svn: 48287
2008-03-12 17:18:30 +00:00
Ted Kremenek
576b76a794
Improved ExplodedGraph::Trim to only show nodes reachable from a reverse BFS
...
from the sources, and to try and generate only a single path from sources
to roots.
llvm-svn: 48286
2008-03-12 17:18:20 +00:00
Steve Naroff
5d5efca405
-Add missing visitor for ObjCIvarRefExpr.
...
-Wrap objc runtime calls with "extern "C"" (for now).
llvm-svn: 48284
2008-03-12 13:19:12 +00:00
Steve Naroff
4182fd56ad
Since the rewriter now outputs C++, it no longer makes sense to pipe the output to clang.
...
This should "fix" all but one of the test failure.
llvm-svn: 48275
2008-03-12 02:07:40 +00:00
Ted Kremenek
48a3410e25
Fixed regression in SymbolManager introduced in r48272.
...
llvm-svn: 48273
2008-03-12 02:00:37 +00:00
Ted Kremenek
68d73d19f1
Prototype (pre-alpha) implementation of CFRef checker.
...
llvm-svn: 48272
2008-03-12 01:21:45 +00:00
Steve Naroff
251084d03e
Remove more dependencies on C "flexible array member" idiom (when generating meta-data).
...
llvm-svn: 48271
2008-03-12 01:06:30 +00:00
Steve Naroff
dc5b6b2e5d
Make ivar rewrite C++ friendly (since C++ forces a unified namespace for typedefs/structures). The previous version of the rewriter generated both a type def and structure def for each class (which doesn't fly in C++).
...
llvm-svn: 48266
2008-03-12 00:25:36 +00:00
Ted Kremenek
2a723e6e80
Added pretty-printing support for checker-specific state for the CFRefCount checker.
...
llvm-svn: 48242
2008-03-11 19:44:10 +00:00
Ted Kremenek
d01efb547f
Expanded graph-visualization to include optional pretty-printing of checker-specific state.
...
llvm-svn: 48238
2008-03-11 19:02:40 +00:00
Ted Kremenek
827d0fcd57
Expanded ValueState pretty-printing to use an optional "CheckerStatePrinter"
...
object to pretty-print the component of a state that is specific to a checker.
llvm-svn: 48237
2008-03-11 18:57:24 +00:00
Ted Kremenek
a7178c7429
Expanded graph visualization interface to include specifying a range of
...
nodes to use a trim sources.
llvm-svn: 48236
2008-03-11 18:25:33 +00:00
Steve Naroff
0b844f053f
Make "super" rewrite for class methods C++ friendly (follow-up from last commit).
...
llvm-svn: 48235
2008-03-11 18:14:26 +00:00
Ted Kremenek
e5605568ae
Added bookkeeping of error nodes.
...
llvm-svn: 48234
2008-03-11 18:14:09 +00:00
Ted Kremenek
bf9d8048c6
Added main logic for typestate tracking for the CFRetain checker.
...
llvm-svn: 48231
2008-03-11 17:48:22 +00:00
Steve Naroff
17978c4dcb
Make "super" rewrite C++ friendly (since it doesn't support Compound Literals).
...
llvm-svn: 48230
2008-03-11 17:37:02 +00:00
Ted Kremenek
819e9b6f39
Added main skeleton for CFRetain transfer function logic.
...
llvm-svn: 48214
2008-03-11 06:39:11 +00:00
Steve Naroff
c5b9cc70ce
Generate meta-data in a C++ compatible way (remove 2 dependencies on C "flexible array member" idiom and perform some extra casts).
...
llvm-svn: 48202
2008-03-11 00:12:29 +00:00
Steve Naroff
14a0746b13
Missed a couple "_IMPL" suffixes.
...
llvm-svn: 48191
2008-03-10 23:33:22 +00:00
Steve Naroff
a1e115ee57
Fix dangling pointer and give the implementation struct for a class a unique name.
...
llvm-svn: 48190
2008-03-10 23:16:54 +00:00
Anders Carlsson
0be8163fb6
Add support for the 'N' constraint.
...
llvm-svn: 48185
2008-03-10 22:37:16 +00:00
Steve Naroff
945a3b145a
Pass LangOptions to RewriteTest().
...
llvm-svn: 48172
2008-03-10 20:43:59 +00:00
Chris Lattner
4114219ac6
rewriter tests are darwin specific, don't run them on other platforms.
...
llvm-svn: 48168
2008-03-10 19:32:31 +00:00
Chris Lattner
89fc4d4af7
Fix "error: explicit template specialization cannot have a storage class"
...
with gcc 4.4, patch by Shantonu Sen!
llvm-svn: 48155
2008-03-10 17:06:40 +00:00
Chris Lattner
0d799d3957
Add some missing #includes for GCC mainline, patch by Shantonu Sen!
...
llvm-svn: 48153
2008-03-10 17:04:53 +00:00
Ted Kremenek
afa02ed5fb
Add transfer function support for pointer arithmetic where the
...
increment/decrement operand is on the left side.
llvm-svn: 48144
2008-03-10 15:17:11 +00:00
Chris Lattner
242245d8ec
add comments about some simple optimizations that may become
...
more important if this api gets wider use.
llvm-svn: 48131
2008-03-10 06:20:22 +00:00
Chris Lattner
3e4683262e
implement simple support for arbitrary token lookahead. Change the
...
objc @try parser to use it, fixing a FIXME. Update the
objc-try-catch-1.m file to pass now that we get more reasonable
errors.
llvm-svn: 48129
2008-03-10 06:06:04 +00:00
Ted Kremenek
a34cf6de66
More edge-case handling with using liveness information to prune dead state values.
...
llvm-svn: 48127
2008-03-10 04:45:00 +00:00
Ted Kremenek
b73a43cc01
More cleanups with using the liveness analysis to removed dead symbols and
...
variables from the symbolic state. Now we keep a mapping from the predecessor
node of a statement and its cleaned state, and interpose an accessor
"GetState()" to return the cleaned state when the node is the predecessor node,
and the real state otherwise. This obviates problem of ever accidentally
cleaning the state more than once (thus blowing away new bindings by mistake).
llvm-svn: 48124
2008-03-10 04:11:42 +00:00
Ted Kremenek
6c50479737
When processing the transfer function for a statement, evaluate
...
RemoveDeadBindings early because (1) it will always be called and (2) we can
dispatch to a plug-in transfer function that can evaluate the effect of dead
symbols (not yet added).
llvm-svn: 48114
2008-03-09 18:28:41 +00:00
Ted Kremenek
2d063bef8b
Refactored guards for "GRExprEngine::RemoveDeadBindings" directly into the
...
method. This paves the way for other alterations to RemoveDeadBindings that are
transparent to its callers.
llvm-svn: 48113
2008-03-09 18:05:48 +00:00
Ted Kremenek
cfd8b19ef7
Bug fix in the transfer function for compound assignments: if the value
...
of the LHS expressions is Unknown, the value of the entire expression
does not evaluate to the RHS (as is the case with normal assignments).
llvm-svn: 48102
2008-03-09 08:12:37 +00:00
Anders Carlsson
a3a96afb51
Handle the 'n' constraint
...
llvm-svn: 48091
2008-03-09 06:02:02 +00:00
Chris Lattner
6af064641f
Fix a ted-o
...
llvm-svn: 48089
2008-03-09 05:25:01 +00:00
Ted Kremenek
ebe5c8520c
Fixed crash where SetBlkExpr would attempt to query the liveness data when
...
we weren't processing a statement within a basic block.
llvm-svn: 48087
2008-03-09 05:15:50 +00:00
Chris Lattner
d2d3441ddb
improve comment.
...
llvm-svn: 48083
2008-03-09 04:49:35 +00:00
Chris Lattner
f7ad82df8c
move PP::LookupFile from PPLexerChange -> PPDirectives.cpp
...
llvm-svn: 48082
2008-03-09 04:17:44 +00:00
Chris Lattner
e35109726c
Add PPLexerChange.cpp to the project.
...
llvm-svn: 48081
2008-03-09 04:14:55 +00:00
Chris Lattner
1eed734c9c
Move a bunch more code out of Preprocessor.cpp into PPLexerChange.cpp
...
llvm-svn: 48080
2008-03-09 04:10:46 +00:00
Ted Kremenek
03ab156041
Bug fix: Don't call RemoveDeadBindings more than once (can kill newly generated values to Block-Level Expressions).
...
llvm-svn: 48079
2008-03-09 03:30:59 +00:00
Chris Lattner
8962015386
split macro expansion support out of Preprocessor.cpp into PPMacroExpansion.cpp
...
Rename Directives.cpp -> PPDirectives.cpp since it implements part of the
Preprocessor class.
llvm-svn: 48078
2008-03-09 03:13:06 +00:00
Nate Begeman
aca747a34a
Propagate calling convention information to function declarations and CallInst
...
instructions.
llvm-svn: 48077
2008-03-09 03:09:36 +00:00
Chris Lattner
1d4000ba50
rename HandleEndOfMacro -> HandleEndOfTokenLexer
...
llvm-svn: 48076
2008-03-09 03:04:16 +00:00
Chris Lattner
7ff66fb91e
split the MacroArgs class out of TokenLexer.cpp/h into
...
MacroArgs.cpp/h
llvm-svn: 48075
2008-03-09 02:55:12 +00:00
Chris Lattner
d5917cef95
update documentation
...
llvm-svn: 48074
2008-03-09 02:27:26 +00:00
Chris Lattner
285c0c1150
rename some MacroExpander-related ivars to TokenLexer.
...
llvm-svn: 48073
2008-03-09 02:26:03 +00:00
Chris Lattner
5bb36002be
Rename MacroExpander.cpp/h -> TokenLexer.cpp/h
...
llvm-svn: 48072
2008-03-09 02:22:57 +00:00
Chris Lattner
95d72cdf0f
rename the MacroExpander class to TokenLexer. It handles both
...
token streams and macro lexing, so a more generic name is useful.
llvm-svn: 48071
2008-03-09 02:18:51 +00:00
Chris Lattner
d7daed1478
rename MacroTokens -> Tokens. When this is a token stream, there is no macro
...
involved.
llvm-svn: 48070
2008-03-09 02:07:49 +00:00
Nate Begeman
6127ae4cde
fix clang xcode build
...
llvm-svn: 48069
2008-03-09 01:55:39 +00:00
Chris Lattner
f64b352660
split preprocesor directive handling out of Preprocessor.cpp into Directives.cpp
...
llvm-svn: 48068
2008-03-09 01:54:53 +00:00
Chris Lattner
e4a6b18c2e
secondary targets are gone, simplify this.
...
llvm-svn: 48067
2008-03-09 01:36:43 +00:00
Chris Lattner
22ad07ca07
simplify triple processing code now that there can be only one arch specified.
...
llvm-svn: 48066
2008-03-09 01:35:13 +00:00
Chris Lattner
1e178ea988
be more quiet when building headers.
...
llvm-svn: 48065
2008-03-09 01:29:23 +00:00
Chris Lattner
a66222366e
add some comments.
...
llvm-svn: 48053
2008-03-08 09:00:55 +00:00
Chris Lattner
1df278669d
make float format handling more regular.
...
llvm-svn: 48052
2008-03-08 08:59:43 +00:00
Chris Lattner
7570e9c518
simplify all the type info accessors in TargeTInfo to return scalars,
...
which is simpler to use and provide.
llvm-svn: 48051
2008-03-08 08:52:55 +00:00
Chris Lattner
2dca6ff505
Fix a fixme by allowing pointers in different address spaces to have
...
different widths. Start simplifying TargetInfo accessor methods.
llvm-svn: 48050
2008-03-08 08:34:58 +00:00
Chris Lattner
c3a669ba63
eliminate the TargetInfoImpl stuff, simplifying the target implementations.
...
llvm-svn: 48049
2008-03-08 08:24:01 +00:00
Chris Lattner
a0c0c35190
eliminate ComputeWCharInfo.
...
llvm-svn: 48048
2008-03-08 08:07:34 +00:00
Ted Kremenek
0440494b66
Increased worklist limit for GRSimpleVals.
...
llvm-svn: 48037
2008-03-07 22:59:32 +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
6947a79d6b
Improved graph visualization of ExplodedGraphs to include source line and column
...
information.
llvm-svn: 48031
2008-03-07 20:57:30 +00:00
Ted Kremenek
910e9de131
Renamed ValueManager to BasicValueFactory.
...
llvm-svn: 48025
2008-03-07 20:13:31 +00:00
Nate Begeman
be6bb8efac
Add new test
...
llvm-svn: 48018
2008-03-07 20:04:49 +00:00
Nate Begeman
0a6192cfb8
Add fastcall/stdcall attribute support
...
Generate CallingConv::Fast when fastcall attribute is present
llvm-svn: 48017
2008-03-07 20:04:22 +00:00
Ted Kremenek
40bc74fde7
Refined divide-by-zero checking to distinguish between must and may
...
divide-by-zero errors.
llvm-svn: 48013
2008-03-07 19:04:53 +00:00
Ted Kremenek
7bdd630334
Patch by Nuno Lopes:
...
Added more comments for code processing attribute "format".
Added more checks for corner cases, test cases, and warnings.
llvm-svn: 48011
2008-03-07 18:43:49 +00:00
Gabor Greif
3a8edd8536
fix typos
...
llvm-svn: 47995
2008-03-06 10:40:09 +00:00
Ted Kremenek
f458289484
Fixed mismatched deallocation in GRBlockCounter::Factory::~Factory.
...
Reported by Zhongxing Xu!
llvm-svn: 47991
2008-03-06 08:09:22 +00:00
Chris Lattner
54ee63886e
remove two obsolete tests, not sure why my previous commit didn't commit the removal.
...
llvm-svn: 47986
2008-03-06 05:47:17 +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
Ted Kremenek
82d506de29
Added "CheckerState" field to ValueState.
...
llvm-svn: 47979
2008-03-05 23:32:23 +00:00
Ted Kremenek
4c38955dab
Added transfer function support for __builtin_expect.
...
llvm-svn: 47971
2008-03-05 22:59:42 +00:00
Ted Kremenek
9743b3913f
Small bug fix when handling CallExprs that generate sink nodes.
...
llvm-svn: 47970
2008-03-05 22:49:16 +00:00
Steve Naroff
93bcc7a6d2
Update vcproj files.
...
llvm-svn: 47967
2008-03-05 22:16:33 +00:00
Ted Kremenek
7034236366
Fixed bug that could case unwanted bifurcation of states when evaluating calls.
...
llvm-svn: 47964
2008-03-05 21:15:02 +00:00
Ted Kremenek
0c04606d1f
Fixed bogus assumption mistakenly introduced in r47955.
...
llvm-svn: 47958
2008-03-05 19:26:46 +00:00
Ted Kremenek
c156f1ffc6
Fixed a horribly insidious bit-masking bug in the implementation of
...
ExplodedNode that would occasionally result in heap corruption.
llvm-svn: 47956
2008-03-05 19:08:55 +00:00
Ted Kremenek
df4a5b9047
Minor cleanups (mainly indentation).
...
llvm-svn: 47955
2008-03-05 19:08:15 +00:00
Chris Lattner
37e0587839
remove the source location arguments to various target query methods.
...
llvm-svn: 47954
2008-03-05 18:54:05 +00:00
Chris Lattner
ae3429f5f1
add analysis source files to project.
...
llvm-svn: 47953
2008-03-05 18:22:36 +00:00
Chris Lattner
0e26639bb4
Add the various pathsensitive headers to the project.
...
llvm-svn: 47952
2008-03-05 18:20:02 +00:00
Chris Lattner
4cb0b08be7
ProgramEdge.h doesn't exist anymore.
...
llvm-svn: 47951
2008-03-05 18:18:31 +00:00
Ted Kremenek
7ae17203f8
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.
llvm-svn: 47935
2008-03-05 05:05:04 +00:00
Chris Lattner
855d024a83
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.
llvm-svn: 47930
2008-03-05 01:18:20 +00:00
Ted Kremenek
f9c67f6056
Added support for ProgramPoints to represent ExplodedNodes in another
...
ExplodedGraph. This allows us to build "layered" ExplodedGraphs where one
simulation is layered on another.
llvm-svn: 47926
2008-03-05 00:59:43 +00:00
Chris Lattner
43c103ab1b
move this into the right file.
...
llvm-svn: 47925
2008-03-05 00:53:34 +00:00
Ted Kremenek
d5804b31c4
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.
llvm-svn: 47923
2008-03-05 00:33:14 +00:00
Ted Kremenek
31672dbda3
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.
llvm-svn: 47921
2008-03-05 00:11:33 +00:00
Ted Kremenek
c3c8c5762f
Make GRStmtNodeBuilder only depend on StateTy, and not the type definition
...
of the entire checker.
llvm-svn: 47920
2008-03-04 23:50:00 +00:00
Ted Kremenek
a81c9de767
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.
llvm-svn: 47919
2008-03-04 23:39:43 +00:00
Ted Kremenek
3a3f6e3946
Moved GRExprEngine::NodeSet out of GRExprEngine and made it a standalone class: ExplodedNodeSet.
...
Made GRExprEngine::NodeSet a typedef of ExplodedNodeSet.
llvm-svn: 47914
2008-03-04 23:13:06 +00:00
Ted Kremenek
c76a83f1b6
CallExprs are now no longer block-level expressions in the CFG by construction.
...
llvm-svn: 47913
2008-03-04 22:29:40 +00:00
Ted Kremenek
9f3f827e65
Added preliminary transfer function support for references.
...
llvm-svn: 47912
2008-03-04 22:16:08 +00:00
Ted Kremenek
7aedc47285
For the transfer function for CallExpr, invalidate all arguments
...
passed-by-reference to builtin functions until we have better builtin support.
llvm-svn: 47910
2008-03-04 22:01:56 +00:00
Anders Carlsson
c83008a281
Make intrinsics always_inline.
...
llvm-svn: 47902
2008-03-04 21:11:29 +00:00
Ted Kremenek
229f6773bb
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)
llvm-svn: 47901
2008-03-04 20:40:11 +00:00
Ted Kremenek
e26c37d37d
Fixed another obscure node-caching bug.
...
llvm-svn: 47898
2008-03-04 19:52:15 +00:00
Ted Kremenek
122a529ab4
Implemented "print" method for ValueState.
...
llvm-svn: 47894
2008-03-04 18:30:35 +00:00
Chris Lattner
0fdc379475
The operand to the visibility attribute is required to be a quoted string, not a bare identifier.
...
llvm-svn: 47893
2008-03-04 18:08:48 +00:00
Ted Kremenek
c490bdbdb1
TargetInfo objects now own the TargetInfoImpl objects they refer to.
...
TargetInfo::AddSecondaryTarget is now private, as it is only used during
object construction.
llvm-svn: 47891
2008-03-04 17:47:18 +00:00
Ted Kremenek
b9832d3cb4
Add transfer function support for the default initialization of static
...
variables that are pointers or integers.
llvm-svn: 47880
2008-03-04 04:18:04 +00:00
Ted Kremenek
2a30ea6269
Fixed insidious state propagation bug that would sometimes cause the state
...
to bifurcate at the wrong places and not propagate at others.
llvm-svn: 47876
2008-03-04 00:56:45 +00:00
Ted Kremenek
b2ce263891
Enhanced pretty-printing of undefined-argument errors.
...
llvm-svn: 47873
2008-03-04 00:42:54 +00:00
Chris Lattner
8e48dfe9a1
move deprecated -> attributes.c
...
llvm-svn: 47856
2008-03-03 21:17:42 +00:00
Anders Carlsson
1f604a5d6f
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.
...
llvm-svn: 47852
2008-03-03 19:34:30 +00:00
Ted Kremenek
3f06864c25
Fixed subtle caching bug in ExplodedGraph that would cause some nodes to
...
be incorrectly merged together.
llvm-svn: 47851
2008-03-03 19:29:58 +00:00
Anders Carlsson
a5e2e60d69
Add mmintrin.h header
...
llvm-svn: 47850
2008-03-03 19:29:06 +00:00
Ted Kremenek
98c56677a7
Only allow a "noreturn" attribute to be affixed to a FunctionDecl.
...
llvm-svn: 47844
2008-03-03 16:52:27 +00:00
Ted Kremenek
7e97ed56e3
Added TODO.
...
llvm-svn: 47843
2008-03-03 16:50:00 +00:00
Ted Kremenek
8efd6b4ed8
Added FIXME.
...
llvm-svn: 47842
2008-03-03 16:47:31 +00:00
Gabor Greif
e2e5c3f394
The attribute nothrow maps to llvm attribute nounwind. Fix testcase.
...
llvm-svn: 47841
2008-03-03 14:53:09 +00:00
Gabor Greif
76ac5cf9d3
Chris added this testcase with r47837. The mail only shows one todo-warning but I see 3. Strangeness. Correcting lines 16 and 24.
...
llvm-svn: 47840
2008-03-03 14:30:39 +00:00
Chris Lattner
028d6d5792
avoid a warning.
...
llvm-svn: 47839
2008-03-03 05:57:43 +00:00
Chris Lattner
65079bd9be
fix codegen support for functions that are nothrow and noreturn.
...
llvm-svn: 47838
2008-03-03 03:45:26 +00:00
Chris Lattner
8496639787
Add a bunch of attributes, patch by Nuno Lopes.
...
llvm-svn: 47837
2008-03-03 03:28:21 +00:00
Chris Lattner
184adbfe5b
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
I'm not sure how to remove it. :(
llvm-svn: 47836
2008-03-03 03:16:03 +00:00
Chris Lattner
c16b6b2eab
Build the clang headers.
...
llvm-svn: 47834
2008-03-03 01:23:30 +00:00
Chris Lattner
4f838791f8
Add a makefile to build and install headers.
...
llvm-svn: 47833
2008-03-03 01:22:28 +00:00
Chris Lattner
b7256cd1d6
Add codegen support for ObjC message expressions with the GNU runtime.
...
Patch by David Chisnall!
llvm-svn: 47790
2008-03-01 08:50:34 +00:00
Chris Lattner
a087ff9a66
Add codegen support for ObjC message expressions with the GNU runtime.
...
Patch by David Chisnall!
llvm-svn: 47789
2008-03-01 08:45:05 +00:00
Chris Lattner
9f64b40cbf
newline at end of file, by David Chisnall
...
llvm-svn: 47788
2008-03-01 08:43:22 +00:00
Chris Lattner
ef24b38d9c
character literals have char type in C++ and int type in C. Patch
...
by Nuno Lopes for PR2089
llvm-svn: 47787
2008-03-01 08:32:21 +00:00
Chris Lattner
c1bc541323
Add support for the CPATH, C_INCLUDE_PATH, CPLUS_INCLUDE_PATH,
...
OBJC_INCLUDE_PATH, and OBJCPLUS_INCLUDE_PATH environment variables.
Patch by Sam Bishop!
llvm-svn: 47785
2008-03-01 08:07:28 +00:00
Ted Kremenek
51e87ea210
Added extra check for calls to functions where we pass undefined values
...
as arguments.
llvm-svn: 47778
2008-02-29 23:53:11 +00:00
Steve Naroff
b96e4ab649
Fix http://llvm.org/bugs/show_bug.cgi?id=2103 .
...
llvm-svn: 47775
2008-02-29 23:30:25 +00:00
Ted Kremenek
6f5fca78e4
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.
llvm-svn: 47774
2008-02-29 23:14:48 +00:00
Ted Kremenek
fcf6863f09
Minor CFG optimization: don't create separate block-level expressions for DeclStmt initializers when the initializer is a literal.
...
llvm-svn: 47771
2008-02-29 22:32:24 +00:00
Ted Kremenek
36748da5a6
When AST-dumping ObjCMessageExpr, output the selector.
...
llvm-svn: 47769
2008-02-29 22:04:05 +00:00
Steve Naroff
83777fef1a
Fix http://llvm.org/bugs/show_bug.cgi?id=2106 .
...
llvm-svn: 47768
2008-02-29 21:48:07 +00:00
Gabor Greif
05fdaeaed2
Fix a crash where PI.TypeInfo has not been filled in case of missing ObjCInterfaceDecl.
...
Happens with Xcode 2.4.1 headers on test
Parser/objc-foreach-error-1.m
llvm-svn: 47767
2008-02-29 20:35:55 +00:00
Ted Kremenek
17f4dbde36
"Refinement" of hack to bound loop-traversals: visit any block at a maximum of 3 times along a given path.
...
llvm-svn: 47766
2008-02-29 20:27:50 +00:00
Chris Lattner
f4c1aa67bd
testcase for attr deprecated, by Nuno Lopes.
...
llvm-svn: 47757
2008-02-29 18:11:31 +00:00
Chris Lattner
c18bfbb6a6
make include guards more unique.
...
llvm-svn: 47754
2008-02-29 17:10:38 +00:00
Chris Lattner
8a8558bcd4
Add support for attribute(deprecated), patch by Nuno Lopes!
...
llvm-svn: 47753
2008-02-29 16:48:43 +00:00
Ted Kremenek
b2b50b7bf5
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.
llvm-svn: 47727
2008-02-28 20:38:16 +00:00
Ted Kremenek
e0c79380cd
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.
llvm-svn: 47726
2008-02-28 20:32:03 +00:00
Eli Friedman
0c2f26dd17
Implementation of the first clang-native header, stdbool.h. Comments
...
welcome.
llvm-svn: 47724
2008-02-28 19:45:29 +00:00
Gabor Greif
031a711881
Updated clang webpage to hint at "make update". Also
...
changed "very early" to "early" when talking about
the state of clang.
llvm-svn: 47718
2008-02-28 14:59:26 +00:00
Ted Kremenek
22c62c1641
Merged ValueState and ValueStateImpl into just ValueState, with GRExprEngine::StateTy just becoming ValueState*.
...
llvm-svn: 47714
2008-02-28 10:21:43 +00:00
Ted Kremenek
93d1fed5ff
Renamed "Uninitialized" -> "Undefined" in path-sensitive value tracking engine.
...
llvm-svn: 47713
2008-02-28 09:25:22 +00:00
Ted Kremenek
49b61ab6bd
Added parsing of attributes for functions.
...
llvm-svn: 47693
2008-02-27 22:18:07 +00:00
Ted Kremenek
06516b124b
Fixed use of an uninitialized variable.
...
llvm-svn: 47691
2008-02-27 20:47:56 +00:00
Ted Kremenek
5668972630
End paths when calling a function marked "noreturn."
...
llvm-svn: 47690
2008-02-27 20:43:44 +00:00
Ted Kremenek
f7146ca3bc
Added support for attribute "noreturn."
...
llvm-svn: 47689
2008-02-27 20:43:06 +00:00
Ted Kremenek
fef05fae67
Small tweaks to the transfer function for DeclStmt: do not mark external global
...
variables as uninitialized, and only "initialize" static function variables.
llvm-svn: 47683
2008-02-27 19:21:33 +00:00
Lauro Ramos Venancio
e1938405fa
Disable internalize. Unfortunately, the configure scripts are not ready for some link time optimizations.
...
llvm-svn: 47682
2008-02-27 18:46:32 +00:00
Ted Kremenek
41dd9d0bee
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().
llvm-svn: 47681
2008-02-27 18:39:48 +00:00
Ted Kremenek
fd8352c2b9
Added string "[CHECKER]" to the output diagnostics produced by the GRSimpleVals analysis.
...
llvm-svn: 47678
2008-02-27 17:56:16 +00:00
Ted Kremenek
40d876376d
Fixed edge-case in CFG construction where goto jumps would not always get
...
properly back-patched.
llvm-svn: 47675
2008-02-27 17:33:02 +00:00
Lauro Ramos Venancio
7143697def
A, q and Z are valid LLVM inline asm constraints.
...
Fix regression in Applications/ClamAV/clamscan.
llvm-svn: 47673
2008-02-27 16:53:36 +00:00
Ted Kremenek
a1523a38f9
Bug fix in CFG construction: Properly register the loop head as the implicit
...
successor of blocks created above it.
llvm-svn: 47666
2008-02-27 07:20:00 +00:00
Ted Kremenek
cbb21b61c8
Small fix to VisitLVal: this method can be called on Block-Level expressions.
...
In such cases, handle them just like Visit().
llvm-svn: 47665
2008-02-27 07:04:16 +00:00
Ted Kremenek
1c64daba5b
When analyzing a function, eagerly create symbolic values for all
...
globals/parameters at the beginning of the analysis.
llvm-svn: 47664
2008-02-27 06:47:26 +00:00
Ted Kremenek
c025841dd4
Header file cleanups: reduce number of includes; move ValueState.h into include directory tree.
...
llvm-svn: 47661
2008-02-27 06:07:00 +00:00
Ted Kremenek
947528f000
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.
llvm-svn: 47651
2008-02-27 00:46:25 +00:00
Ted Kremenek
76a2e985c3
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.
llvm-svn: 47650
2008-02-27 00:44:11 +00:00
Ted Kremenek
39321aa199
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.
llvm-svn: 47649
2008-02-27 00:28:17 +00:00
Chris Lattner
bb7bc8d4f0
fix an interaction between -isystem . and isysroot.
...
llvm-svn: 47646
2008-02-26 23:46:22 +00:00
Ted Kremenek
6217dffec3
Fix bug when processing '?' operator: invalidate the old "Uninitialized" value of the block-level expression for ?.
...
llvm-svn: 47645
2008-02-26 23:37:01 +00:00
Ted Kremenek
448538d860
Added boilerplate for plug-in transfer function support for CallExprs.
...
GRSimpleVals performs the following action: invalidate all values passed-by-reference.
llvm-svn: 47638
2008-02-26 23:04:29 +00:00
Ted Kremenek
dea8c07899
Don't emit divide-by-zero errors when we divide by an unknown (not
...
uninitialized) value. At this point we're just too imprecise.
llvm-svn: 47636
2008-02-26 22:27:51 +00:00
Ted Kremenek
dc1b0114ed
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.
llvm-svn: 47630
2008-02-26 21:57:11 +00:00
Lauro Ramos Venancio
01a72ff5d3
Implement codegen for the following static var init.
...
void g() {
static char a[10];
static char *b = a;
}
Now we can compile wget!
llvm-svn: 47627
2008-02-26 21:41:45 +00:00
Ted Kremenek
e9f30d3288
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.
llvm-svn: 47626
2008-02-26 21:31:18 +00:00
Ted Kremenek
c7ba873dc7
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:
http://llvm.org/viewvc/llvm-project?rev=47581&view=rev
llvm-svn: 47624
2008-02-26 21:04:29 +00:00
Ted Kremenek
bc54390803
Small fixes to shore up overhauling of transfer function logic for '&&' and '||.
...
llvm-svn: 47620
2008-02-26 19:40:44 +00:00
Lauro Ramos Venancio
8af648ac55
Fix a bug in ConvertAsmString function.
...
llvm-svn: 47618
2008-02-26 19:19:58 +00:00
Ted Kremenek
9b69ed398b
optimization: no longer create ExplodedNodes for IntegerLiteral and
...
CharacterLiteral expressions.
llvm-svn: 47617
2008-02-26 19:17:09 +00:00
Ted Kremenek
f3a4b9617e
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.
llvm-svn: 47613
2008-02-26 19:05:15 +00:00
Lauro Ramos Venancio
c9fbd7301a
Convert x86 target specific inline asm constraints to LLVM.
...
llvm-svn: 47609
2008-02-26 18:33:46 +00:00
Ted Kremenek
ce3563445c
Fixed inverted condition.
...
llvm-svn: 47590
2008-02-26 03:44:25 +00:00
Ted Kremenek
5affb58dd6
Do include ParenExpr in the CFG; only include their subexpression.
...
llvm-svn: 47588
2008-02-26 02:37:08 +00:00
Ted Kremenek
06b671097d
Added lazy "symbolication" of parameter variables and global variables.
...
Added recording of divide-by-zero and divide-by-uninitialized nodes.
llvm-svn: 47586
2008-02-26 02:15:56 +00:00
Chris Lattner
b7e656b177
add parsing, ast building and pretty printing support for C++ throw expressions.
...
Patch by Mike Stump!
llvm-svn: 47582
2008-02-26 00:51:44 +00:00
Chris Lattner
7768313c13
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.
llvm-svn: 47581
2008-02-26 00:33:57 +00:00
Chris Lattner
a3343a86ea
fix const correctness.
...
llvm-svn: 47580
2008-02-26 00:32:36 +00:00
Ted Kremenek
f699882a76
Fixed bug in CFG construction when a CompoundStmt ended with a NullStmt.
...
This caused the whole body to get dropped from the CFG.
llvm-svn: 47579
2008-02-26 00:22:58 +00:00
Ted Kremenek
733f810600
Added FIXME.
...
llvm-svn: 47578
2008-02-26 00:20:52 +00:00
Ted Kremenek
7845b2607a
Minor bug fix in LiveVariables: don't "kill" decls referenced by a DeclStmt
...
that aren't VarDecls.
llvm-svn: 47572
2008-02-25 22:28:54 +00:00
Eli Friedman
0992b38a78
Fix a little typo... per cfe-dev, this was apparently causing test
...
failures on OS X in some cases. (Thank you valgrind.)
llvm-svn: 47568
2008-02-25 22:11:40 +00:00
Chris Lattner
f5c619f98c
clarify comment, this is undefined behavior in any case, even if it only
...
bits VC++ right now.
llvm-svn: 47565
2008-02-25 21:38:21 +00:00
Ted Kremenek
3ed28de5cc
doxygenify some comments.
...
llvm-svn: 47564
2008-02-25 21:33:32 +00:00
Ted Kremenek
3a6fd9c177
Better handling of calls to functions via function pointers.
...
llvm-svn: 47562
2008-02-25 21:16:03 +00:00
Chris Lattner
eb85ab44f2
convert tabs to spaces, patch by Mike Stump!
...
llvm-svn: 47560
2008-02-25 21:04:36 +00:00
Lauro Ramos Venancio
4400a85ce8
Revert an incorrect part of my previuos patch.
...
llvm-svn: 47553
2008-02-25 19:08:51 +00:00
Lauro Ramos Venancio
8983891531
Fix PR2086.
...
llvm-svn: 47551
2008-02-25 19:03:15 +00:00
Ted Kremenek
eb079dc502
Fixed bug in RemoveDeadBindings when performing the mark-and-sweep over the
...
symbolic store: VarDecl's inserted into the sweep may not always bind to
anything; handle this special case just like bindings to uninitialized values.
llvm-svn: 47550
2008-02-25 18:56:23 +00:00
Ted Kremenek
3866746569
Expanded transfer function support for divide-by-zero checking to include
...
"remainder-by-zero" checking (operator '%').
llvm-svn: 47549
2008-02-25 18:42:54 +00:00
Ted Kremenek
b23cc7191f
Added hack to transfer function logic to handle the case where a DeclRefExpr
...
wrapping an EnumConstantDecl evaluates to an integer type that has a different
signedness than the APSInt stored in the EnumConstantDecl. Will file a Bugzilla
report.
llvm-svn: 47548
2008-02-25 18:34:45 +00:00
Ted Kremenek
6f92e2294a
Added transfer function support for checking for divide-by-zero errors.
...
llvm-svn: 47547
2008-02-25 17:51:31 +00:00
Chris Lattner
cb0d62c70d
enable digraphs for C94, thanks to Neil for pointing this out.
...
llvm-svn: 47543
2008-02-25 04:01:39 +00:00
Chris Lattner
5329e7e5ed
Fix PR2090, a typo in digraph processing.
...
llvm-svn: 47540
2008-02-24 19:05:57 +00:00
Chris Lattner
89a62c8fff
Update comment.
...
llvm-svn: 47539
2008-02-24 19:04:33 +00:00
Steve Naroff
f0ed31aafe
Move the initialization of SEL/objc_selector from Sema::Sema() to Sema::ActOnTranslationUnitScope() and make sure the type/struct get inserted into the translation unit scope.
...
Bug submitted by David Chisnall (thanks!).
llvm-svn: 47538
2008-02-24 16:25:02 +00:00
Ted Kremenek
72be068ab3
Two more Windows-related fixes:
...
- More enum signeness bitfield fixes (MSVC treats enums as signed).
- Fixed in Lex/HeaderSearch.cpp an unsafe copy between two
HeaderSearch::PerFileInfo entries in a common vector. The copy involved two
calls to getFileInfo() within the assignment; these calls could have
side-effects that enlarged the internal vector, and with MSVC this would
invalidate one of the values in the assignment.
Patch by Argiris Kirtzidis!
llvm-svn: 47536
2008-02-24 03:55:14 +00:00
Ted Kremenek
d87eef89c8
In FileManager: use full paths to unique files and directories on Windows,
...
since inodes are bogus abstraction on that platform.
Patch by Argiris Kirtzidis!
llvm-svn: 47535
2008-02-24 03:15:25 +00:00
Eli Friedman
401675b0de
Minor code cleanup.
...
llvm-svn: 47530
2008-02-23 07:32:49 +00:00
Ted Kremenek
f948d2a75f
Change encoding of TokenKind in IdentifierTable to be of type "unsigned"
...
instead of TokenKind because of signedness issues with MSVC and enums.
Patch from Argiris Kirtzidis.
llvm-svn: 47515
2008-02-23 01:05:54 +00:00
Ted Kremenek
652d18e37c
Patch from Argiris Kirtzidis:
...
The patch fixes some debug assertions that the msvcrt throws:
1)
- if (isprint(value) && value < 256) {
+ if (value < 256 && isprint(value)) {
isprint() does an assertion check of its own for value < 256; check value before calling it to prevent it.
2)
- Stmt->Names.push_back(std::string(&data[0], data.size()));
+ if (data.size() == 0)
+ Stmt->Names.push_back(std::string());
+ else
+ Stmt->Names.push_back(std::string(&data[0], data.size()));
If data.size() == 0 then data[0] throws "out of range" assertion.
llvm-svn: 47512
2008-02-23 00:52:04 +00:00
Ted Kremenek
b0b7d28f67
Fixed horrid bug in LiveVariables analysis where we were only merging at
...
confluence points the liveness information for variables (Decls) and NOT
block-level expressions.
llvm-svn: 47506
2008-02-22 23:17:20 +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
43638a87e5
Punt on unifying symbolic lvalues. This won't be needed for many checkers.
...
llvm-svn: 47489
2008-02-22 18:41:59 +00:00
Ted Kremenek
cb507025d4
Added "assumption" logic for lval::FuncVal and lval::GotoLabel, and simplified
...
assumption logic for lval::DeclVal.
llvm-svn: 47466
2008-02-22 00:54:56 +00:00
Ted Kremenek
51017b5432
Bug fix: For transfer function for unary "!", compare the subexpression value
...
against '0' of the same bit-width.
llvm-svn: 47465
2008-02-22 00:42:36 +00:00
Ted Kremenek
20c91421fe
Bug fix in liveness: Only compute liveness information for VarDecls.
...
llvm-svn: 47464
2008-02-22 00:34:10 +00:00
Ted Kremenek
eb653882de
Return "Unknown" when using the value of a function pointer whose value
...
is symbolic.
llvm-svn: 47463
2008-02-21 23:17:39 +00:00
Ted Kremenek
6d2bbd9467
Regression fix: Handle binary operators where both the left and right
...
operands are symbolic lvalues.
llvm-svn: 47459
2008-02-21 22:08:33 +00:00
Ted Kremenek
9f1ed12bc4
Added transfer function support for dispatching to functions we don't know
...
about. The default logic is to invalidate the values of all values
passed-by-reference.
llvm-svn: 47456
2008-02-21 19:46:04 +00:00
Nate Begeman
b16d53ea31
add a test case
...
llvm-svn: 47455
2008-02-21 19:44:16 +00:00
Nate Begeman
d45d38d2b7
Handle __attribute__((annotate("string")))
...
llvm-svn: 47451
2008-02-21 19:30:49 +00:00
Ted Kremenek
e82c7a44d6
RemoveDeadBindings should now check for UninitalizedVal, as it is a now
...
an error to cast it to LVal.
llvm-svn: 47450
2008-02-21 19:30:14 +00:00
Ted Kremenek
7328fa6ec8
Regression fix: Handle pointer arithmetic in unary ++/--.
...
llvm-svn: 47449
2008-02-21 19:29:23 +00:00
Ted Kremenek
7f8ebb73af
Removed bogus assertions regard LValues binding to UnknownVal; they can
...
do so implicitly.
llvm-svn: 47447
2008-02-21 19:15:37 +00:00
Ted Kremenek
d21429a8e7
Remove incorrect casts from UnknownVal to NonLVal.
...
llvm-svn: 47446
2008-02-21 19:10:12 +00:00
Ted Kremenek
b1e3218125
FIX: Promote the correct operand.
...
llvm-svn: 47445
2008-02-21 18:46:24 +00:00
Ted Kremenek
7e4861b3c1
Simplified and generalized transfer function logic for casts, allowing
...
the transfer function to be invoked without an Expr* for the Cast operation.
Added implicit promotions to the transfer function logic for compound
assignments.
llvm-svn: 47444
2008-02-21 18:43:30 +00:00
Ted Kremenek
d2332f9625
Added transfer function support for sizeof(void)
...
llvm-svn: 47443
2008-02-21 18:15:29 +00:00