Ted Kremenek
5c06121dda
Added string "[CHECKER]" to the output diagnostics produced by the GRSimpleVals analysis.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47678 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 17:56:16 +00:00
Ted Kremenek
0d99ecf1d8
Fixed edge-case in CFG construction where goto jumps would not always get
...
properly back-patched.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47675 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 17:33:02 +00:00
Lauro Ramos Venancio
411219b968
A, q and Z are valid LLVM inline asm constraints.
...
Fix regression in Applications/ClamAV/clamscan.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47673 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 16:53:36 +00:00
Ted Kremenek
5482713d70
Bug fix in CFG construction: Properly register the loop head as the implicit
...
successor of blocks created above it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47666 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 07:20:00 +00:00
Ted Kremenek
2ad886836c
Small fix to VisitLVal: this method can be called on Block-Level expressions.
...
In such cases, handle them just like Visit().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47665 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 07:04:16 +00:00
Ted Kremenek
0793263741
When analyzing a function, eagerly create symbolic values for all
...
globals/parameters at the beginning of the analysis.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47664 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 06:47:26 +00:00
Ted Kremenek
0f5f0595d6
Header file cleanups: reduce number of includes; move ValueState.h into include directory tree.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47661 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 06:07:00 +00:00
Ted Kremenek
3ef1512397
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47651 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 00:46:25 +00:00
Ted Kremenek
a6fbe80684
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47650 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 00:44:11 +00:00
Ted Kremenek
a9d996dbeb
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47649 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 00:28:17 +00:00
Chris Lattner
4df85f55bb
fix an interaction between -isystem . and isysroot.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47646 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 23:46:22 +00:00
Ted Kremenek
5a7b3821c6
Fix bug when processing '?' operator: invalidate the old "Uninitialized" value of the block-level expression for ?.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47645 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 23:37:01 +00:00
Ted Kremenek
0674769109
Added boilerplate for plug-in transfer function support for CallExprs.
...
GRSimpleVals performs the following action: invalidate all values passed-by-reference.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47638 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 23:04:29 +00:00
Ted Kremenek
0015541bcf
Don't emit divide-by-zero errors when we divide by an unknown (not
...
uninitialized) value. At this point we're just too imprecise.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47636 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 22:27:51 +00:00
Ted Kremenek
9cae51aa50
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47630 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 21:57:11 +00:00
Lauro Ramos Venancio
813733577d
Implement codegen for the following static var init.
...
void g() {
static char a[10];
static char *b = a;
}
Now we can compile wget!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47627 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 21:41:45 +00:00
Ted Kremenek
d87a321a3c
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47626 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 21:31:18 +00:00
Ted Kremenek
ebd6610f9b
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47624 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 21:04:29 +00:00
Ted Kremenek
58b3321009
Small fixes to shore up overhauling of transfer function logic for '&&' and '||.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47620 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 19:40:44 +00:00
Lauro Ramos Venancio
7695f70bbd
Fix a bug in ConvertAsmString function.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47618 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 19:19:58 +00:00
Ted Kremenek
189c3056d9
optimization: no longer create ExplodedNodes for IntegerLiteral and
...
CharacterLiteral expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47617 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 19:17:09 +00:00
Ted Kremenek
05a2378c70
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47613 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 19:05:15 +00:00
Lauro Ramos Venancio
a5694b8b00
Convert x86 target specific inline asm constraints to LLVM.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47609 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 18:33:46 +00:00
Ted Kremenek
018c15fa98
Fixed inverted condition.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47590 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 03:44:25 +00:00
Ted Kremenek
f4e15fc4c1
Do include ParenExpr in the CFG; only include their subexpression.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47588 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 02:37:08 +00:00
Ted Kremenek
d763eb91aa
Added lazy "symbolication" of parameter variables and global variables.
...
Added recording of divide-by-zero and divide-by-uninitialized nodes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47586 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 02:15:56 +00:00
Chris Lattner
50dd289f45
add parsing, ast building and pretty printing support for C++ throw expressions.
...
Patch by Mike Stump!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47582 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 00:51:44 +00:00
Chris Lattner
a73349d332
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47581 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 00:33:57 +00:00
Chris Lattner
b22ef6feb0
fix const correctness.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47580 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 00:32:36 +00:00
Ted Kremenek
d34066c224
Fixed bug in CFG construction when a CompoundStmt ended with a NullStmt.
...
This caused the whole body to get dropped from the CFG.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47579 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 00:22:58 +00:00
Ted Kremenek
4dc3522315
Added FIXME.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47578 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 00:20:52 +00:00
Ted Kremenek
dcc48100ef
Minor bug fix in LiveVariables: don't "kill" decls referenced by a DeclStmt
...
that aren't VarDecls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47572 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 22:28:54 +00:00
Eli Friedman
56cd7e3848
Fix a little typo... per cfe-dev, this was apparently causing test
...
failures on OS X in some cases. (Thank you valgrind.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47568 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 22:11:40 +00:00
Chris Lattner
c9dde4f957
clarify comment, this is undefined behavior in any case, even if it only
...
bits VC++ right now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47565 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 21:38:21 +00:00
Ted Kremenek
2de4a9b1d6
doxygenify some comments.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47564 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 21:33:32 +00:00
Ted Kremenek
994a09bdd9
Better handling of calls to functions via function pointers.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47562 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 21:16:03 +00:00
Chris Lattner
c81c8144a6
convert tabs to spaces, patch by Mike Stump!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47560 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 21:04:36 +00:00
Lauro Ramos Venancio
2083a91d59
Revert an incorrect part of my previuos patch.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47553 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 19:08:51 +00:00
Lauro Ramos Venancio
0184cc719f
Fix PR2086.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47551 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 19:03:15 +00:00
Ted Kremenek
29db75ceec
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47550 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 18:56:23 +00:00
Ted Kremenek
3c8d0c58db
Expanded transfer function support for divide-by-zero checking to include
...
"remainder-by-zero" checking (operator '%').
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47549 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 18:42:54 +00:00
Ted Kremenek
3bca92bab5
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47548 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 18:34:45 +00:00
Ted Kremenek
07d83aa220
Added transfer function support for checking for divide-by-zero errors.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47547 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 17:51:31 +00:00
Chris Lattner
3426b9bdc2
enable digraphs for C94, thanks to Neil for pointing this out.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47543 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 04:01:39 +00:00
Chris Lattner
146ccd44ec
Fix PR2090, a typo in digraph processing.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47540 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-24 19:05:57 +00:00
Chris Lattner
edf9c7f1bc
Update comment.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47539 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-24 19:04:33 +00:00
Steve Naroff
69d6375dbd
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!).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47538 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-24 16:25:02 +00:00
Ted Kremenek
ca63fa0078
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!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47536 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-24 03:55:14 +00:00
Ted Kremenek
6bb816a3b8
In FileManager: use full paths to unique files and directories on Windows,
...
since inodes are bogus abstraction on that platform.
Patch by Argiris Kirtzidis!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47535 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-24 03:15:25 +00:00
Eli Friedman
10c5fa3b17
Minor code cleanup.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47530 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 07:32:49 +00:00