• Home
  • History
  • Annotate
  • only in /external/clang/lib/Analysis/
History log of /external/clang/lib/Analysis/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ef8225444452a1486bd721f3285301fe84643b00 21-Jul-2014 Stephen Hines <srhines@google.com> Update Clang for rebase to r212749.

This also fixes a small issue with arm_neon.h not being generated always.

Includes a cherry-pick of:
r213450 - fixes mac-specific header issue
r213126 - removes a default -Bsymbolic on Android

Change-Id: I2a790a0f5d3b2aab11de596fc3a74e7cbc99081d
FG.cpp
hreadSafetyCommon.cpp
hreadSafetyLogical.cpp
hreadSafetyTIL.cpp
ninitializedValues.cpp
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
nalysisDeclContext.cpp
odyFarm.cpp
FG.cpp
FGStmtMap.cpp
MakeLists.txt
allGraph.cpp
onsumed.cpp
ormatString.cpp
ormatStringParsing.h
iveVariables.cpp
ostOrderCFGView.cpp
rintfFormatString.cpp
seudoConstantAnalysis.cpp
eachableCode.cpp
canfFormatString.cpp
hreadSafety.cpp
hreadSafetyCommon.cpp
hreadSafetyLogical.cpp
hreadSafetyTIL.cpp
ninitializedValues.cpp
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
nalysisDeclContext.cpp
ndroid.mk
odyFarm.cpp
odyFarm.h
FG.cpp
FGReachabilityAnalysis.cpp
MakeLists.txt
allGraph.cpp
onsumed.cpp
iveVariables.cpp
OTICE
rogramPoint.cpp
seudoConstantAnalysis.cpp
eachableCode.cpp
canfFormatString.cpp
hreadSafety.cpp
ninitializedValues.cpp
229d345dd5a73ef6ba75d1d730ecf96e8dc9ecec 08-Feb-2014 Stephen Hines <srhines@google.com> Update clang for merge to LLVM 3.4.

Update TableGen rules:
- AttrExprArgs
+ AttrIdentifierArg
+ AttrParsedAttrImpl
+ AttrTypeArg

Update config.h files.

Adjust Android.mk for added/removed files:

+ TransProtectedScope.cpp

- DumpXML.cpp

+ Consumed.cpp

+ CodeGenABITypes.cpp

+ SanitizerArgs.cpp

+ AllocationDiagnostics.cpp
- CommonBugCategories.cpp
+ IdenticalExprChecker.cpp

+ CommonBugCategories.cpp
- SymbolManager.cpp
- TextPathDiagnostics.cpp
+ SymbolManager.cpp

Change-Id: I73bea10e7e73e611f678bc5bf9935e26da63be17
ndroid.mk
1fab7c3e3bd97a909a80b1bfea1909c6e7347fc0 12-Feb-2014 Stephen Hines <srhines@google.com> Merge remote-tracking branch 'upstream/release_34' into merge-20140211

Conflicts:
lib/Basic/Targets.cpp
lib/Sema/SemaDeclAttr.cpp

Change-Id: I17ca7161f32007272ee82036d237d051847dd02e
dd9e9cec6f863afa15dd91b34fbf15c66c678c02 09-Dec-2013 Bill Wendling <isanbard@gmail.com> Merging r196593:
------------------------------------------------------------------------
r196593 | zaks | 2013-12-06 10:56:29 -0800 (Fri, 06 Dec 2013) | 7 lines

Revert "[analyzer] Refactor conditional expression evaluating code"

This reverts commit r189090.

The original patch introduced regressions (see the added live-variables.* tests). The patch depends on the correctness of live variable analyses, which are not computed correctly. I've opened PR18159 to track the proper resolution to this problem.

The patch was a stepping block to r189746. This is why part of the patch reverts temporary destructor tests that started crashing. The temporary destructors feature is disabled by default.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@196795 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
4444446abb50f7b0314d82be0afa892f945cc9bc 01-Dec-2013 Bill Wendling <isanbard@gmail.com> Merging r195777:
------------------------------------------------------------------------
r195777 | delesley | 2013-11-26 11:45:21 -0800 (Tue, 26 Nov 2013) | 1 line

Thread safety analysis: fix ICE due to missing null check on dyn_cast.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@196007 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
29fc11a7abc06c30146a0ba3733da1c758586784 18-Nov-2013 Aaron Ballman <aaron@aaronballman.com> The code using the StmtPrinterHelper object failed to account for a null object in many cases, which could have led to crashes were it ever to be null. Now passing the object by reference instead of by pointer because it is never null in practice. No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195043 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
4c3e0bc7850df76824138ecfcc434388e7f69559 16-Nov-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: track state of temporary objects.
Earlier versions discarded the state too soon, and did not track state changes,
e.g. when passing a temporary to a move constructor. Patch by
chris.wailes@gmail.com; review and minor fixes by delesley.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194900 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
f9495911c46a5f90d8cf14774c11ff521d505c7e 08-Nov-2013 DeLesley Hutchins <delesley@google.com> Thread-safety analysis: check guarded_by and pt_guarded_by on array access.
Currently supported only with -Wthread-safety-beta.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194275 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
9a2f84b2f03e79fb21f9db9e029045fba09dedef 06-Nov-2013 DeLesley Hutchins <delesley@google.com> Thread safety analysis: minor bugfix to smart pointer handling, and expanded
test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194157 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
43399fb0e79687043b7904195e95a23e44bd6ca1 06-Nov-2013 DeLesley Hutchins <delesley@google.com> Thread safety analysis: check pt_guarded_by attribute when calling -> and *
on smart pointers. -Wthread-safety-beta only.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194103 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
1aa89697dc73760dce700e99d78c5805aa8bd7bb 31-Oct-2013 Chris Wailes <chris.wailes@gmail.com> Fixed bug with checking the kind of types.

The isLValueReferenceType function checks to see if the QualType's
canonical type is an LValue reference, and not if the QualType
itself is an LValue reference. This caused a segfault when trying
to cast the QualType's Type to a LValueReference. This is now
fixed by casting the result of getCanonicalType().

In addition, a test was added to isConsumableType to prevent
segfaults when a type being tested by the analysis is a reference
to a pointer or a pointer to a reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193751 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
0e429f1f48298b749cd0b0d6e931ed15c2a7a2b1 29-Oct-2013 Chris Wailes <chris.wailes@gmail.com> Changed tests_typestate to test_typestate for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193648 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
a0cbcabb1beaee6c0cd5d4aa30cd9450ff5331ea 25-Oct-2013 Chris Wailes <chris.wailes@gmail.com> Used OwningPtr to clean up some memory management in Consumed.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193414 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
de2204b56096e2336d19b1feae8b1be99dfb49fa 24-Oct-2013 Chris Wailes <chris.wailes@gmail.com> Replaced duplicate code with calls to forwardInfo.

Also made move constructor handling safer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193347 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
3f5b4de5a05c07a2af5b0e61e919ac0f803c78c9 23-Oct-2013 Jordan Rose <jordan_rose@apple.com> CFG: Properly print delegating initializer CFG elements.

...rather than segfaulting.

Patch by Enrico P!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193208 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
87bcee88d9b49de8214aa23d07c96f7bec3198e0 19-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Simplify some implementations of get*Decl.

* NamedDecl and CXXMethodDecl were missing getMostRecentDecl.
* The const version can just forward to the non const.
* getMostRecentDecl can use cast instead of cast_or_null.

This then removes some casts from the callers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193039 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
13be03222faa22b1a1088ea5c1a00014934b9ee4 19-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: fix assert failure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193010 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
be63ab6612b250972ae528ae910e5fa64f9c5731 18-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: assume that non-const reference parameters are initially
in the "uknown" state. Patch by chris.wailes@gmail.com. Reviewed by delesley.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192995 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
c5cdafcdb8eea9625e86b015ba7a2504f18a99b7 18-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: All the return_typestate parameter to be attached to the
default constructor. Patch by chris.wailes@gmail.com, reviewed by delesley.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192991 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
d4f0e1991f42c69111213699fb2d09dedee1cd36 18-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: Add param_typestate attribute, which specifies that
function parameters must be in a particular state. Patch by
chris.wailes@gmail.com. Reviewed by delesley@google.com.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192934 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
cd0f6d7600a691ad81dab308e9905fb0cce1df4d 18-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed Analysis: Allow parameters that are passed by non-const reference
to be treated as return values, and marked with the "returned_typestate"
attribute. Patch by chris.wailes@gmail.com; reviewed by delesley@google.com.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192932 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
52f717eba7eff69c97d64de5e3669f4a5ee57d5c 17-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: fix ICE in handling of loop source locations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192911 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
f30e194f9d797ebeb2f6c3f96e88160ed1a6519a 12-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: replace the consumes attribute with a set_typestate
attribute. Patch by chris.wailes@gmail.com; reviewed and edited by delesley.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192515 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
1bf6343612e394051fffc587e6899de6901065e0 12-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: switch from tests_consumed/unconsumed to a general
tests_typestate attribute. Patch by chris.wailes@gmail.com.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192513 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
627c7f9740dfe9c208543798eccbe5ca23e1ef42 11-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: check destructor calls.
This allows the callable_when attribute to be attached to destructors.
Original patch by chris.wailes@gmail.com, reviewed and edited by delesley.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192508 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
7385840b600d0e4a96d75042f612f6430e4a0390 09-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: improve loop handling. The prior version of the analysis
marked all variables as "unknown" at the start of a loop. The new version
keeps the initial state of variables unchanged, but issues a warning if the
state at the end of the loop is different from the state at the beginning.
This patch will eventually be replaced with a more precise analysis.

Initial patch by chris.wailes@gmail.com. Reviewed and edited by
delesley@google.com.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192314 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
66540857c08de7f1be9bea48381548d3942cf9d1 04-Oct-2013 DeLesley Hutchins <delesley@google.com> Consumed Analysis: Change callable_when so that it can take a list of states
that a function can be called in. This reduced the total number of annotations
needed and makes writing more complicated behaviour less burdensome.
Patch by chriswails@gmail.com.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191983 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
4124c7a37b8aa1afd8cd9b503f2aa7c4d6bed467 22-Sep-2013 Benjamin Kramer <benny.kra@googlemail.com> Make sort predicate match the qsort convention.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191177 91177308-0d34-0410-b5e6-96231b3b80d8
eachableCode.cpp
767b3d2000a00c56e1a3c19372810e2b7d66b76c 22-Sep-2013 Benjamin Kramer <benny.kra@googlemail.com> Fix array_pod_sort predicates after LLVM change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191176 91177308-0d34-0410-b5e6-96231b3b80d8
eachableCode.cpp
8a1fdfc69cc6c2ccbfd57fc8ff643c589da9df9b 12-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR16054: Slight strengthening for -Wsometimes-uninitialized: if we use a
variable uninitialized every time we reach its (reachable) declaration, or
every time we call the surrounding function, promote the warning from
-Wmaybe-uninitialized to -Wsometimes-uninitialized.

This is still slightly weaker than desired: we should, in general, warn
if a use is uninitialized the first time it is evaluated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190623 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
57b781dde2676cd1bd838a1cdd56d3aeea091d11 11-Sep-2013 DeLesley Hutchins <delesley@google.com> Fix ICE in consumed analysis when CFG is null.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190447 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
a7be2f4c745120d6ee5adfd19ef259919bdc3f7f 09-Sep-2013 Matt Beaumont-Gay <matthewbg@google.com> Fix a crash introduced in r189828.

The predicates in CXXRecordDecl which test various properties of special
members can't be called on incomplete decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190353 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
1ae74842cd1be37a8d99d0865623ef16432d3b67 06-Sep-2013 Pavel Labath <labath@google.com> Avoid double edges when constructing CFGs

Summary:
If a noreturn destructor is executed while returning a value from a function,
the resulting CFG has had two edges to the exit block. This crashed the analyzer,
because it expects that blocks with no terminators have only one outgoing edge.
I added code to avoid creating the second edge in this case.

PS: The crashes did not manifest themselves always, as usually the
NoReturnFunctionChecker would stop program evaluation before the analyzer hit
the assertion, but in the case of lifetime extended temporaries, the checker
failed to do that (which is a separate bug in itself).

Reviewers: jordan_rose

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1513

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190125 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
a33ab6074a2cc60fe895d6669f9ee776c5fea335 06-Sep-2013 David Blaikie <dblaikie@gmail.com> Consumed Analysis: The 'consumable' attribute now takes a identifier specifying the default assumed state for objects of this class

This information is used for return states and pass-by-value parameter
states.

Patch by Chris Wailes.

Review by DeLesley Hutchins and Aaron Ballman.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190116 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
e988dc45254405aff0950337d82aa8623fb1b88e 03-Sep-2013 Eric Christopher <echristo@gmail.com> Fix non-void return warning, and format.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189845 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
0e8534efc3c536795ede0128aed86a6b8ad53ab7 03-Sep-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: add return_typestate attribute.
Patch by chris.wailes@gmail.com

Functions can now declare what state the consumable type the are returning will
be in. This is then used on the caller side and checked on the callee side.
Constructors now use this attribute instead of the 'consumes' attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189843 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
36d558d85653315edb389677e995ec9ccdbfbf3d 03-Sep-2013 Jordan Rose <jordan_rose@apple.com> Add an implicit dtor CFG node just before C++ 'delete' expressions.

This paves the way for adding support for modeling the destructor of a
region before it is deleted. The statement "delete <expr>" now generates
this series of CFG elements:

1. <expr>
2. [B1.1]->~Foo() (Implicit destructor)
3. delete [B1.1]

Patch by Karthik Bhat!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189828 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
95ab9e306f4deefeabd89ea61987f4a8d67e0890 02-Sep-2013 Pavel Labath <labath@google.com> [analyzer] Add very limited support for temporary destructors

This is an improved version of r186498. It enables ExprEngine to reason about
temporary object destructors. However, these destructor calls are never
inlined, since this feature is still broken. Still, this is sufficient to
properly handle noreturn temporary destructors.

Now, the analyzer correctly handles expressions like "a || A()", and executes the
destructor of "A" only on the paths where "a" evaluted to false.

Temporary destructor processing is still off by default and one has to
explicitly request it by setting cfg-temporary-dtors=true.

Reviewers: jordan_rose

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1259

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189746 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
c55bee6e278d888d7a5d29fc17df6a9ae1e8b7d3 31-Aug-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: add 'consumable' class attribute.
Patch by chris.wailes@gmail.com

Adds the 'consumable' attribute that can be attached to classes. This replaces
the previous method of scanning a class's methods to see if any of them have
consumed analysis attributes attached to them. If consumed analysis attributes
are attached to methods of a class that isn't marked 'consumable' a warning
is generated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189702 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
4252598a2e58c3f74027511f535ed327f9b32b77 30-Aug-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: track function parameters.
Patch by chris.wailes@gmail.com.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189616 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
d324a0bcda2754c6fe0b5e27ad50e42850d498c4 29-Aug-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: non-const methods no longer transfer an object into an
unknown state. Patch by chris.wailes@gmail.com.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189612 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
6b2ec037f16753547398efe1812160982f1d14e4 29-Aug-2013 Aaron Ballman <aaron@aaronballman.com> Silencing the warning from r189605 in a more conformant manner.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189606 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
1f55157a5b3f60389e32b337bdf50eeea50f8f77 29-Aug-2013 Aaron Ballman <aaron@aaronballman.com> Silencing a rather spurious warning from MSVC 11 about not all control paths returning a value (hint: they do).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189605 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
e444ea0f5c8c8cf677edd05d9fb1254422765bd5 29-Aug-2013 Eric Christopher <echristo@gmail.com> Fix warning about anonymous structs in anonymous unions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189596 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
b7dc1f5f30e1e46e44389b036d48f9614cfd5fe3 29-Aug-2013 DeLesley Hutchins <delesley@google.com> Consumed analysis: improve handling of conditionals.
Patch by chris.wailes@gmail.com.

* The TestedVarsVisitor was folded into the ConsumedStmtVisitor.
* The VarTestResult class was updated to allow these changes.
* The PropagationInfo class was updated for the same reasons.
* Correctly handle short-circuiting of Boolean operations.
* Blocks are now marked as unreachable when we can statically prove we will
never branch to them.
* Unreachable blocks are skipped by the analysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189594 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
b01e2da54178f1b1b6ef43bf3fa91dcdd3ff3094 26-Aug-2013 DeLesley Hutchins <delesley@google.com> Consumed analyis: Renamed *PStatus to *PInfo.
The change was made for readability, as the PropagationInfo objects don't
always contain a status. This is submitted as a separate patch because it
touches a lot of lines and I don't want it cluttering up the next patch.
Patch by chris.wailes@gmail.com.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189278 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
344472ebeded2fca2ed5013b9e87f81d09bfa908 23-Aug-2013 Robert Wilhelm <robert.wilhelm@gmx.net> Use pop_back_val() instead of both back() and pop_back().
No functionality change intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189112 91177308-0d34-0410-b5e6-96231b3b80d8
FGReachabilityAnalysis.cpp
iveVariables.cpp
ninitializedValues.cpp
6a556a42d48cc098fb8dcb5d4ecdd0e03e32c0ec 23-Aug-2013 Pavel Labath <labath@google.com> [analyzer] Refactor conditional expression evaluating code

Summary:
Instead of digging through the ExplodedGraph, to figure out which edge brought
us here, I compute the value of conditional expression by looking at the
sub-expression values.

To do this, I needed to change the liveness algorithm a bit -- now, the full
conditional expression also depends on all atomic sub-expressions, not only the
outermost ones.

Reviewers: jordan_rose

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1340

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189090 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
5fdd207ec8f4c1f58bd74f8a84ce1935487563ce 22-Aug-2013 DeLesley Hutchins <delesley@google.com> Update to consumed analysis.

Patch by chris.wailes@gmail.com. The following functionality was added:

* The same functionality is now supported for both CXXOperatorCallExprs and CXXMemberCallExprs.
* Factored out some code in StmtVisitor.
* Removed variables from the state map when their destructors are encountered.
* Started adding documentation for the consumed analysis attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189059 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
df72071db0ddfd7264485105c19230c315e8ce2c 22-Aug-2013 David Majnemer <david.majnemer@gmail.com> Analysis: Make %I in printf more reasonable, add more tests


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188992 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
47ad6ce1afad6b70927347dfa15e0f1dc76bf5bb 21-Aug-2013 David Majnemer <david.majnemer@gmail.com> Analysis: Add support for MS specific printf format specifiers

Summary: Adds support for %I, %I32 and %I64.

Reviewers: hans, jordan_rose, rnk, majnemer

Reviewed By: majnemer

CC: cfe-commits, cdavis5x

Differential Revision: http://llvm-reviews.chandlerc.com/D1456

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188937 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
canfFormatString.cpp
7d0dcd2de023e2667a3f1f14daff9d087fab9bf7 19-Aug-2013 Jordan Rose <jordan_rose@apple.com> Omit arguments of __builtin_object_size from the CFG.

This builtin does not actually evaluate its arguments for side effects,
so we shouldn't include them in the CFG. In the analyzer, rely on the
constant expression evaluator to get the proper semantics, at least for
now. (In the future, we could get ambitious and try to provide path-
sensitive size values.)

In theory, this does pose a problem for liveness analysis: a variable can
be used within the __builtin_object_size argument expression but not show
up as live. However, it is very unlikely that such a value would be used
to compute the object size and not used to access the object in some way.

<rdar://problem/14760817>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188679 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
7336b9f8c0b58550a74c85a64f06d0fd74e7ad0d 16-Aug-2013 DeLesley Hutchins <delesley@google.com> Thread Safety Analysis: fix bug when using TryLock with && and || expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188505 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
cdd4b78583120222b82148626119b3e80ae1d291 16-Aug-2013 Eli Friedman <eli.friedman@gmail.com> Properly track l-paren of a CXXFucntionalCastExpr.

In addition to storing more useful information in the AST, this
fixes a semantic check in template instantiation which checks whether
the l-paren location is valid.

Fixes PR16903.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188495 91177308-0d34-0410-b5e6-96231b3b80d8
eachableCode.cpp
a44f03bced45059e7c4c7043992db3b4657032c2 15-Aug-2013 DeLesley Hutchins <delesley@google.com> Thread safety analysis: move warnings within lock/unlock functions out of beta.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188465 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
a72f7206a71b3901d1b4b2b4718a5013f46010f2 13-Aug-2013 Reid Kleckner <reid@kleckner.net> Silence a warning from MSVC about not returning a value

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188237 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
2d84f6b563e39c1e90e4d3d7e6846d46bc58ff5d 13-Aug-2013 Reid Kleckner <reid@kleckner.net> Remove Sema includes from Analysis code to fix layering

This moves a header-only class from Sema to Analysis and puts the option
check in Sema.

Patch by Chris Wailes!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188230 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
2d66dfa35375e032cd58a2580da8dd41ec955fc9 13-Aug-2013 Hans Wennborg <hans@hanshq.net> Speculative build fix for r188206.

The cmake-clang-x86_64 was upset:
error: 'template<class ImplClass, class RetTy> class clang::ConstStmtVisitor' used without template parameters

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188211 91177308-0d34-0410-b5e6-96231b3b80d8
onsumed.cpp
df7bef07eebd5c7913e8be09c62a6a470f255fd2 12-Aug-2013 DeLesley Hutchins <delesley@google.com> Patch by Chris Wailes <chris.wailes@gmail.com>.
Reviewed by delesley, dblaikie.

Add the annotations and code needed to support a basic 'consumed' analysis.

Summary:
This new analysis is based on academic literature on linear types. It tracks
the state of a value, either as unconsumed, consumed, or unknown. Methods are
then annotated as CallableWhenUnconsumed, and when an annotated method is
called while the value is in the 'consumed' state a warning is issued. A value
may be tested in the conditional statement of an if-statement; when this occurs
we know the state of the value in the different branches, and this information
is added to our analysis. The code is still highly experimental, and the names
of annotations or the algorithm may be subject to change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188206 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
onsumed.cpp
4ac73c7514f9e836b4d9781738f333c5cb91cb63 08-Aug-2013 Stephen Hines <srhines@google.com> Merge commit '51e75aecf4fb303b91c9e54fd88e3509e5acc7a6' into merge-20130807

Conflicts:
lib/Basic/Targets.cpp
lib/Sema/SemaDeclAttr.cpp

Change-Id: If457223ecbee9e43c73d15333bf10d36590d05c4
ac7cc2d37e82181e73fcc265c1d0a619d18b7605 19-Jul-2013 Jordan Rose <jordan_rose@apple.com> [analyzer] Include analysis stack in crash traces.

Sample output:

0. Program arguments: ...
1. <eof> parser at end of file
2. While analyzing stack:
#0 void inlined()
#1 void test()
3. crash-trace.c:6:3: Error evaluating statement

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186639 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
49bab4c0046e8300c79e79b7ca9a479696c7e87a 27-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Remove bogus VarDecl::extendsLifetimeOfTemporary function and inline it into
its only caller with a FIXME explaining why it's bogus.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185109 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
b96e74f79cc9f64a8d0080d4eff5d0431d2a48cf 26-Jun-2013 Aaron Ballman <aaron@aaronballman.com> Updating a link in the comments; no functional change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185013 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
4c98b1f67cdf385e05a86d54201b319cf1f1c042 22-Jun-2013 Anna Zaks <ganna@apple.com> [CFG] Set the “loop target” (back edge) for VisitObjCForCollectionStmt loops

Add the back edge info by creating a basic block, marked as loop target. This is
consistent with how other loops are processed, but was omitted from
VisitObjCForCollectionStmt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184617 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
2049840b0ffe8ee4bf39051cfa8ca08440c8f667 12-Jun-2013 Stephen Hines <srhines@google.com> Merge commit '1342a4ef62dd7b839c6f09348b246a4f00282f29' into merge_20130612
49a246f4fad959888bb0164c624c3c2b03078e91 06-Jun-2013 Jordan Rose <jordan_rose@apple.com> [analyzer; new edges] Simplify edges in a C++11 for-range loop.

Previously our edges were completely broken here; now, the final result
is a very simple set of edges in most cases: one up to the "for" keyword
for context, and one into the body of the loop. This matches the behavior
for ObjC for-in loops.

In the AST, however, CXXForRangeStmts are handled very differently from
ObjCForCollectionStmts. Since they are specified in terms of equivalent
statements in the C++ standard, we actually have implicit AST nodes for
all of the semantic statements. This makes evaluation very easy, but
diagnostic locations a bit trickier. Fortunately, the problem can be
generally defined away by marking all of the implicit statements as
part of the top-level for-range statement.

One of the implicit statements in a for-range statement is the declaration
of implicit iterators __begin and __end. The CFG synthesizes two
separate DeclStmts to match each of these decls, but until now these
synthetic DeclStmts weren't in the function's ParentMap. Now, the CFG
keeps track of its synthetic statements, and the AnalysisDeclContext will
make sure to add them to the ParentMap.

<rdar://problem/14038483>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183449 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
FG.cpp
2a1551fa14728891bf8e325d3eb686ed404cd8b2 04-Jun-2013 David Majnemer <david.majnemer@gmail.com> Analysis: Add a CFG successor to a SwitchStmt if it is both empty and fully covered

Consider the case where a SwitchStmt satisfied isAllEnumCasesCovered()
as well as having no cases at all (i.e. the enum it covers has no
enumerators).

In this case, we should add a successor to repair the CFG.

This fixes PR16212.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183237 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
2794bc0e3757992194dd587d0f6a253ec72afc9a 04-Jun-2013 Jordan Rose <jordan_rose@apple.com> CFG: In a DeclStmt, skip anything that's not a VarDecl.

Neither the compiler nor the analyzer are doing anything with non-VarDecl
decls in the CFG, and having them there creates extra nodes in the
analyzer's path diagnostics. Simplify the CFG (and the path edges) by
simply leaving them out. We can always add interesting decls back in when
they become relevant.

Note that this only affects decls declared in a DeclStmt, and then only
those that appear within a function body.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183157 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
451f8e4ed63c97065fcbc79cf1cbbbbe1c4b6bd9 20-May-2013 DeLesley Hutchins <delesley@google.com> Thread safety analysis: fix use after free bug reported by Evgeniy Stepanov.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182305 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
bb518991ce4298d8662235fc8cb13813f011c18d 18-May-2013 Jordan Rose <jordan_rose@apple.com> Revert "[analyzer; alternate edges] improve support for edges with PseudoObjectExprs."

Ted and I spent a long time discussing this today and found out that neither
the existing code nor the new code was doing what either of us thought it
was, which is never good. The good news is we found a much simpler way to
fix the motivating test case (an ObjCSubscriptExpr).

This reverts r182083, but pieces of it will come back in subsequent commits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182185 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
5c6134fd09bc5b738dafdd1c774edde13d95cb20 18-May-2013 DeLesley Hutchins <delesley@google.com> Thread safety analysis: add two new attributes to the thread safety analysis:
assert_exclusive_lock and assert_shared_lock. These attributes are used to
mark functions that dynamically check (i.e. assert) that a lock is held.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182170 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
e9aae62e8bca3abfc1dc36f67845444291171e13 17-May-2013 Ted Kremenek <kremenek@apple.com> [analyzer; alternate edges] improve support for edges with PseudoObjectExprs.

This optimizes some spurious edges resulting from PseudoObjectExprs.
This required far more changes than I anticipated. The current
ParentMap does not record any hierarchy information between
a PseudoObjectExpr and its *semantic* expressions that may be
wrapped in OpaqueValueExprs, which are the expressions actually
laid out in the CFG. This means the arrow pruning logic could
not map from an expression to its containing PseudoObjectExprs.

To solve this, this patch adds a variant of ParentMap that
returns the "semantic" parentage of expressions (essentially
as they are viewed by the CFG). This alternate ParentMap is then
used by the arrow reducing logic to identify edges into pseudo
object expressions, and then eliminate them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182083 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
d049b40ef411eee12a735233dbe04fdc42c67e1a 16-May-2013 Jordan Rose <jordan_rose@apple.com> Remove unused, awkward CFGStmtVisitor and subclasses.

This class is a StmtVisitor that distinguishes between block-level and
non-block-level statements in a CFG. However, it does so using a hard-coded
idea of which statements might be block-level, which probably isn't accurate
anymore. The only implementer of the CFGStmtVisitor hierarchy was the
analyzer's DeadStoresChecker, and the analyzer creates a linearized CFG
anyway (every non-trivial statement is a block-level statement).

This also allows us to remove the block-expr map ("BlkExprMap"), which
mapped statements to positions in the CFG. Apart from having a helper type
that really should have just been Optional<unsigned>, it was only being
used to ask /if/ a particular expression was block-level, for traversal
purposes in CFGStmtVisitor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181945 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ninitializedValues.cpp
7247c88d1e41514a41085f83ebf03dd5220e054a 15-May-2013 David Blaikie <dblaikie@gmail.com> Use only explicit bool conversion operator

The most common (non-buggy) case are where such objects are used as
return expressions in bool-returning functions or as boolean function
arguments. In those cases I've used (& added if necessary) a named
function to provide the equivalent (or sometimes negative, depending on
convenient wording) test.

DiagnosticBuilder kept its implicit conversion operator owing to the
prevalent use of it in return statements.

One bug was found in ExprConstant.cpp involving a comparison of two
PointerUnions (PointerUnion did not previously have an operator==, so
instead both operands were converted to bool & then compared). A test
is included in test/SemaCXX/constant-expression-cxx1y.cpp for the fix
(adding operator== to PointerUnion in LLVM).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181869 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
15f92bad58c8650b1306729744b1a1230197497a 10-May-2013 Hans Wennborg <hans@hanshq.net> Add support for __wchar_t in -fms-extensions mode.

MSVC provides __wchar_t. This is the same as the built-in wchar_t type
from C++, but it is also available with -fno-wchar and in C.

The commit changes ASTContext to have two different types for this:

- WCharTy is the built-in type used for wchar_t in C++ and __wchar_t.

- WideCharTy is the type of a wide character literal. In C++ this is
the same as WCharTy, and in C it is an integer type compatible with
the type in <stddef.h>.

This fixes PR15815.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181587 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
canfFormatString.cpp
5543169296beeb183b9c9392debc774fcf493eeb 05-May-2013 Dmitri Gribenko <gribozavr@gmail.com> Replace ArrayRef<T>() with None, now that we have an implicit ArrayRef constructor from None

Patch by Robert Wilhelm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181139 91177308-0d34-0410-b5e6-96231b3b80d8
odyFarm.cpp
83eba02c2ea333015335e2f74c4d11c5315b655d 03-May-2013 Stephen Hines <srhines@google.com> Merge remote-tracking branch 'upstream/master' into merge-20130502
c3bf52ced9652f555aa0767bb822ec4c64546212 21-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y: Allow aggregates to have default initializers.

Add a CXXDefaultInitExpr, analogous to CXXDefaultArgExpr, and use it both in
CXXCtorInitializers and in InitListExprs to represent a default initializer.

There's an additional complication here: because the default initializer can
refer to the initialized object via its 'this' pointer, we need to make sure
that 'this' points to the right thing within the evaluation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179958 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
5696884053b4a60dbed01ea8c7e6cd8dcf9b5de9 08-Apr-2013 DeLesley Hutchins <delesley@google.com> Thread safety analysis: turn on checking within lock and unlock functions.
These checks are enabled with the -Wthread-safety-beta flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179046 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
dd0a1f58a505ced9674f6d31a1ff65cb87774d67 01-Apr-2013 DeLesley Hutchins <delesley@google.com> Thread safety analysis: Turn on checking for non-scalar types by default.
These were previously enabled as a "beta" feature, but they have now been
extensively tested.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178478 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
75f8bd01319000b3e1438847505302670514759d 30-Mar-2013 Jordan Rose <jordan_rose@apple.com> [analyzer] Add debug helper LocationContext::dumpStack().

Sample output:
#0 void construct(pointer __p, llvm::ImutAVLTree<llvm::ImutContainerInfo<clang::ento::BugType *> > *const &__val)
#1 void push_back(const value_type &__x)
#2 void destroy()
#3 void release()
#4 void ~ImmutableSet()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178400 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
5062bb22706c8f2ceec5815533ff5a88d169d098 29-Mar-2013 Ted Kremenek <kremenek@apple.com> [cfg] Always guard (when AddStaticInitBranches == true) DeclStmts for static variables, not just ones with explicit initializers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178322 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
0f5c5c60e9806d13f0907cd99d7204ffab0e08f7 29-Mar-2013 Ted Kremenek <kremenek@apple.com> Add static analyzer support for conditionally executing static initializers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178318 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
02a88c3edf1aeb9580e0b6e444b30c52846a673c 29-Mar-2013 Ted Kremenek <kremenek@apple.com> Add configuration plumbing to enable static initializer branching in the CFG for the analyzer.

This setting still isn't enabled yet in the analyzer. This is
just prep work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178317 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
fbd4b5dc7febd1d8b4fa64ab00a29d72b44bec7b 28-Mar-2013 Ted Kremenek <kremenek@apple.com> Add CFG logic to create a conditional branch for modeling static initializers.

This is an optional variant of the CFG. This allows analyses to model whether
or not a static initializer has run, e.g.:

static Foo x = bar();

For basic dataflow analysis in Sema we will just assume that the initializer
always runs. For the static analyzer we can use this branch to accurately
track whether or not initializers are on.

This patch just adds the (opt-in) functionality to the CFG. The
static analyzer still needs to be modified to adopt this feature.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178263 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
8343f8e00a222ca09dde536c77313e3e6e03ad59 27-Mar-2013 Rafael Espindola <rafael.espindola@gmail.com> Add const in preparation for a simplify_type change in llvm.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178146 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
bd3aca04d304b9f31240b94af0aad818f6f932ab 06-Mar-2013 Stephen Hines <srhines@google.com> Update build rules for Clang merge to version 176138.

Change-Id: Ib028329a591e6175998d969f11b5404bf3f19e81
ndroid.mk
450b86c0c9ff8307f5145ced621914600196c500 06-Mar-2013 Stephen Hines <srhines@google.com> Merge commit 'b58f810669d9c17bcc025b7560de01d162856f34' into merge_20130226

Conflicts:
include/clang/Basic/LangOptions.def
lib/Sema/SemaDeclAttr.cpp

Change-Id: Ia10b4d3b2c949a72d328cb58b113f90237d4a5d5
b07805485c603be3d8011f72611465324c9e664b 23-Feb-2013 David Blaikie <dblaikie@gmail.com> Remove the CFGElement "Invalid" state.

Use Optional<CFG*> where invalid states were needed previously. In the one case
where that's not possible (beginAutomaticObjDtorsInsert) just use a dummy
CFGAutomaticObjDtor.

Thanks for the help from Jordan Rose & discussion/feedback from Ted Kremenek
and Doug Gregor.

Post commit code review feedback on r175796 by Ted Kremenek.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175938 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
FGStmtMap.cpp
iveVariables.cpp
eachableCode.cpp
hreadSafety.cpp
ninitializedValues.cpp
fdf6a279c9a75c778eba382d9a156697092982a1 21-Feb-2013 David Blaikie <dblaikie@gmail.com> Replace CFGElement llvm::cast support to be well-defined.

See r175462 for another example/more details.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175796 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
FGStmtMap.cpp
iveVariables.cpp
eachableCode.cpp
hreadSafety.cpp
ninitializedValues.cpp
66874fb18afbffb8b2ca05576851a64534be3352 21-Feb-2013 David Blaikie <dblaikie@gmail.com> Use None rather than Optional<T>() where possible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175705 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
ninitializedValues.cpp
dc84cd5efdd3430efb22546b4ac656aa0540b210 20-Feb-2013 David Blaikie <dblaikie@gmail.com> Include llvm::Optional in clang/Basic/LLVM.h

Post-commit CR feedback from Jordan Rose regarding r175594.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175679 91177308-0d34-0410-b5e6-96231b3b80d8
odyFarm.cpp
odyFarm.h
ormatString.cpp
ninitializedValues.cpp
3f6f51e28231f65de9c2dd150a2d757b2162cfa3 08-Feb-2013 Jordan Rose <jordan_rose@apple.com> Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.

Nearly all of these changes are one-to-one replacements; the few that
aren't have to do with custom identifier validation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174768 91177308-0d34-0410-b5e6-96231b3b80d8
ocoaConventions.cpp
b1855de3d61eab7d2f2e616ed59195f83e2a6dc0 05-Feb-2013 Ted Kremenek <kremenek@apple.com> Add note why we used a switch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174449 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
5846720f08a6b225484bfe663599c2b057a99bc8 05-Feb-2013 Ted Kremenek <kremenek@apple.com> Change subexpressions to be visited in the CFG from left-to-right.

This is a more natural order of evaluation, and it is very important
for visualization in the static analyzer. Within Xcode, the arrows
will not jump from right to left, which looks very visually jarring.
It also provides a more natural location for dataflow-based diagnostics.

Along the way, we found a case in the analyzer diagnostics where we
needed to indicate that a variable was "captured" by a block.

-fsyntax-only timings on sqlite3.c show no visible performance change,
although this is just one test case.

Fixes <rdar://problem/13016513>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174447 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ef95aea4fe779730de23ac84536cfd135b13a4b4 05-Feb-2013 Anna Zaks <ganna@apple.com> [analyzer] add comment

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174435 91177308-0d34-0410-b5e6-96231b3b80d8
odyFarm.cpp
22c0cbee5bb2150841e0046354fd37ba22de747a 04-Feb-2013 NAKAMURA Takumi <geek4civic@gmail.com> clang/Analysis: Fix r174245, a valgrind error in AnalysisDeclContext::getBody(bool &IsAutosynthesized), to initialize IsAutosynthesized explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174303 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
453cb859a3c8dcafe79ae840dfc35ff8eae1b4b3 02-Feb-2013 Anna Zaks <ganna@apple.com> [analyzer] Always inline functions with bodies generated by BodyFarm.

Inlining these functions is essential for correctness. We often have
cases where we do not inline calls. For example, the shallow mode and
when reanalyzing previously inlined ObjC methods as top level.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174245 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
cd376b63c42214c7851ca917e7da9d30f9e84fa4 09-Jan-2013 Stephen Hines <srhines@google.com> Update Clang for merge to r171906.

clang-tblgen-rules.mk - New AttrDump.inc target
lib/AST/Android.mk
lib/Analysis/Android.mk
lib/Basic/Android.mk
lib/Lex/Android.mk
lib/Parse/Android.mk
lib/Sema/Android.mk
lib/StaticAnalyzer/Checkers/Android.mk

Change-Id: If31b4c9123f730ab851f11b00b0688166b14b4b2
ndroid.mk
15bb58edc9d053aa49c28167deb41ff0409ddabc 21-Jan-2013 Stephen Hines <srhines@google.com> Merge commit 'd130fd2e141f1fef412c2d58e7385370801bd718' into merge-llvm

Conflicts:
lib/Basic/Targets.cpp

Change-Id: I90a669a33ffe4de8b32c8459016fd0b2a55da0ad
77fd3c0d7837040bb84c1617a6a423f833e784fe 19-Jan-2013 Ted Kremenek <kremenek@apple.com> -Wuninitialized: warn about uninitialized values resulting from ?: that evaluate to lvalues (in C++).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172875 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
0ecc2e9ce86b0705bc1a53a9c8f90c433bcdca1b 18-Jan-2013 DeLesley Hutchins <delesley@google.com> Thread-safety analysis: ignore edges from throw expressions in CFG.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172858 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
cdbe1e0d85d7d32452dd1c52758d7bfaa1c0663b 17-Jan-2013 Jordan Rose <jordan_rose@apple.com> Format strings: don't ever convert %+d to %lu.

Presumably, if the printf format has the sign explicitly requested, the user
wants to treat the data as signed.

This is a fix-up for r172739, and also includes several test changes that
didn't make it into that commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172762 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
242ae3d6805185fcb4fd45e96af5beba93e3532c 17-Jan-2013 Jordan Rose <jordan_rose@apple.com> Format strings: correct signedness if already correcting width (%d,%u).

It is valid to do this:
printf("%u", (int)x);

But if we see this:
printf("%lu", (int)x);

...our fixit should suggest %d, not %u.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172739 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
cd8ab51a44e80625d84126780b0d85a7732e25af 17-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++11 semantics for [[noreturn]] attribute. This required splitting
it apart from [[gnu::noreturn]] / __attribute__((noreturn)), since their
semantics are not equivalent (for instance, we treat [[gnu::noreturn]] as
affecting the function type, whereas [[noreturn]] does not).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172691 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
cfa88f893915ceb8ae4ce2f17c46c24a4d67502f 12-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Remove useless 'llvm::' qualifier from names like StringRef and others that are
brought into 'clang' namespace by clang/Basic/LLVM.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172323 91177308-0d34-0410-b5e6-96231b3b80d8
eachableCode.cpp
hreadSafety.cpp
ninitializedValues.cpp
67d472c19310c06efd5cb87c60b8489abf507233 11-Jan-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Test commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172195 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
dac62528c1a66db867e21cfa7cfc439d557d6f0c 07-Jan-2013 Will Dietz <wdietz2@illinois.edu> CFG.cpp: Fix wrapping logic when printing block preds/succs.

First check only wrapped with i==8, second wrapped at i==2,8,18,28,...
This fix restores the intended behavior: i==8,18,28,...

Found with -fsanitize=integer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171718 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
80ad52f327b532bded5c5b0ee38779d841c6cd35 02-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> s/CPlusPlus0x/CPlusPlus11/g


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171367 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
canfFormatString.cpp
d36aa359e2f45cd22c7366a015ad94de08044dbb 29-Dec-2012 Nico Weber <nicolasweber@gmx.de> ArrayRefize a CompoundStmt constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171238 91177308-0d34-0410-b5e6-96231b3b80d8
odyFarm.cpp
08165d8c9e954574408de59988b3331be58c3b36 21-Dec-2012 Anna Zaks <ganna@apple.com> [analyzer] Fix typos.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170907 91177308-0d34-0410-b5e6-96231b3b80d8
allGraph.cpp
bd80231672a7418aa1a99d3dbbe1774205c88f74 21-Dec-2012 Anna Zaks <ganna@apple.com> [analyzer] Re-apply r170826 and make the dumping of the GallGraph
deterministic.

Commit message for r170826:

[analyzer] Traverse the Call Graph in topological order.

Modify the call graph by removing the parentless nodes. Instead all
nodes are children of root to ensure they are all reachable. Remove the
tracking of nodes that are "top level" or global. This information is
not used and can be obtained from the Decls stored inside
CallGraphNodes.

Instead of existing ordering hacks, analyze the functions in topological
order over the Call Graph.

Together with the addition of devirtualizable ObjC message sends and
blocks to the call graph, this gives around 6% performance improvement
on several large ObjC benchmarks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170906 91177308-0d34-0410-b5e6-96231b3b80d8
allGraph.cpp
6d42f4d8b8a176336a8c49ec3cf5f7fb6545ccfd 21-Dec-2012 Rafael Espindola <rafael.espindola@gmail.com> Revert r170826. The output of

./bin/clang -cc1 -internal-isystem /home/espindola/llvm/build/lib/clang/3.3/include/ -analyze -analyzer-checker=debug.DumpCallGraph /home/espindola/llvm/clang/test/Analysis/debug-CallGraph.c -fblocks

changes in each run.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170829 91177308-0d34-0410-b5e6-96231b3b80d8
allGraph.cpp
e34e1939ad67576293b2b205b2169488cc6b3b14 21-Dec-2012 Anna Zaks <ganna@apple.com> [analyzer] Traverse the Call Graph in topological order.

Modify the call graph by removing the parentless nodes. Instead all
nodes are children of root to ensure they are all reachable. Remove the
tracking of nodes that are "top level" or global. This information is
not used and can be obtained from the Decls stored inside
CallGraphNodes.

Instead of existing ordering hacks, analyze the functions in topological
order over the Call Graph.

Together with the addition of devirtualizable ObjC message sends and
blocks to the call graph, this gives around 6% performance improvement
on several large ObjC benchmarks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170826 91177308-0d34-0410-b5e6-96231b3b80d8
allGraph.cpp
4f858dfd42c89b67200dac0afc228a0baa323691 21-Dec-2012 Anna Zaks <ganna@apple.com> [analyzer] Add blocks and ObjC messages to the call graph.

This paves the road for constructing a better function dependency graph.
If we analyze a function before the functions it calls and inlines,
there is more opportunity for optimization.

Note, we add call edges to the called methods that correspond to
function definitions (declarations with bodies).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170825 91177308-0d34-0410-b5e6-96231b3b80d8
allGraph.cpp
93699d23cd07c021eac2e26f8e32b58276bfa912 08-Dec-2012 DeLesley Hutchins <delesley@google.com> Thread-safety analysis: check member access on guarded non-primitive types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169669 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
b929f6636c79565e9a34c0656a962f9b198c5e80 06-Dec-2012 Ted Kremenek <kremenek@apple.com> Use the BlockDecl captures list to infer the direct captures for a BlockDataRegion. Fixes <rdar://problem/12415065>.

We still need to do a recursive walk to determine all static/global variables
referenced by a block, which is needed for region invalidation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169481 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
2cd3440369d9241173e994485ddf2589a50a7d80 05-Dec-2012 Jordan Rose <jordan_rose@apple.com> Format strings: offer a cast to 'unichar' for %C in Objective-C contexts.

For most cases where a conversion specifier doesn't match an argument,
we usually guess that the conversion specifier is wrong. However, if
the argument is an integer type and the specifier is %C, it's likely
the user really did mean to print the integer as a character.

(This is more common than %c because there is no way to specify a unichar
literal -- you have to write an integer literal, such as '0x2603',
and then cast it to unichar.)

This does not change the behavior of %S, since there are fewer cases
where printing a literal Unicode *string* is necessary, but this could
easily be changed in the future.

<rdar://problem/11982013>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169400 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
ff7be48165548c9c01492010609d166973607068 05-Dec-2012 Jordan Rose <jordan_rose@apple.com> Format strings: the correct conversion for 'char' is %c, not %d or %hhd.

We tried to account for 'uint8_t' by saying that /typedefs/ of 'char'
should be corrected as %hhd rather than %c, but the condition was wrong.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169397 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
91e2061763f5e59f57e59c6f141b74b5ff0408ad 05-Dec-2012 DeLesley Hutchins <delesley@google.com> Thread-safety analysis: check locks on method calls, operator=, and
copy constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169350 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
47715cc201170952029a52806bcc26f69c38272d 05-Dec-2012 DeLesley Hutchins <delesley@google.com> Thread Safety Analysis: refactor to make more methods accept const pointers,
adjust checkAccess. No change in functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169348 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
55fc873017f10f6f566b182b70f6fc22aefa3464 04-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Sort all of Clang's files under 'lib', and fix up the broken headers
uncovered.

This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/utils/sort_includes.py
script over the files.

I also manually added quite a few missing headers that were uncovered by
shuffling the order or moving headers up to be main-module-headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
odyFarm.cpp
odyFarm.h
allGraph.cpp
ocoaConventions.cpp
ormatStringParsing.h
iveVariables.cpp
rintfFormatString.cpp
eachableCode.cpp
canfFormatString.cpp
hreadSafety.cpp
a93d0f280693b8418bc88cf7a8c93325f7fcf4c6 01-Dec-2012 Benjamin Kramer <benny.kra@googlemail.com> Include pruning and general cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169095 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
2fa67efeaf66a9332c30a026dc1c21bef6c33a6c 01-Dec-2012 Benjamin Kramer <benny.kra@googlemail.com> Pull the Attr iteration parts out of Attr.h, so including DeclBase.h doesn't pull in all the generated Attr code.

Required to pull some functions out of line, but this shouldn't have a perf impact.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169092 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
hreadSafety.cpp
ninitializedValues.cpp
eba76a4379997f66f8114eb7e63206a5932b1be8 17-Nov-2012 Ted Kremenek <kremenek@apple.com> Further reduce "-fsyntax-only -Wuninitialized" time on sqlite3.c by another 2.5% using intelligent pruning of blocks during the final reporting pass.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168257 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
c1602581f7a4eab486489f09647d724ce35d3f23 17-Nov-2012 Ted Kremenek <kremenek@apple.com> Switch -Wuninitialized to use a reverse-post order traversal as
an initial baseline for enqueued blocks, but use a simple DFS stack
for propagating changes quickly up back edges.

This provides a 3.5% reduction in -fsyntax-only time on sqlite3.c.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168241 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
8f81acfa95a5d2a22fc875c1a10901eaa30b8405 13-Nov-2012 Ted Kremenek <kremenek@apple.com> Fix bad CFG construction bug when handling C++ 'try' statements.

This code assigned the last created CFGBlock* to the variable 'Block',
which is a scratch variable which is null'ed out after a block is
completed. By assigning the last created block to 'Block', we start
editing a completed block, inserting CFGStmts that should be in
another block. This was the case with 'try'. The test case that
showed this had a while loop inside a 'try', and the logic before
the while loop was being included as part of the "condition block"
for the loop. This showed up as a bogus dead store, but could
have lots of implications.

Turns out this bug was replicated a few times within CFG.cpp, so
I went and fixed up those as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167788 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
fadcd5d5bbe1bfc1c6b8d819cc2242f780a49fec 03-Nov-2012 Anna Zaks <ganna@apple.com> [analyzer] add LocationContext::inTopFrame() helper.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167351 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
507d106c758e745d3f71f44639092eb97d356525 13-Oct-2012 Ted Kremenek <kremenek@apple.com> Fix potential null deference in CFG printer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165836 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
857f5681f5e2bbb482f41f461add502b556c712a 13-Oct-2012 Ted Kremenek <kremenek@apple.com> Remove dead store.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165835 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
5dbd990d7978fb990b61a9bcf1b71314a3e743fe 12-Oct-2012 Ted Kremenek <kremenek@apple.com> Conditionally use an integral cast for BodyFarm support for OSAtomicCompareAndSwap if the return type is not a boolean.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165774 91177308-0d34-0410-b5e6-96231b3b80d8
odyFarm.cpp
48fa1361505c51cdc5e78deffdbdd7c334cca5d0 11-Oct-2012 Ted Kremenek <kremenek@apple.com> Switch over to BodyFarm implementation of OSAtomicCompareAndSwap and
objc_atomicCompareAndSwap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165743 91177308-0d34-0410-b5e6-96231b3b80d8
odyFarm.cpp
ef2388b10c41a9696d5d81f42ca79ff005fef7fc 06-Oct-2012 DeLesley Hutchins <delesley@google.com> Thread-safety analysis: allow attributes on constructors to refer to 'this'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165339 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
be9af1288881110e406b87914162eaa59f1e5918 02-Oct-2012 Lang Hames <lhames@gmail.com> Add FP_CONTRACT support for clang.

Clang will now honor the FP_CONTRACT pragma and emit LLVM
fmuladd intrinsics for expressions of the form A * B + C (when they occur in a
single statement).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164989 91177308-0d34-0410-b5e6-96231b3b80d8
odyFarm.cpp
da3d76b4cfbb5ebeb79e03a0abeabd403fe9260a 28-Sep-2012 Benjamin Kramer <benny.kra@googlemail.com> Avoid malloc thrashing in the uninitialized value analysis.

- The size of the packed vector is often small, save mallocs using SmallBitVector.
- Copying SmallBitVectors is also cheap, remove a level of indirection.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164827 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
81d18bf944bd885c48b693c2c8c651607001ad9d 24-Sep-2012 Ted Kremenek <kremenek@apple.com> Add clarifying comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164557 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
fcf8eba0c78634243383f92a77381e919e7e27ef 21-Sep-2012 Ted Kremenek <kremenek@apple.com> Experiment in BodyFarm of structuring AST creation calls in a hierarchy,
so that they visually look like an AST dump.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164401 91177308-0d34-0410-b5e6-96231b3b80d8
odyFarm.cpp
b80e5bb7c7c47e06f2ff9c2f9d4b6b138db180e2 21-Sep-2012 Ted Kremenek <kremenek@apple.com> Create helper method in BodyFarm for creating simple assignments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164400 91177308-0d34-0410-b5e6-96231b3b80d8
odyFarm.cpp
0b5c5e487bbbdeb2a7688e6c753d3b2a7c337604 21-Sep-2012 Ted Kremenek <kremenek@apple.com> Add helper method in BodyFarm to create unary dereferences.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164399 91177308-0d34-0410-b5e6-96231b3b80d8
odyFarm.cpp
9ba05cd2e24e600ab59b2ed893ae598abbbc9a36 21-Sep-2012 Ted Kremenek <kremenek@apple.com> Add helper method to BodyFarm for creating lvalue-to-rvalue conversions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164397 91177308-0d34-0410-b5e6-96231b3b80d8
odyFarm.cpp
a6d62a10a6e1b8aa3c8294d8cac842c3720df7ff 21-Sep-2012 Ted Kremenek <kremenek@apple.com> Add helper method to BodyFarm for creatinging integral casts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164396 91177308-0d34-0410-b5e6-96231b3b80d8
odyFarm.cpp
d2f388299153d80cbe5ffaaed8a882b59a1b59bc 21-Sep-2012 DeLesley Hutchins <delesley@google.com> Thread-safety analysis: better handling of unreachable blocks. Fixes a bug
where a call to function marked 'noreturn' is followed by unreachable
implicit destructor calls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164394 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
016c33d7bbca20c096ad8c7400b70f33aadfb224 21-Sep-2012 Ted Kremenek <kremenek@apple.com> Use helper method to create DeclRefExprs in BodyFarm, hopefully allevating
them being correctly constructed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164392 91177308-0d34-0410-b5e6-96231b3b80d8
odyFarm.cpp
0a4c0988c237678f4b5ba7375e51d24d2c55d67f 21-Sep-2012 Ted Kremenek <kremenek@apple.com> Add some structuring comments. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164391 91177308-0d34-0410-b5e6-96231b3b80d8
odyFarm.cpp
cc85d217d329aa3c78aa3f57a238e5b7931ee2c5 21-Sep-2012 Ted Kremenek <kremenek@apple.com> Add faux-body support for dispatch_once().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164348 91177308-0d34-0410-b5e6-96231b3b80d8
odyFarm.cpp
a43df9539644bf1c258e12710cd69d79b0b078cd 21-Sep-2012 Ted Kremenek <kremenek@apple.com> Implement faux-body-synthesis of well-known functions in the static analyzer when
their implementations are unavailable. Start by simulating dispatch_sync().

This change is largely a bunch of plumbing around something very simple. We
use AnalysisDeclContext to conjure up a fake function body (using the
current ASTContext) when one does not exist. This is controlled
under the analyzer-config option "faux-bodies", which is off by default.

The plumbing in this patch is largely to pass the necessary machinery
around. CallEvent needs the AnalysisDeclContextManager to get
the function definition, as one may get conjured up lazily.

BugReporter and PathDiagnosticLocation needed to be relaxed to handle
invalid locations, as the conjured body has no real source locations.
We do some primitive recovery in diagnostic generation to generate
some reasonable locations (for arrows and events), but it can be
improved.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164339 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
odyFarm.cpp
odyFarm.h
MakeLists.txt
60ff198a22815b0aec5b96eaae977de067dcd4c1 21-Sep-2012 DeLesley Hutchins <delesley@google.com> Thread-safety analysis: fix bug where shared trylock was treated
as exclusive.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164332 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
186af2de86aea41d7418158e68f96c1f8620e013 21-Sep-2012 DeLesley Hutchins <delesley@google.com> Thread safety analysis: properly canonicalize calls to virtual methods within
lock expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164324 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
2a237e03c407ff55bd8639b18658a8751955f1db 19-Sep-2012 DeLesley Hutchins <delesley@google.com> Thread-safety analysis: Fix warning when EXCLUSIVE_LOCKS_REQUIRED
is placed on a function that has no path to the exit block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164244 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
5b280f28351bbdc103cc50d3b0f52f92d286fa0a 19-Sep-2012 DeLesley Hutchins <delesley@google.com> Thread-safety analysis: fix ICE when EXCLUSIVE_LOCKS_REQUIRED or
LOCKS_EXCLUDED is used on a method with a name that is is not a simple
identifier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164242 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
e5b89ed6b54271623a358b3cd087f2d463a16c1b 13-Sep-2012 NAKAMURA Takumi <geek4civic@gmail.com> clang/lib/Analysis/ObjCNoReturn.cpp: Fix [-Wnewline-eof]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163775 91177308-0d34-0410-b5e6-96231b3b80d8
bjCNoReturn.cpp
670941c28c0683ecc251dafdf093a71629625dc9 13-Sep-2012 Jordan Rose <jordan_rose@apple.com> Format strings: offer a fixit for Darwin's %D/%U/%O to ISO %d/%u/%o.

<rdar://problem/12061922>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163772 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
275b6f52c7bcafc1f3cf291813b5c60ee776965a 13-Sep-2012 Jordan Rose <jordan_rose@apple.com> Format strings: %D, %U, and %O are valid on Darwin (same as %d, %u, %o).

These will warn under -Wformat-non-iso, and will still be rejected
outright on other platforms.

<rdar://problem/12061922>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163771 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
canfFormatString.cpp
25c1d57fc906e895535fb5c7e6dde80219f353b5 13-Sep-2012 Ted Kremenek <kremenek@apple.com> Teach -Wuninitialized to recognize common "noreturn" idioms in
Objective-C related to NSException.

Fixes <rdar://problem/12287498>

I debated whether or not this logic should be sunk into the CFG
itself. It's not clear if we should, as different analyses may
wish to have different policies. We can re-evaluate this in the
future.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163760 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
4ef19205b6912316296db74a9073ad6fa60e4cca 13-Sep-2012 Ted Kremenek <kremenek@apple.com> Refactor logic in ExprEngine for detecting 'noreturn' methods
in NSException to a helper object in libAnalysis that can also
be used by Sema. Not sure if the predicate name 'isImplicitNoReturn'
is the best one, but we can massage that later.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163759 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
bjCNoReturn.cpp
44ca53f34deb5efe9fc6f246781f66f1ed83eabc 12-Sep-2012 Ted Kremenek <kremenek@apple.com> Teach -Wuninitialized to recognize __attribute__((analyzer_noreturn))
for halting the propagation of uninitialized value tracking along
a path. Unlike __attribute__((noreturn)), this attribute (which
is used by clients of the static analyzer) can be used to annotate
functions that essentially never return, but in rare cares may be
allowed to return for (special) debugging purposes. This attribute
has been shown in reducing false positives in the static analyzer
by pruning false postives, and is equally applicable here.

Handling this attribute in the CFG itself is another option, but
this is not something all clients (e.g., possibly -Wunreachable-code)
would want to see.

Addresses <rdar://problem/12281583>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163681 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
f9ee0bacd27085417dedf1a9f5df8a4cb5a758c1 12-Sep-2012 DeLesley Hutchins <delesley@google.com> Thread-safety analysis: fix bug in expression matching code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163656 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
9f0b1324a5352713337c75ef4a5acffd96609c6c 11-Sep-2012 Stephen Hines <srhines@google.com> Merge branch 'upstream' into merge-2012_09_10
1ad23d62007162df82b58bca31b4aa277a5f6586 10-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Remove redundant semicolons which are null statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163546 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
canfFormatString.cpp
3f0ec5209726641782468bd4c7597e79dda78b15 10-Sep-2012 DeLesley Hutchins <delesley@google.com> Thread-safety analysis: differentiate between two forms of analysis; a precise
analysis that may give false positives because it is confused by aliasing, and
a less precise analysis that has fewer false positives, but may have false
negatives. The more precise warnings are enabled by -Wthread-safety-precise.
An additional note clarify the warnings in the precise case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163537 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
8be066e6733364cd34f25c4f7b7344f72aa23369 08-Sep-2012 Jordan Rose <jordan_rose@apple.com> Format strings: suggest %lld instead of %qd and %Ld with -Wformat-non-iso.

As a corollary to the previous commit, even when an extension is
available, we can still offer a fixit to the standard modifier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163453 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
bbb6bb4952b77e57b842b4d3096848123ae690e7 08-Sep-2012 Jordan Rose <jordan_rose@apple.com> Format strings: %Ld isn't available on Darwin or Windows.

This seems to be a GNU libc extension; we offer a fixit to %lld on
these platforms.

<rdar://problem/11518237>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163452 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
canfFormatString.cpp
589190b322a255c8e8b15dfde6b77ef498db7548 07-Sep-2012 Chad Rosier <mcrosier@apple.com> Ampersand goes with identifier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163410 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
2de4770ec07cf3ee6f0f3fcc100c2859e35da4c7 07-Sep-2012 Chad Rosier <mcrosier@apple.com> Bring buildbots back. Fix scoping issue and coding style from r163397.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163403 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
0b4db3e08a201c35f0011489bd5cd5d39bbe54fb 07-Sep-2012 DeLesley Hutchins <delesley@google.com> Thread-safety analysis: Add support for selectively turning off warnings
within part of a particular method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163397 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
31ba6135375433b617a8587ea6cc836a014ebd86 06-Sep-2012 Roman Divacky <rdivacky@freebsd.org> Dont cast away const needlessly. Found by gcc48 -Wcast-qual.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163325 91177308-0d34-0410-b5e6-96231b3b80d8
eachableCode.cpp
hreadSafety.cpp
5a1ffe98b04120846a15f7105905b5f363b08635 06-Sep-2012 Jordan Rose <jordan_rose@apple.com> [analyzer] Always include destructors in the analysis CFG.

While destructors will continue to not be inlined (unless the analyzer
config option 'c++-inlining' is set to 'destructors'), leaving them out
of the CFG is an incomplete model of the behavior of an object, and
can cause false positive warnings (like PR13751, now working).

Destructors for temporaries are still not on by default, since
(a) we haven't actually checked this code to be sure it's fully correct
(in particular, we probably need to be very careful with regard to
lifetime-extension when a temporary is bound to a reference,
C++11 [class.temporary]p5), and
(b) ExprEngine doesn't actually do anything when it sees a temporary
destructor in the CFG -- not even invalidate the object region.

To enable temporary destructors, set the 'cfg-temporary-dtors' analyzer
config option to '1'. The old -cfg-add-implicit-dtors cc1 option, which
controlled all implicit destructors, has been removed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163264 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
FG.cpp
fd0f11ccd51154e933fad7dfa134cb4f62c87056 05-Sep-2012 DeLesley Hutchins <delesley@google.com> Thread-safety analysis: bugfix for case where a trylock occurs in an
expression involving temporaries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163237 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
5408153e9140f34bbca9059638c61cc12bd539cf 01-Sep-2012 DeLesley Hutchins <delesley@google.com> Thread-safety analysis: fix handling of LOCK_RETURNED attribute so that the
latest definition of a function is always used when computing lock expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163028 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
4e4c15765d5f097e21dcaa30f1a94481924340f7 31-Aug-2012 DeLesley Hutchins <delesley@google.com> Thread-safety analysis: fix handling of string constants in mutex
expressions, which should be ignored right now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163026 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
3d1125b27e8006385a830f5b3748b7b44d227b4c 24-Aug-2012 Ted Kremenek <kremenek@apple.com> Teach CFG that 'if (x & 0)' and 'if (x * 0)' is an unfeasible branch.

Fixes <rdar://problem/11005770>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162545 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
80ea4bc944eb01c220eeaa004b21ad709ba928e1 24-Aug-2012 Stephen Hines <srhines@google.com> Merge branch 'upstream' into merge_2

Conflicts:
lib/Sema/SemaDeclAttr.cpp

Change-Id: If47d0d39459760017258502b4d9e859ac36a273b
b66529d04727dc686b97ea3d937fc9785792f505 23-Aug-2012 Jordan Rose <jordan_rose@apple.com> [analyzer] Support C++ default arguments if they are literal values.

A CXXDefaultArgExpr wraps an Expr owned by a ParmVarDecl belonging to the
called function. In general, ExprEngine and Environment ought to treat this
like a ParenExpr or other transparent wrapper expression, with the inside
expression evaluated first.

However, if we call the same function twice, we'd produce a CFG that contains
the same wrapped expression twice, and we're not set up to handle that. I've
added a FIXME to the CFG builder to come back to that, but meanwhile we can
at least handle expressions that don't need to be explicitly evaluated:
literals. This probably handles many common uses of default parameters:
true/false, null, etc.

Part of PR13385 / <rdar://problem/12156507>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162453 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ad0fe03b897f9486191e75c8d90c3ffa9b4fd6a5 23-Aug-2012 Ted Kremenek <kremenek@apple.com> Fix an assortment of doxygen comment issues found by -Wdocumentation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162412 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
66c486f275531df6362b3511fc3af6563561801b 22-Aug-2012 Ted Kremenek <kremenek@apple.com> Rename 'currentX' to 'currX' throughout analyzer and libAnalysis.
Also rename 'getCurrentBlockCounter()' to 'blockCount()'.

This ripples a bunch of code simplifications; mostly aesthetic,
but makes the code a bit tighter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162349 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
c739406d37b9b1dc95bc3a3d899024e5ce31e5d5 14-Aug-2012 Anna Zaks <ganna@apple.com> [analyzer] Teach live variable analyzes that super uses self pointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161822 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
ee2f032fe0fc86762608458c2a167ae504579a64 10-Aug-2012 DeLesley Hutchins <delesley@google.com> Thread-safety-analysis: adds existential quantification over lock
expressions. The syntax &MyClass::mutex is interpreted as a
pattern that matches m->mutex for any object m of type MyClass.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161691 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
a74b715cdc37c4523818a4018faae99d977aa537 10-Aug-2012 DeLesley Hutchins <delesley@google.com> Thread safety analysis: refactor to support more sophisticated handling
of expressions, and better error messages.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161690 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
a1fa47139d6e9e7dcc40f2809605d1a258624e7f 10-Aug-2012 DeLesley Hutchins <delesley@google.com> Refactor thread safety analysis to use a different data structure
to track locksets. This is in preparation for further changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161680 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
7094dee95f8c915d27097ac18b47d1ef31fd72ed 10-Aug-2012 Joerg Sonnenberger <joerg@bec.de> Add missing cctype includes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161660 91177308-0d34-0410-b5e6-96231b3b80d8
ocoaConventions.cpp
f7158fa034174d2756736d1032b75d01d9deeb4c 07-Aug-2012 Hans Wennborg <hans@hanshq.net> Properly check length modfiers for %n in format strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161408 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
canfFormatString.cpp
58e1e54476d610d6c33ef483f216ed8a1282d35c 07-Aug-2012 Hans Wennborg <hans@hanshq.net> Remove ScanfArgType and bake that logic into ArgType.

This is useful for example for %n in printf, which expects
a pointer to int with the same logic for checking as %d
would have in scanf.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161407 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
canfFormatString.cpp
f3749f4168c5cee59627a681ca4ca6e4116d0761 07-Aug-2012 Hans Wennborg <hans@hanshq.net> Rename analyze_format_string::ArgTypeResult to ArgType

Also remove redundant constructors and unused member functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161403 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
canfFormatString.cpp
ee959355b93c0648fea88dc986d196e3705407dc 03-Aug-2012 Shih-wei Liao <sliao@google.com> Apply changes to migrate to CLANG-160673-20120724.

Change-Id: I00d23ac9b893c62dca281ec771eeb5f911854bae
ndroid.mk
08fc8eb5a1cc9c01af67e016ab21c9b905711eb1 03-Aug-2012 Shih-wei Liao <sliao@google.com> Merge with Clang upstream r160673 (Jul 24th 2012)

Conflicts:
lib/Sema/SemaDeclAttr.cpp

Change-Id: I37f02f20642a037b9da8d35fefa01986cd250b14
5deddafd3ef51e94b4ac4d80e38271d3768b1af6 31-Jul-2012 Hans Wennborg <hans@hanshq.net> -Wformat: better handling of qualifiers on pointer arguments

Warn about using pointers to const-qualified types as arguments to
scanf. Ignore the volatile qualifier when checking if types match.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161052 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
canfFormatString.cpp
cec9ce49dcf4b4b768043f96c8ef8c1d4cdbb6b9 30-Jul-2012 Hans Wennborg <hans@hanshq.net> Make -Wformat check the argument type for %n.

This makes Clang check that the corresponding argument for "%n" in a
format string is a pointer to int.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160966 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
canfFormatString.cpp
4684778993c667246039b4664acbce59dc99440c 27-Jul-2012 Hans Wennborg <hans@hanshq.net> Make -Wformat walk the typedef chain when looking for size_t, etc.

Clang's -Wformat fix-its currently suggest using "%zu" for values of
type size_t (in C99 or C++11 mode). However, for a type such as
std::vector<T>::size_type, it does not notice that type is actually
typedeffed to size_t, and instead suggests a format for the underlying
type, such as "%lu" or "%u".

This commit makes the format string fix mechanism walk the typedef chain
so that it notices if the type is size_t, even if that isn't "at the
top".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160886 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
canfFormatString.cpp
11abf2ad01f64ede7c0555167f41a1c5852f80c6 27-Jul-2012 NAKAMURA Takumi <geek4civic@gmail.com> clang/lib: [CMake] Update tblgen'd dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160851 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
866abce3b93ab01bac00e0383a753819893b868a 27-Jul-2012 NAKAMURA Takumi <geek4civic@gmail.com> clang/lib: [CMake] Reformat, alphabetize lists.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160850 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
b9d0b76e42fd2d4cdfd135220302458d03ad09fe 27-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Final piece of core issue 1330: delay computing the exception specification of
a defaulted special member function until the exception specification is needed
(using the same criteria used for the delayed instantiation of exception
specifications for function temploids).

EST_Delayed is now EST_Unevaluated (using 1330's terminology), and, like
EST_Uninstantiated, carries a pointer to the FunctionDecl which will be used to
resolve the exception specification.

This is enabled for all C++ modes: it's a little faster in the case where the
exception specification isn't used, allows our C++11-in-C++98 extensions to
work, and is still correct for C++98, since in that mode the computation of the
exception specification can't fail.

The diagnostics here aren't great (in particular, we should include implicit
evaluation of exception specifications for defaulted special members in the
template instantiation backtraces), but they're not much worse than before.

Our approach to the problem of cycles between in-class initializers and the
exception specification for a defaulted default constructor is modified a
little by this change -- we now reject any odr-use of a defaulted default
constructor if that constructor uses an in-class initializer and the use is in
an in-class initialzer which is declared lexically earlier. This is a closer
approximation to the current draft solution in core issue 1351, but isn't an
exact match (but the current draft wording isn't reasonable, so that's to be
expected).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160847 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
1d3ca251f9891623fac0dbe70eece42564e274ed 26-Jul-2012 Jordan Rose <jordan_rose@apple.com> [analyzer] Don't crash on implicit statements inside initializers.

Our BugReporter knows how to deal with implicit statements: it looks in
the ParentMap until it finds a parent with a valid location. However, since
initializers are not in the body of a constructor, their sub-expressions are
not in the ParentMap. That was easy enough to fix in AnalysisDeclContext.

...and then even once THAT was fixed, there's still an extra funny case
of Objective-C object pointer fields under ARC, which are initialized with
a top-level ImplicitValueInitExpr. To catch these cases,
PathDiagnosticLocation will now fall back to the start of the current
function if it can't find any other valid SourceLocations. This isn't great,
but it's miles better than a crash.

(All of this is only relevant when constructors and destructors are being
inlined, i.e. under -cfg-add-initializers and -cfg-add-implicit-dtors.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160810 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
d7f1d134a03ace51f8d142fbb7f436330704ede5 26-Jul-2012 Jordan Rose <jordan_rose@apple.com> [analyzer] Variables with destructors are live until the destructor is run.

Test case in the next commit, which enables destructors under certain
circumstances.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160805 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
56df4a9e0461d4dfb2a740cb6b0ce531d6c82538 24-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> When a && or || appears as the condition of a ?:, perform appropriate
short-circuiting when building the CFG. Also be sure to skip parens before
checking for the && / || special cases. Finally, fix some crashes in CFG
printing in the presence of calls to destructors for array of array of class
type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160691 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
bed28ac1d1463adca3ecf24fca5c30646fa9dbb2 23-Jul-2012 Sylvestre Ledru <sylvestre@debian.org> Fix a typo (the the => the)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160622 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
fd8b43596478b779b6777cb3a595e69d7856c378 20-Jul-2012 Jordan Rose <jordan_rose@apple.com> Add a reverse iterator to DeclStmt, and use it when building a CFG.

The CFG creates dummy DeclStmts with one Decl per statement, and it has
to do so from last to first in order to build the graph correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160560 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
eee18c38b6dd29c0e6982f5565fcbc3f76d1bf4d 19-Jul-2012 Ted Kremenek <kremenek@apple.com> Simplify UninitializedValues.cpp by removing logic to handle the previous (imprecise) representation
of '&&' and '||' in the CFG. This is no longer needed, and greatly simplifies the code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160494 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
88237bf587581026dcfc8386abf055cb201aa487 18-Jul-2012 Ted Kremenek <kremenek@apple.com> Teach CFG construction about destructors resulting from references to array types. Fixes crash in <rdar://problem/11671507>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160424 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
6cfa78f6bd4e7d5e23366a0907f8f8792366bc4c 17-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Uninitialized variables: two little changes:
* Treat compound assignment as a use, at Jordy's request.
* Always add compound assignments into the CFG, so we can correctly diagnose the use in 'return x += 1;'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160334 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
9532e0d89ca2afa556f032aa9377f6ec1d3eaa3e 17-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> -Wuninitialized: Split the classification of DeclRefExprs as initialization or
use out of TransferFunctions, and compute it in advance rather than on-the-fly.

This allows us to handle compound assignments with DeclRefExprs on the RHS
correctly, and also makes it trivial to treat const& function parameters as not
initializing the argument. The patch also makes both of those changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160330 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
3f635c08b2d0b2d5bafb38da09589cb238407faa 14-Jul-2012 Ted Kremenek <kremenek@apple.com> Refine CFG so that '&&' and '||' don't lead to extra confluence points when used in a branch, but
instead push the terminator for the branch down into the basic blocks of the subexpressions of '&&' and '||'
respectively. This eliminates some artifical control-flow from the CFG and results in a more
compact CFG.

Note that this patch only alters the branches 'while', 'if' and 'for'. This was complex enough for
one patch. The remaining branches (e.g., do...while) can be handled in a separate patch, but they
weren't immediately tackled because they were less important.

It is possible that this patch introduces some subtle bugs, particularly w.r.t. to destructor placement.
I've tried to audit these changes, but it is also known that the destructor logic needs some refinement
in the area of '||' and '&&' regardless (i.e., their are known bugs).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160218 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
5c3ea5c57971317c35b120ef0a2a2c79bd171008 14-Jul-2012 Ted Kremenek <kremenek@apple.com> Hoist CFG builder logic for '&&' and '||' into helper method. No funcationlity change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160217 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
449d4d5a338690d35deb6cf57ccd4e02edd5ceca 14-Jul-2012 Ted Kremenek <kremenek@apple.com> Remove unused method declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160216 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
6960ee6c7cc8a8883126d9861beecb51a4e4a475 14-Jul-2012 Ted Kremenek <kremenek@apple.com> Sort prototypes. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160215 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
558e8872b364b43ab9f201dd6b2df9a5b74b0542 14-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13360: When deciding the earliest point which inevitably leads to an
uninitialized variable use, walk back over branches where we've reached all the
non-null successors, not just cases where we've reached all successors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160206 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
13106117060c90d6f84bd2ed7a5c03e0502ff419 10-Jul-2012 DeLesley Hutchins <delesley@google.com> Thread safety analysis: impove handling of trylock expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160018 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
8d3ba23f2d9e6c87794d059412a0808c9cbacb25 06-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Implement AST classes for comments, a real parser for Doxygen comments and a
very simple semantic analysis that just builds the AST; minor changes for lexer
to pick up source locations I didn't think about before.

Comments AST is modelled along the ideas of HTML AST: block and inline content.

* Block content is a paragraph or a command that has a paragraph as an argument
or verbatim command.
* Inline content is placed within some block. Inline content includes plain
text, inline commands and HTML as tag soup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159790 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
5381c05f51e5b7c7627f1d95b9a3425303ce086a 05-Jul-2012 DeLesley Hutchins <delesley@google.com> Thread-safety analysis: eliminate false positives in case where the definition
duplicates attributes on the declaration. Also eliminates a false negative in
ReleasableMutexLock. Fixing this bug required some refactoring.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159780 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
471c8b49982d1132f30b0b0da27fef94fd6e4f67 04-Jul-2012 Benjamin Kramer <benny.kra@googlemail.com> Drop the ASTContext.h include from DeclFriend.h and DeclTemplate.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159723 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
478851c3ed6bd784e7377dffd8e57b200c1b9ba9 04-Jul-2012 Benjamin Kramer <benny.kra@googlemail.com> Drop the ASTContext.h include from Stmt.h and fix up transitive users.

This required moving the ctors for IntegerLiteral and FloatingLiteral out of
line which shouldn't change anything as they are usually called through Create
methods that are already out of line.

ASTContext::Deallocate has been a nop for a long time, drop it from ASTVector
and make it independent from ASTContext.h

Pass the StorageAllocator directly to AccessedEntity so it doesn't need to
have a definition of ASTContext around.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159718 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
seudoConstantAnalysis.cpp
96fac6a7fe89deff7860e536febbd4ae17bb57f3 03-Jul-2012 DeLesley Hutchins <delesley@google.com> Thread safety analysis: improve handling of smart pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159679 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
9d6e7f3e12f1a825377ace33161e80caeda8cd06 03-Jul-2012 DeLesley Hutchins <delesley@google.com> Thread Safety Analysis: handle expressions involving temporaries,
e.g. ExprWithCleanups.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159674 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
a9e8b9e3e90fcfe10a04624a89c39b63c32614d1 03-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> -Wuninitialized: assume that an __attribute__((returns_twice)) function might
initialize any variable. This is extremely conservative, but is sufficient for
now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159620 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
bbe334142b38d2f9dad3ae2eb7b332c54a5b2cc1 03-Jul-2012 DeLesley Hutchins <delesley@google.com> Thread safety analysis: fixed bug that occurs when very silly people
use scoped_lockable without putting unlock_function on the
destructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159609 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
879a4334e4c4cab0c22ba91492ffc2838bbc21fc 03-Jul-2012 DeLesley Hutchins <delesley@google.com> Thread safety analysis: fixed incorrect error message at the end of a locks_required function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159607 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
c36eda1113e014400d32fbbb99be36ff0b41f795 03-Jul-2012 DeLesley Hutchins <delesley@google.com> Thread safety analysis: don't warn in case of duplicate annotation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159606 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
76f0a6e9bc9ee5aae029f959f64fae290727cca4 02-Jul-2012 DeLesley Hutchins <delesley@google.com> Thread Safety Analysis: turn off checking within trylock functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159601 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
d4aeb8050a1d0fe47c53a73361c8b0b8ac310f46 02-Jul-2012 Ted Kremenek <kremenek@apple.com> Bail out the LiveVariables analysis when the CFG is very large, as
we are encountering some scalability issues with memory usage. The
appropriate long term fix is to make the analysis more scalable, but
this will at least prevent the analyzer swapping when
analyzing very large functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159578 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
c99a5d820ead4e4f1f4b4a8ab61007b8da0307e6 29-Jun-2012 DeLesley Hutchins <delesley@google.com> Thread safety analysis: support release() function on scoped
lockable objects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159387 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
f63797c741e646b9482d204c88dee02fb41d7962 25-Jun-2012 DeLesley Hutchins <delesley@google.com> Thread safety analysis: implement lock_returned attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159152 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
0da4414f3d30c34fafb81b13b2cec3680c0bc9e1 22-Jun-2012 DeLesley Hutchins <delesley@google.com> Thread safety analysis: fixes a bug in which locksets are not handled
properly if there is a join point in the control flow graph that involves
a trylock. Also changes the source locations of some warnings to be
more consistent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159008 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
b0d8671f95fe08a220118bca29063ba4d11a9dac 21-Jun-2012 Chandler Carruth <chandlerc@gmail.com> Remove a goofy CMake hack and use the standard CMake facilities to
express library-level dependencies within Clang.

This is no more verbose really, and plays nicer with the rest of the
CMake facilities. It should also have no change in functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158888 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
8f40dcc4ddbe4ef796dd1bf0696ac66d4e40e99a 17-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> -Wuninitialized bugfix: when entering the scope of a variable with no
initializer, it is uninitialized, even if we may be coming from somewhere where
it was initialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158611 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
581deb3da481053c4993c7600f97acf7768caac5 06-Jun-2012 David Blaikie <dblaikie@gmail.com> Revert Decl's iterators back to pointer value_type rather than reference value_type

In addition, I've made the pointer and reference typedef 'void' rather than T*
just so they can't get misused. I would've omitted them entirely but
std::distance likes them to be there even if it doesn't use them.

This rolls back r155808 and r155869.

Review by Doug Gregor incorporating feedback from Chandler Carruth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158104 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ninitializedValues.cpp
facde171ae4b8926622a1bffa833732a06f1875b 06-Jun-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove unused private member variables found by clang's new -Wunused-private-field.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158086 91177308-0d34-0410-b5e6-96231b3b80d8
allGraph.cpp
a08e7bc74b5635995fc50009f240dd3feb1999e2 06-Jun-2012 Francois Pichet <pichet2000@gmail.com> Zap the /Za compiler switch from MSVC projects, the option is considered harmful even by Microsoft people and clang won't build using the MSVC 2012 RC if not removed.

Only 1 minor code change was necessary: can't use cdecl as variable name anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158063 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
033a9c0804f48119a03b73a2af42a04d4d0294ce 05-Jun-2012 Jordan Rose <jordan_rose@apple.com> Make suggestions for mismatched enum arguments to printf/scanf.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157962 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
canfFormatString.cpp
ee0259d308e72141982a85b40863e760a8447edf 05-Jun-2012 Jordan Rose <jordan_rose@apple.com> Teach printf/scanf about enums with fixed underlying types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157961 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
7fa9b4f258636d89342eda28f21a986c8ac353b1 01-Jun-2012 Ted Kremenek <kremenek@apple.com> static analyzer: add inlining support for directly called blocks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157833 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
153acdb7310b20a72e608cbb10946621f161eb70 30-May-2012 Jordan Rose <jordan_rose@apple.com> Suggest '%@' for Objective-C objects in ObjC format strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157716 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
2815e1a075c74143a0b60a632090ece1dffa5c7c 25-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Split a chunk of -Wconditional-uninitialized warnings out into a separate flag,
-Wsometimes-uninitialized. This detects cases where an explicitly-written branch
inevitably leads to an uninitialized variable use (so either the branch is dead
code or there is an uninitialized use bug).

This chunk of warnings tentatively lives within -Wuninitialized, in order to
give it more visibility to existing Clang users.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157458 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
818918855d84e3db1af5a0807070d4995ca2cf75 25-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Some cleanups around the uninitialized variables warning, and a FIXME. No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157440 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
101d4e0c8ffbcdaaa58cddf1c20f98aa1b4501c4 08-May-2012 Hans Wennborg <hans@hanshq.net> Make -Wformat accept printf("%hhx", c); with -funsigned-char

For "%hhx", printf expects an unsigned char. This makes Clang
accept a 'char' argument for that also when using -funsigned-char.

This fixes PR12761.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156388 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
392da48160bd92ceb486792780467cbfdb2d0e8c 04-May-2012 James Molloy <james.molloy@arm.com> Fix handling of wint_t - we can't assume wint_t is purely an integer promotion of wchar_t - they may differ in signedness.

Teach ASTContext about WIntType, and have it taken from TargetInfo like WCharType. Should fix test/Sema/format-strings.c for ARM, with the exception of one subtest which will fail if wint_t and wchar_t are the same size and wint_t is signed, wchar_t is unsigned.

There'll be a followup commit to fix that.

Reviewed by Chandler and Hans at http://llvm.org/reviews/r/8



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156165 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
e0d3b4cd2b66f1cef26cacbed5820ab7c22ad5b3 03-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Add -Wimplicit-fallthrough warning flag, which warns on fallthrough between
cases in switch statements. Also add a [[clang::fallthrough]] attribute, which
can be used to suppress the warning in the case of intentional fallthrough.

Patch by Alexander Kornienko!

The handling of C++11 attribute namespaces in this patch is temporary, and will
be replaced with a cleaner mechanism in a subsequent patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156086 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
262bc18e32500558af7cb0afa205b34bd37bafed 30-Apr-2012 David Blaikie <dblaikie@gmail.com> Remove the ref/value inconsistency in filter_decl_iterator.

filter_decl_iterator had a weird mismatch where both op* and op-> returned T*
making it difficult to generalize this filtering behavior into a reusable
library of any kind.

This change errs on the side of value, making op-> return T* and op* return
T&.

(reviewed by Richard Smith)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155808 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ninitializedValues.cpp
b86b8551ce619450b2eb4fc708ead08b83996da7 30-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR11926 + duplicates: Fix crash in -Wuninitialized when using a compiler like
g++4.7, which reuses stack space allocated for temporaries. CFGElement::getAs
returns a suitably-cast version of 'this'. Patch by Markus Trippelsdorf!

No test: this code has the same observable behavior as the old code when built
with most compilers, and the tests were already failing when built with a
compiler for which this produced a broken binary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155803 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
d200187bd27f9ad68699693a6e57f9ee3ff260fa 28-Apr-2012 Jordy Rose <jediknil@belkadan.com> [analyzer] Remove references to idx::TranslationUnit. Index is dead, cross-TU inlining never panned out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155751 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
fa784da5b9039ead42323bfe9ae6d33ab3c5c6b3 24-Apr-2012 Shih-wei Liao <sliao@google.com> Merge with CLANG upstream r155088.

Conflicts:
lib/Basic/Targets.cpp

Change-Id: Id80f069ae25e623967b705e9fa11cfd94dd2461c
0b3ade86a1c60cf0c7b56aa238aff458eb7f5974 20-Apr-2012 Anna Zaks <ganna@apple.com> [analyzer] Run remove dead bindings right before leaving a function.

This is needed to ensure that we always report issues in the correct
function. For example, leaks are identified when we call remove dead
bindings. In order to make sure we report a callee's leak in the callee,
we have to run the operation in the callee's context.

This change required quite a bit of infrastructure work since:
- We used to only run remove dead bindings before a given statement;
here we need to run it after the last statement in the function. For
this, we added additional Program Point and special mode in the
SymbolReaper to remove all symbols in context lower than the current
one.
- The call exit operation turned into a sequence of nodes, which are
now guarded by CallExitBegin and CallExitEnd nodes for clarity and
convenience.

(Sorry for the long diff.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155244 91177308-0d34-0410-b5e6-96231b3b80d8
rogramPoint.cpp
54c350a67b47f059e1d577bdd9e2d1dc31ff82b5 19-Apr-2012 DeLesley Hutchins <delesley@google.com> Refactor the thread safety analysis so that it is easier to do
path-sensitive analysis like handling of trylock expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155137 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
e6975e9b0985ad7f7ff9187e38d95bfe9ac4181b 17-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement DR1330 in C++11 mode, to support libstdc++4.7 which uses it.

We have a new flavor of exception specification, EST_Uninstantiated. A function
type with this exception specification carries a pointer to a FunctionDecl, and
the exception specification for that FunctionDecl is instantiated (if needed)
and used in the place of the function type's exception specification.

When a function template declaration with a non-trivial exception specification
is instantiated, the specialization's exception specification is set to this
new 'uninstantiated' kind rather than being instantiated immediately.

Expr::CanThrow has migrated onto Sema, so it can instantiate exception specs
on-demand. Also, any odr-use of a function triggers the instantiation of its
exception specification (the exception specification could be needed by IRGen).
In passing, fix two places where a DeclRefExpr was created but the corresponding
function was not actually marked odr-used. We used to get away with this, but
don't any more.

Also fix a bug where instantiating an exception specification which refers to
function parameters resulted in a crash. We still have the same bug in default
arguments, which I'll be looking into next.

This, plus a tiny patch to fix libstdc++'s common_type, is enough for clang to
parse (and, in very limited testing, support) all of libstdc++4.7's standard
headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154886 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
534986f2b21e6050bf00163cd6423fd92155a6ed 14-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Add an AttributedStmt type to represent a statement with C++11 attributes
attached. Since we do not support any attributes which appertain to a statement
(yet), testing of this is necessarily quite minimal.

Patch by Alexander Kornienko!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154723 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
87e154c09bbb060a0620bc988d7723bee64fb79c 13-Apr-2012 Douglas Gregor <dgregor@apple.com> Remove the unused, unmaintained, incomplete 'Index' library.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154672 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
6a86082f3a06a2dcceaaf63f78a0e52d64bcbaa3 13-Apr-2012 Anna Zaks <ganna@apple.com> [analyzer] PCH deserialization optimization.

We should not deserialize unused declarations from the PCH file. Achieve
this by storing the top level declarations during parsing
(HandleTopLevelDecl ASTConsumer callback) and analyzing/building a call
graph only for those.

Tested the patch on a sample ObjC file that uses PCH. With the patch,
the analyzes is 17.5% faster and clang consumes 40% less memory.
Got about 10% overall build/analyzes time decrease on a large Objective
C project.

A bit of CallGraph refactoring/cleanup as well..

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154625 91177308-0d34-0410-b5e6-96231b3b80d8
allGraph.cpp
83748e2f41ea0ac7c954946feb5da9ccc6ab8bec 12-Apr-2012 Ted Kremenek <kremenek@apple.com> Include lambda capture init expressions in CFG.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154611 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
55331da3211151aa67277aa095b7d301342200d4 12-Apr-2012 Ted Kremenek <kremenek@apple.com> Fix CFGBuilder to not include the body of a LambdaExpr in the CFG of the enclosing function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154607 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
bb3d20f80c98e7919411bc7e062d69b17462899b 05-Apr-2012 Ted Kremenek <kremenek@apple.com> Do not crash in the callgraph construction when encountering deleted function definitions. Fixes <rdar://problem/11178609>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154081 91177308-0d34-0410-b5e6-96231b3b80d8
allGraph.cpp
6955da2cad4bce19c541ddb85a6d965d77a1a4ab 25-Mar-2012 NAKAMURA Takumi <geek4civic@gmail.com> clang/lib/Analysis/CFG.cpp: Get rid of early insertion of placeholder to the map.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153407 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
9260f618e72f7c70dc76312f95d679f0ed03858c 25-Mar-2012 NAKAMURA Takumi <geek4civic@gmail.com> clang/lib/Analysis/CFG.cpp: Fix memory leak since r153297.

evaluateAsBooleanConditionNoCache(S) might update the map and invalidate the iterator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153406 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
560ad31c413724fafd13d6fd723e403f28daa132 22-Mar-2012 Shih-wei Liao <sliao@google.com> Migrate external/clang to CLANG-153220-20120321.

Change-Id: I3b469a42a5048f05f06d14aba34419119047e1a9
ndroid.mk
d316862f4fb281ec08a2e45cd3e5580574adb889 24-Mar-2012 Shih-wei Liao <sliao@google.com> Merge branch 'upstream' into sliao_d
8c6d360636dee25f1ce071c3656810c6632cb89d 23-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [CFG] Cache boolean evaluations of expressions to avoid multiple re-evaluations
during construction of branches for chained logical operators.

This makes -fsyntax-only for test/Sema/many-logical-ops.c about 32x times faster.

With measuring SemaExpr.cpp I see differences below the noise level.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153297 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
550f2234fc9218914c325041067052342dfce553 22-Mar-2012 Ted Kremenek <kremenek@apple.com> Fix broken CFG when an initializer is a statement expression that starts with a while loop (PR 12325).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153242 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
3d7c44e01d568e5d5c0fac9c6ccb3f080157ba19 21-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Malloc: Utter the name of the leaked variable.
Specifically, we use the last store of the leaked symbol in the leak diagnostic.
(No support for struct fields since the malloc checker doesn't track those
yet.)

+ Infrastructure to track the regions used in store evaluations.
This approach is more precise than iterating the store to
obtain the region bound to the symbol, which is used in RetainCount
checker. The region corresponds to what is uttered in the code in the
last store and we do not rely on the store implementation to support
this functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153212 91177308-0d34-0410-b5e6-96231b3b80d8
rogramPoint.cpp
4cf225382a8b061dce41733c962d62b6db9721f8 20-Mar-2012 Ted Kremenek <kremenek@apple.com> Fix crash when querying the CFG reported when using the thread safety analysis
on code using multi-dimensional arrays. Fix by DeLesley Hutchins, and reported in
PR 12271.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153067 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
44b8e4652d8e20c1e6611b35803e47b4a013b6c2 17-Mar-2012 Jordy Rose <jediknil@belkadan.com> Kill cocoa::deriveNamingConvention and cocoa::followsFundamentalRule. They are now just simple wrappers around method families, and method decls can cache method family lookups. Also, no one is using them right now.

The one difference between ObjCMethodDecl::getMethodFamily and Selector::getMethodFamily is that the former will do some additional sanity checking, and since CoreFoundation types don't look like Objective-C objects, an otherwise interesting method will get a method family of OMF_None. Future clients that use method families should consider how they want to handle CF types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153000 91177308-0d34-0410-b5e6-96231b3b80d8
ocoaConventions.cpp
afcd1954be90965d832ae56f1413beae836c3346 15-Mar-2012 Ted Kremenek <kremenek@apple.com> Support '%p' format specifier with block pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152839 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
d53e877ddf885da28aa4668148a5f0ce0045ab54 14-Mar-2012 Matt Beaumont-Gay <matthewbg@google.com> Fix dereference of end iterator. Spotted by ASan.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152738 91177308-0d34-0410-b5e6-96231b3b80d8
allGraph.cpp
a2e589e60d147f4f04cee5682b8389b55c410244 13-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Refactor CallGraph to use Recursive AST visitor when
collecting function Decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152651 91177308-0d34-0410-b5e6-96231b3b80d8
allGraph.cpp
4e4d08403ca5cfd4d558fa2936215d3a4e5a528d 11-Mar-2012 David Blaikie <dblaikie@gmail.com> Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).

The member variable is always "LangOpts" and the member function is always "getLangOpts".

Reviewed by Chris Lattner

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152536 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
FG.cpp
9b20a90dff2ed605153c68a5c58b6aadcdb0952b 10-Mar-2012 Benjamin Kramer <benny.kra@googlemail.com> Replace a map of boolean values with a set.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152494 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
f4b88a45902af1802a1cb42ba48b1c474474f228 10-Mar-2012 John McCall <rjmccall@apple.com> Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr to
track whether the referenced declaration comes from an enclosing
local context. I'm amenable to suggestions about the exact meaning
of this bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152491 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
seudoConstantAnalysis.cpp
hreadSafety.cpp
337e4dbc6859589b8878146a88bebf754e916702 10-Mar-2012 Ted Kremenek <kremenek@apple.com> [analyzer] fix regression in analyzer of NOT actually aborting on Stmts it doesn't understand. We registered
as aborted, but didn't treat such cases as sinks in the ExplodedGraph.

Along the way, add basic support for CXXCatchStmt, expanding the set of code we actually analyze (hopefully correctly).

Fixes: <rdar://problem/10892489>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152468 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
a5d531f67de0cfeb56b843da15146f3b4cd75bd9 09-Mar-2012 Anna Zaks <ganna@apple.com> CallGraph: Add getNode() method, constify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152439 91177308-0d34-0410-b5e6-96231b3b80d8
allGraph.cpp
f85626453123f9691bcef13cff963f556e209c27 09-Mar-2012 Hans Wennborg <hans@hanshq.net> -Wformat-non-iso: warn about positional arguments (pr12017)

This renames the -Wformat-non-standard flag to -Wformat-non-iso,
rewords the current warnings a bit (pointing out that a format string
is not supported by ISO C rather than being "non standard"),
and adds a warning about positional arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152403 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
d2776613703a516f107decc06b38a0b60a10542c 09-Mar-2012 Anna Zaks <ganna@apple.com> Call Graph: Only the root node is allowed to have an invalid Decl*.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152350 91177308-0d34-0410-b5e6-96231b3b80d8
allGraph.cpp
a50a5cd9db67f061c94557d188b992be34ccad2f 08-Mar-2012 Daniel Dunbar <daniel@zuster.org> Remove stray semi-colon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152331 91177308-0d34-0410-b5e6-96231b3b80d8
allGraph.cpp
196b8cfe9cfcc452eb2f83aa4ad330c2324f8c7d 08-Mar-2012 Anna Zaks <ganna@apple.com> Add a basic CallGraph to Analysis.

The final graph contains a single root node, which is a parent of all externally available functions(and 'main'). As well as a list of Parentless/Unreachable functions, which are either truly unreachable or are unreachable due to our analyses imprecision.

The analyzer checkers debug.DumpCallGraph or debug.ViewGraph can be used to look at the produced graph.

Currently, the graph is not very precise, for example, it entirely skips edges resulted from ObjC method calls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152272 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
allGraph.cpp
9fcce65e7e1307b5b8da9be13e4092d6bb94dc1d 07-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> AST representation for user-defined literals, plus just enough of semantic
analysis to make the AST representation testable. They are represented by a
new UserDefinedLiteral AST node, which is a sugared CallExpr. All semantic
properties, including full CodeGen support, are achieved for free by this
representation.

UserDefinedLiterals can never be dependent, so no custom instantiation
behavior is required. They are mangled as if they were direct calls to the
underlying literal operator. This matches g++'s apparent behavior (but not its
actual mangling, which is broken for literal-operator-ids).

User-defined *string* literals are now fully-operational, but the semantic
analysis is quite hacky and needs more work. No other forms of user-defined
literal are created yet, but the AST support for them is present.

This patch committed after midnight because we had already hit the quota for
new kinds of literal yesterday.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152211 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
8e282c332f8ad51dedf86a185a4dcb78ef93fb51 07-Mar-2012 Ted Kremenek <kremenek@apple.com> Fix horrific CFG bug where '@autoreleasepool' would be put in a dangling block in the CFG.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152163 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
361035524dc26094825134f30c07311f38f4f8b1 06-Mar-2012 Stephen Hines <srhines@google.com> Merge with upstream Clang @152062.

Added include/clang/Config/config.h
(note the ANDROID_CONFIG_H header guard because CONFIG_H is already taken)

Added support for AttrTemplateInstantiate TableGen rules.

Added libLLVMVectorize dependency.

Build
-HostInfo.cpp
-CallGraph.cpp
+GlobalCallGraph.cpp
-MultiInitializer.cpp
+PPCallbacks.cpp
+SemaConsumer.cpp
+ChainedDiagnosticConsumer.cpp
+DependencyGraph.cpp
+DiagnosticRenderer.cpp
+LayoutOverrideSource.cpp
+WindowsToolChain.cpp
+SemaLambda.cpp
+BoolAssignmentChecker.cpp
+LambdaMangleContext.cpp
+CStringSyntaxChecker.cpp
+ObjCContainersASTChecker.cpp
+ObjCContainersChecker.cpp
+VirtualCallChecker.cpp
+Dominators.cpp
+SubEngine.cpp
+RewriteModernObjC.cpp

Change-Id: Ifda805ce87ae132f055131f4f83692b5c3d63d17
ndroid.mk
91932089c31e1233f0c478b03412e90a65e07ad2 05-Mar-2012 Stephen Hines <srhines@google.com> Merge branch 'upstream' into merge-20120305

Conflicts:
lib/Basic/Targets.cpp

Change-Id: Ib76c138030a701355ce39a6eda1a89a79f401667
0d95dfcc0e07a81596ab7c3e9e86ab663fd4541c 03-Mar-2012 DeLesley Hutchins <delesley@google.com> Thread safety analysis: expand set of expressions that can be used to denote locks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151956 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
2a35be803c405221f5f23c7bdedb91f09efdd3ac 02-Mar-2012 DeLesley Hutchins <delesley@google.com> Thread safety analysis: handle CFG blocks which call functions marked as noreturn.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151944 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
b2c60b04a597cc5ba4154837cf8e0a155a376fd7 01-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move llvm/ADT/SaveAndRestore.h -> llvm/Support/SaveAndRestore.h.

Needs llvm update.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151829 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
FG.cpp
ninitializedValues.cpp
d45d361f2ce5c37824052357e2218e8a5509eba5 27-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move "clang/Analysis/Support/SaveAndRestore.h" to "llvm/ADT/SaveAndRestore.h"
to make it more widely available.

Depends on llvm commit r151564

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151566 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
FG.cpp
ninitializedValues.cpp
76517426dc8bf7734c07eefc35171a6bfdba1a2b 22-Feb-2012 Hans Wennborg <hans@hanshq.net> Warn about non-standard format strings (pr12017)

This adds the -Wformat-non-standard flag (off by default,
enabled by -pedantic), which warns about non-standard
things in format strings (such as the 'q' length modifier,
the 'S' conversion specifier, etc.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151154 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
2f13bec63b0236b169b026b7bc852da51ee029a7 16-Feb-2012 DeLesley Hutchins <delesley@google.com> Thread-safety analysis: Disable checking inside constructors, destructors, lock, and unlock functions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150701 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
4bda3eca138d39585c9e475ad25aa9ff053f923b 16-Feb-2012 DeLesley Hutchins <delesley@google.com> Thread-Safety: added support for 'this' as a lock expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150700 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
32addd519c6699000ff79c387a1c87f0ab7c3698 16-Feb-2012 Hans Wennborg <hans@hanshq.net> Format string analysis: give 'q' its own enumerator.

This is in preparation for being able to warn about 'q' and other
non-standard format string features.

It also allows us to print its name correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150697 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
canfFormatString.cpp
be6126a2a784e1446460b8d15c2b26f880c871fc 15-Feb-2012 Hans Wennborg <hans@hanshq.net> Make -Wformat fix-its preserve original conversion specifiers.

This commit makes PrintfSpecifier::fixType() and ScanfSpecifier::fixType()
only fix a conversion specification enough that Clang wouldn't warn about it,
as opposed to always changing it to use the "canonical" conversion specifier.
(PR11975)

This preserves the user's choice of conversion specifier in cases like:

printf("%a", (long double)1);
where we previously suggested "%Lf", we now suggest "%La"

printf("%x", (long)1);
where we previously suggested "%ld", we now suggest "%lx".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150578 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
canfFormatString.cpp
b4a3ef783cb3e9c8a927130d65385988a6aabaa3 06-Feb-2012 Ted Kremenek <kremenek@apple.com> Tweak format string checking to work with %@ and ObjC toll-free bridging. <rdar://problem/10814120>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149907 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
6f42b62b6194f53bcbc349f5d17388e1936535d7 05-Feb-2012 Dylan Noblesmith <nobled@dreamwidth.org> Basic: import OwningPtr<> into clang namespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149798 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
2e5156274b8051217565b557bfa14c80f7990e9c 03-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Thread safety analysis:
* When we detect that a CFG block has inconsistent lock sets, point the
diagnostic at the location where we found the inconsistency, and point a note
at somewhere the inconsistently-locked mutex was locked.
* Fix the wording of the normal (non-loop, non-end-of-function) case of this
diagnostic to not suggest that the mutex is going out of scope.
* Fix the diagnostic emission code to keep a warning and its note together when
sorting the diagnostics into source location order.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149669 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
aacde7174af6c5759b52dc0ceb7b167d323afb6a 03-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Thread safety analysis: at a CFG join point between a block terminating in a
'continue' and another block, prefer the lockset from the other block, and
diagnose the 'continue' block as being the end of a loop.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149666 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
7da1f4679332277614b6c583df66c3bfd94ded66 31-Jan-2012 Hans Wennborg <hans@hanshq.net> Format string warnings: don't a.k.a. wchar_t with wchar_t.

This fixes the case where Clang would output:
error: format specifies type 'wchar_t *' (aka 'wchar_t *')

ArgTypeResult::getRepresentativeTypeName needs to take into account
that wchar_t can be a built-in type (as opposed to in C, where it is a
typedef).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149387 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
54a7e3f6778c804d0fe983efb9f62d6d27d86eb4 31-Jan-2012 Erik Verbruggen <erikjv@me.com> [CFG] Removed unused local variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149385 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
339b9072e26a2a0fe796dc69c4d28d964d0ec86d 31-Jan-2012 Nico Weber <nicolasweber@gmx.de> Let %S, %ls, %C match 16bit types in NSStrings.

As discussed at http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120130/052200.html



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149325 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
e6ca97f2aeb301e28d20988b27c4297a9b540991 25-Jan-2012 Ted Kremenek <kremenek@apple.com> Fix NSLog format string checking for %@.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148885 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
9d24c2cbd9cf1b7c165ccb13221f2efb2f4b49b0 24-Jan-2012 Ted Kremenek <kremenek@apple.com> Teach scanf/printf checking about '%Ld' and friends (a GNU extension). Fixes PR 9466.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148859 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
canfFormatString.cpp
23661d3e348c5f44ae89b6848bbc331829bb46f2 24-Jan-2012 David Blaikie <dblaikie@gmail.com> Revert various template unreachability code I committed accidentally.

r148774, r148775, r148776, r148777

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148780 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
a9bb955b499c244d24d02311f0f9100ade506794 24-Jan-2012 David Blaikie <dblaikie@gmail.com> More fixes/tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148777 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
7154c03b366c4a6d83c086b624af269f779eb7b0 24-Jan-2012 David Blaikie <dblaikie@gmail.com> Support undefined dependent bases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148775 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
e03b2b3ca9032b18fd1c3d0fca7692e4d2551277 21-Jan-2012 DeLesley Hutchins <delesley@google.com> Handle thread safety attributes on functions with separate definitions and declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148599 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
ef1440b6eca118d46291166ce3302f9bba8e639b 20-Jan-2012 Ted Kremenek <kremenek@apple.com> The 'l' length modifier makes sense with the scanlist conversion specifier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148586 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
3026348bd4c13a0f83b59839f64065e0fcbea253 20-Jan-2012 David Blaikie <dblaikie@gmail.com> More dead code removal (using -Wunreachable-code)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148577 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ocoaConventions.cpp
ormatString.cpp
canfFormatString.cpp
37969b7e14d6a4dfd934ef6d3738cc90b832ec1d 12-Jan-2012 Hans Wennborg <hans@hanshq.net> scanf: parse the 'm' length modifier, and check that the right arguments
are used with that and the 'a' length modifier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148029 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
canfFormatString.cpp
28058d179ae40edc66135458849f1073c841bc74 12-Jan-2012 Hans Wennborg <hans@hanshq.net> scanf analysis: the 'a' length modifier is valid with a scanlist

Before r148025 we (accidentally) didn't check whether a length modifier is
appropriate for a scanlist, but now we do.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148026 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
6de0b48c5531cfe7370e1a9eeaed0566fa65dc9b 12-Jan-2012 Hans Wennborg <hans@hanshq.net> scanf analysis: don't bail out after successful parse of scanlist

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148025 91177308-0d34-0410-b5e6-96231b3b80d8
canfFormatString.cpp
97a72c35a62304c3781aa280e28cb97a59afd585 11-Jan-2012 Zhongxing Xu <xuzhongxing@foxmail.com> Add elidable CXXConstructExpr as block-level expr. It converts an lvalue to a rvalue, which is a useful step during AST evaluation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147918 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
b4fa418a72759dfe34add850837965cbc00626e4 06-Jan-2012 DeLesley Hutchins <delesley@google.com> Thread safety analysis: added support for trylock attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147672 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
b37d2b5c0819d9ef596c7baec1e0be0d7c45b547 06-Jan-2012 DeLesley Hutchins <delesley@google.com> Added LocalVariableMap

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147670 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
1c87980ef18dbf4669c7194d60138ff9747d7ab7 04-Jan-2012 Ted Kremenek <kremenek@apple.com> Teach the static analyzer to not treat XPC types as CF types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147506 91177308-0d34-0410-b5e6-96231b3b80d8
ocoaConventions.cpp
df49782c54802ca1a4c1d36d66186aa039f32aec 29-Dec-2011 DeLesley Hutchins <delesley@google.com> Support for thread safety attributes on functions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147331 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
5294c792c715b8dba26711be482b7a32be04d4d5 28-Dec-2011 Hans Wennborg <hans@hanshq.net> Support the 'a' scanf length modifier as an extension in C++.

It should not be supported in C++11, since that uses the C99 standard
library, in which 'a' is a format specifier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147310 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
72b20ff76a9070c1a481331e857aa825ae37c97f 28-Dec-2011 Zhongxing Xu <xuzhongxing@foxmail.com> Enable the user to control whether CXXConstructExpr will be added as a
block-level expr. Currently CXXConstructExpr is always added as a block-level
expr. This caused two problems for the analyzer (and potentially for the
CFG-based codegen).
1. We have no way to know whether a ctor call is base or complete.
2. We have no way to know the destination object being contructed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147306 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
682060c5d95f6e4f79536013781ab0870cdd3850 23-Dec-2011 Ted Kremenek <kremenek@apple.com> Colorize and condense CFG pretty-printing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147203 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
FG.cpp
15ce164836472bfba88b30e53aa3f6ac0fb8a95d 22-Dec-2011 Ted Kremenek <kremenek@apple.com> Enhance AnalysisDeclContext::getReferencedBlockVars() to understand PseudoObjExprs. It turns out
that the information collected by this method is a super set of the captured variables in BlockDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147122 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
iveVariables.cpp
280cf1451b4f02093e47ce956a0688407aa595b9 22-Dec-2011 Ted Kremenek <kremenek@apple.com> Fix regression in LiveVariables when reasoning about variables captured by blocks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147116 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
3b7a48fbc681c6fb59e5304a210c30dbb49dabea 21-Dec-2011 Ted Kremenek <kremenek@apple.com> Improve CFG pretty-printing for CXXConstructExprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147068 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
893d414534273e153e12aef39a1ad991c6fa94c0 21-Dec-2011 Ted Kremenek <kremenek@apple.com> Improve CFG pretty-printing of CastExprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147066 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
3ff53b3587862439a1a84a7b0bc9a7dbee0cf4eb 20-Dec-2011 Chandler Carruth <chandlerc@gmail.com> Update the CMake build for r146959's new files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146967 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
99ba9e3bd70671f3441fb974895f226a83ce0e66 20-Dec-2011 David Blaikie <dblaikie@gmail.com> Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146959 91177308-0d34-0410-b5e6-96231b3b80d8
ominators.cpp
iveVariables.cpp
ostOrderCFGView.cpp
eachableCode.cpp
9b879db75be6b8db4a7c804e9bba4c07c4cfa81c 16-Dec-2011 Logan Chien <loganchien@google.com> Apply changes to migrate to clang upstream r146715.

Change-Id: I7a40ad93f4cc76a6e748ba314ac06a1bef473bbf
ndroid.mk
298aaf2c97ab7c4d5bd3a8e8d8112e3bc77b29b6 16-Dec-2011 Logan Chien <loganchien@google.com> Merge with clang upstream r146715 (Dec 16th 2011)

Change-Id: I66024a7b6eb0ee37d7b3ff7ce41c0bfb4b514bee
7723fec9b45b7258c0eddf4cbfd0d335348f5edc 15-Dec-2011 Douglas Gregor <dgregor@apple.com> Keep track of all declarations of an Objective-C class (both forward
declarations and definitions) as ObjCInterfaceDecls within the same
redeclaration chain. This new representation matches what we do for
C/C++ variables/functions/classes/templates/etc., and makes it
possible to answer the query "where are all of the declarations of
this class?"



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146679 91177308-0d34-0410-b5e6-96231b3b80d8
ocoaConventions.cpp
d02deebce5f1b283101e035a7f5d5bab0d2068ec 15-Dec-2011 Hans Wennborg <hans@hanshq.net> Support the 'a' length modifier in scanf format strings as a C90
extension.

This fixes gcc.dg/format/c90-scanf-3.c and ext-4.c (test for excess
errors).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146649 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
ormatStringParsing.h
rintfFormatString.cpp
canfFormatString.cpp
6fcd932dfd6835f70cc00d6f7c6789793f6d7b66 10-Dec-2011 Hans Wennborg <hans@hanshq.net> Check that arguments to a scanf call match the format specifier,
and offer fixits when there is a mismatch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146326 91177308-0d34-0410-b5e6-96231b3b80d8
canfFormatString.cpp
630821869c4ec4604ab479d66e5ff81147a858e1 09-Dec-2011 Hans Wennborg <hans@hanshq.net> Remove unnecessary braces from my previous commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146259 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
f4f0c6095d1f481b94c6821c65e3bf1c9df42af7 09-Dec-2011 Hans Wennborg <hans@hanshq.net> Make printf warnings refer to wint_t and wchar_t by name
in addition to underlying type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146254 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
b8ec3e35d2d7a56b21cb449d4a7bde8d9d12c2a5 09-Dec-2011 Hans Wennborg <hans@hanshq.net> Move definition of ConversionSpecifier::toString() to FormatString.cpp

It's declared in FormatString.h, so it shouldn't be defined in
PrintfFormatString.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146253 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
117348caf0a8f91782e9e32e32a8689576f394d7 09-Dec-2011 Hans Wennborg <hans@hanshq.net> fix format specifier fixit for printf("%ld", "foo");

It should reset the length modifier (unless it's a wchar_t string).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146252 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
1fa3c0682a52c45c4ad0be3a82d0c85f26657072 08-Dec-2011 DeLesley Hutchins <delesley@google.com> This patch extends thread safety analysis with support for the scoped_lockable attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146174 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
a792aff1c7de253b89c473fdb7eef4a5bba83aec 07-Dec-2011 Hans Wennborg <hans@hanshq.net> Make printf warnings refer to intmax_t et al. by name
in addition to underlying type.

For example, the warning for printf("%zu", 42.0);
changes from "conversion specifies type 'unsigned long'" to "conversion
specifies type 'size_t' (aka 'unsigned long')"

(This is a second attempt after r145697, which got reverted.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146032 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
02f34c5003b2c5067675f89ffce0a84c28faf722 05-Dec-2011 Anna Zaks <ganna@apple.com> [analyzer] Rely on LLVM Dominators in Clang dominator computation.

(Previously, Clang used it's implementation of dominators.)

The patch is contributed by Guoping Long!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145858 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
MakeLists.txt
ominators.cpp
687b5df89d4ba91219df578d02087c68c09a0332 03-Dec-2011 Nick Lewycky <nicholas@mxc.ca> Revert r145697 and dependent patch r145702. It added a dependency from
lib/Analysis to lib/Sema which is cyclical.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145724 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
377cc6e3e8a6d9d0c90a315d29ce84836383d059 02-Dec-2011 Hans Wennborg <hans@hanshq.net> Make r145697 actually work.

Use the canonical type of the typedef to compare with the underlying type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145702 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
5fdc1b993dcb01e8a994fdacfc4eb089832c82e3 02-Dec-2011 Hans Wennborg <hans@hanshq.net> Make conversion specifier warning refer to typedef if possible.

For example, the warning for printf("%zu", 42.0);
changes from "conversion specifies type 'unsigned long'" to "conversion
specifies type 'size_t' (aka 'unsigned long')"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145697 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
2a710c84db1ebf0c16cba0ff121ca8e15f045a07 25-Nov-2011 Logan Chien <loganchien@google.com> Merge with clang upstream r145117 (Nov 25th 2011)

Change-Id: Id4fde985342e3c81f13887e8728bd94b82523642
2d9eb21325a0854e86de7344f54a8e6cef2a97ad 15-Nov-2011 Douglas Gregor <dgregor@apple.com> Teach the CFG builder how to properly destroy temporaries who
lifetimes have been extended via reference binding. The type of the
reference and the type of the temporary are not necessarily the same,
which could cause a crash. Fixes <rdar://problem/10398199>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144646 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
71d9a71d19099a6673750b47b32e9786803fa81d 15-Nov-2011 Logan Chien <loganchien@google.com> Merge with clang upstream r144605 (Nov 15th 2011)

Conflicts:
include/clang-c/Index.h
include/clang/AST/APValue.h
include/clang/AST/DeclBase.h
include/clang/AST/DeclObjC.h
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Serialization/ASTWriter.h
lib/AST/APValue.cpp
lib/AST/ASTImporter.cpp
lib/AST/DeclObjC.cpp
lib/AST/ExprConstant.cpp
lib/Driver/ToolChains.cpp
lib/Frontend/SerializedDiagnosticPrinter.cpp
lib/Frontend/Warnings.cpp
lib/Lex/HeaderSearch.cpp
lib/Lex/LiteralSupport.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaInit.cpp
lib/Sema/SemaPseudoObject.cpp
test/Analysis/misc-ps.c
test/Analysis/retain-release-path-notes.m
test/CodeGen/string-literal-unicode-conversion.c
test/CodeGenCXX/blocks.cpp
test/Driver/crash-cleanup.c
test/Misc/serialized-diags.c
test/Misc/warning-flags.c
tools/c-index-test/c-index-test.c
tools/libclang/CXLoadedDiagnostic.cpp
tools/libclang/IndexDecl.cpp
tools/libclang/IndexTypeSourceInfo.cpp
tools/libclang/Indexing.cpp
tools/libclang/IndexingContext.cpp
tools/libclang/IndexingContext.h
tools/libclang/libclang.exports

Change-Id: I6621e7d5d9a9d1e4cdec7b7b62ffa6dffaff375d
ccf1bfde160c03c677ba530c9dcb77365a9c2d7b 14-Nov-2011 Ted Kremenek <kremenek@apple.com> [analyzer] teach AnalysisDeclContext::getSelfDecl() about blocks that capture the 'self' variable of the enclosing ObjC method decl. Fixes <rdar://problem/10380300>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144556 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisDeclContext.cpp
48a60c042162fa57933e96907fd869b04b26f3be 11-Nov-2011 Stephen Hines <srhines@google.com> Update Clang to svn 144355.

Change-Id: I36bd8b4479f887ed75abb84021996aff77b33bd9
ndroid.mk
0a888d46a277a3aa53ece23d8cf37bf6d7810f3e 09-Nov-2011 John McCall <rjmccall@apple.com> We don't add ExprWithCleanups to the CFG, and getSVal looks
through it, so we should look through it for the live-values
analysis as well.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144190 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
7acf4bf00ecc31652177b3ac1d3f523346581d71 06-Nov-2011 John McCall <rjmccall@apple.com> Change the AST representation of operations on Objective-C
property references to use a new PseudoObjectExpr
expression which pairs a syntactic form of the expression
with a set of semantic expressions implementing it.
This should significantly reduce the complexity required
elsewhere in the compiler to deal with these kinds of
expressions (e.g. IR generation's special l-value kind,
the static analyzer's Message abstraction), at the lower
cost of specifically dealing with the odd AST structure
of these expressions. It should also greatly simplify
efforts to implement similar language features in the
future, most notably Managed C++'s properties and indexed
properties.

Most of the effort here is in dealing with the various
clients of the AST. I've gone ahead and simplified the
ObjC rewriter's use of properties; other clients, like
IR-gen and the static analyzer, have all the old
complexity *and* all the new complexity, at least
temporarily. Many thanks to Ted for writing and advising
on the necessary changes to the static analyzer.

I've xfailed a small diagnostics regression in the static
analyzer at Ted's request.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143867 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
iveVariables.cpp
16fdb0488caf3960eda2dadc9b2fb87dd160bba9 05-Nov-2011 Ted Kremenek <kremenek@apple.com> Tweak LookThroughStmt() in LiveVariables to properly look through alternativing ParenExprs and OpaqueValueExprs. Thanks to Anna and Argiris for iterating on this function. My original patch embarssingly didn't even pass the Clang tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143797 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
51e6c0d7596325c33919a589a308c3c1ff07baed 05-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> LookThroughStmt GM release.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143796 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
ade89cdd61fc089510f2be8e4a3885a0e45f8957 05-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> LookThroughStmt v4.6.3

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143795 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
ade278dd4f6b47794258856a28a6b173dfae9a1e 05-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Simplify LookThroughStmt in LiveVariables.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143794 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
20a61a5c64e74b1078fece8b22df2920452104ea 05-Nov-2011 Anna Zaks <ganna@apple.com> Another correction to the LiveVariables commit (r143767, r143780).
Make test/Analysis/misc-ps.c test pass.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143790 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
357191743236353d2392075eba0d41647219bb61 05-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix infinite loop in LiveVariables due to a misplaced 'break' (it would break out of
switch statement, not the while loop).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143780 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
972a4c8c62d36a7fc7a840c7cfce709eb8a2fd43 05-Nov-2011 Ted Kremenek <kremenek@apple.com> Teach LiveVariables to look through OpaqueValueExprs for extending Stmt liveness.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143767 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
97078ec57e4a05e36840363a3a2926ac7d3d6003 05-Nov-2011 Ted Kremenek <kremenek@apple.com> Per discussion with John McCall, don't add OpaqueValueExprs to the CFG.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143766 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
d778105d47d92af4bf74f3e3019ca74ab0d78986 29-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it will
implicitly perform an lvalue-to-rvalue conversion if used on an lvalue
expression. Also improve the documentation of Expr::Evaluate* to indicate which
of them will accept expressions with side-effects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143263 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
f17126e938aab826e38c73b4f4edb3f66b320157 27-Oct-2011 Hans Wennborg <hans@hanshq.net> Teach format string analysis that "%zu" means size_t.

The code had it backwards, thinking size_t was signed, and using that for "%zd".

Also let the analysis get the types for (u)intmax_t while we are at it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143099 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
811cba7b857944eccac47efdec43083ee6a0bbaf 25-Oct-2011 Ted Kremenek <kremenek@apple.com> Tweak printf format string parsing to accept 'hh' conversion specifier to accept any char, not just signed char. Fixes <rdar://problem/10303638>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142908 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
7c4629c8bba02762119c873b657329d28abaa4ca 25-Oct-2011 Ted Kremenek <kremenek@apple.com> Add source-level dominators analysis. Patch by Guoping Long!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142885 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ominators.cpp
7c237a88c3de2d53feb448f79b6fa069d4bc933b 24-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Actually rename the file AnalysisContext.cpp -> AnalysisDeclContext.cpp
to match the CMakeLists.txt change in r142782; this should fix the CMake
build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142784 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
nalysisDeclContext.cpp
579ee4f9f5c7b8f939621c8008337a3c1c679957 24-Oct-2011 Ted Kremenek <kremenek@apple.com> Rename AnalysisContext to AnalysisDeclContext. Not only is this name more accurate, but it frees up the name AnalysisContext for other uses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142782 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
MakeLists.txt
iveVariables.cpp
ostOrderCFGView.cpp
eachableCode.cpp
hreadSafety.cpp
ninitializedValues.cpp
3bd5a8169e57debade42d5b748ca564ca9a832ba 23-Oct-2011 Ted Kremenek <kremenek@apple.com> [analyzer] Remove LocationContext creation methods from AnalysisManager, and change clients to use AnalysisContext instead.

WIP to remove/reduce ExprEngine's usage of AnalysisManager.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142739 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
506d525415becf77ed6829fc366ace621f9ea822 22-Oct-2011 Ted Kremenek <kremenek@apple.com> Refactor ThreadSafety to use PostOrderCFGView instead of its own copy (of TopologicallySortedCFG).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142714 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
970c23b653a817359ec0c31568890d6b4700659c 22-Oct-2011 Ted Kremenek <kremenek@apple.com> Pull TopologicallySortedCFG out of LiveVariables into its own analysis: PostOrderCFGView.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142713 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
iveVariables.cpp
ostOrderCFGView.cpp
00111be71adc98a1da54851d5dbcb9edaa63e8f0 21-Oct-2011 DeLesley Hutchins <delesley@google.com> Added support for thread safety attributes on destructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142685 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
57d2b8aefcf58a7bb82de1cdc69358b1893d1219 21-Oct-2011 DeLesley Hutchins <delesley@google.com> Thread safety analysis refactoring: invalid lock expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142666 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
759cb9d856ab91bba7eda321b46bf728b66fe6fa 21-Oct-2011 DeLesley Hutchins <delesley@google.com> Thread safety analysis: add support for attributes on constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142665 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
3141fc076698a738f2b799657ec13ad6b566d0db 21-Oct-2011 DeLesley Hutchins <delesley@google.com> Refactoring and code cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142654 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
f3fb5c5395d382ffd24ec2675237fa9bdff6266e 09-Nov-2011 John McCall <rjmccall@apple.com> We don't add ExprWithCleanups to the CFG, and getSVal looks
through it, so we should look through it for the live-values
analysis as well.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144190 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
4b9c2d235fb9449e249d74f48ecfec601650de93 06-Nov-2011 John McCall <rjmccall@apple.com> Change the AST representation of operations on Objective-C
property references to use a new PseudoObjectExpr
expression which pairs a syntactic form of the expression
with a set of semantic expressions implementing it.
This should significantly reduce the complexity required
elsewhere in the compiler to deal with these kinds of
expressions (e.g. IR generation's special l-value kind,
the static analyzer's Message abstraction), at the lower
cost of specifically dealing with the odd AST structure
of these expressions. It should also greatly simplify
efforts to implement similar language features in the
future, most notably Managed C++'s properties and indexed
properties.

Most of the effort here is in dealing with the various
clients of the AST. I've gone ahead and simplified the
ObjC rewriter's use of properties; other clients, like
IR-gen and the static analyzer, have all the old
complexity *and* all the new complexity, at least
temporarily. Many thanks to Ted for writing and advising
on the necessary changes to the static analyzer.

I've xfailed a small diagnostics regression in the static
analyzer at Ted's request.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143867 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
iveVariables.cpp
6bbecd5e96c2bfe6dcb935a3ca0deb06782a5b14 05-Nov-2011 Ted Kremenek <kremenek@apple.com> Tweak LookThroughStmt() in LiveVariables to properly look through alternativing ParenExprs and OpaqueValueExprs. Thanks to Anna and Argiris for iterating on this function. My original patch embarssingly didn't even pass the Clang tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143797 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
ef911a1bc5ef41c4d43c39294270aeb1dd8d4dac 05-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> LookThroughStmt GM release.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143796 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
51e4e1ee2cd46a623df2c7a3f87e48ebcbf7b546 05-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> LookThroughStmt v4.6.3

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143795 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
74b5edd7a23e493a968dbe3d6a05974dc62892ad 05-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Simplify LookThroughStmt in LiveVariables.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143794 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
38f0b5a611a1776bb5996c56902b64549d093603 05-Nov-2011 Anna Zaks <ganna@apple.com> Another correction to the LiveVariables commit (r143767, r143780).
Make test/Analysis/misc-ps.c test pass.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143790 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
5112fc48495fa705cabe7ec455f9a6e73ec9ecc7 05-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix infinite loop in LiveVariables due to a misplaced 'break' (it would break out of
switch statement, not the while loop).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143780 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
ddaec0dba69f2318d96f949b2f273b2befd1a5c2 05-Nov-2011 Ted Kremenek <kremenek@apple.com> Teach LiveVariables to look through OpaqueValueExprs for extending Stmt liveness.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143767 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
6a9065a39ab15383082b914af28759da1652db18 05-Nov-2011 Ted Kremenek <kremenek@apple.com> Per discussion with John McCall, don't add OpaqueValueExprs to the CFG.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143766 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
51f4708c00110940ca3f337961915f2ca1668375 29-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it will
implicitly perform an lvalue-to-rvalue conversion if used on an lvalue
expression. Also improve the documentation of Expr::Evaluate* to indicate which
of them will accept expressions with side-effects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143263 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
29e97cb35fab314388f62b68fefa78947e93c1dc 27-Oct-2011 Hans Wennborg <hans@hanshq.net> Teach format string analysis that "%zu" means size_t.

The code had it backwards, thinking size_t was signed, and using that for "%zd".

Also let the analysis get the types for (u)intmax_t while we are at it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143099 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
6ca4a9ae99d65948e578d3e7d1f58ab6a947d2d7 25-Oct-2011 Ted Kremenek <kremenek@apple.com> Tweak printf format string parsing to accept 'hh' conversion specifier to accept any char, not just signed char. Fixes <rdar://problem/10303638>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142908 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
58f6f1e37ab32fdd0c8bab6771d8e09bc139e9ed 25-Oct-2011 Ted Kremenek <kremenek@apple.com> Add source-level dominators analysis. Patch by Guoping Long!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142885 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ominators.cpp
8e026045edf1319aed16adfe55524ff9e755c452 24-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Actually rename the file AnalysisContext.cpp -> AnalysisDeclContext.cpp
to match the CMakeLists.txt change in r142782; this should fix the CMake
build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142784 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
nalysisDeclContext.cpp
1d26f48dc2eea1c07431ca1519d7034a21b9bcff 24-Oct-2011 Ted Kremenek <kremenek@apple.com> Rename AnalysisContext to AnalysisDeclContext. Not only is this name more accurate, but it frees up the name AnalysisContext for other uses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142782 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
MakeLists.txt
iveVariables.cpp
ostOrderCFGView.cpp
eachableCode.cpp
hreadSafety.cpp
ninitializedValues.cpp
b1b5daf30d2597e066936772bd206500232d7d65 23-Oct-2011 Ted Kremenek <kremenek@apple.com> [analyzer] Remove LocationContext creation methods from AnalysisManager, and change clients to use AnalysisContext instead.

WIP to remove/reduce ExprEngine's usage of AnalysisManager.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142739 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
439ed1656664b29841f70b6c0b91460534ff4d93 22-Oct-2011 Ted Kremenek <kremenek@apple.com> Refactor ThreadSafety to use PostOrderCFGView instead of its own copy (of TopologicallySortedCFG).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142714 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
edb186399e19d84c93f25440435ab9a695138e79 22-Oct-2011 Ted Kremenek <kremenek@apple.com> Pull TopologicallySortedCFG out of LiveVariables into its own analysis: PostOrderCFGView.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142713 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
iveVariables.cpp
ostOrderCFGView.cpp
fe6bd6dc51777802a0118521b9039981a0e6a806 21-Oct-2011 Logan Chien <loganchien@google.com> Apply changes to migrate to upstream Oct 20th 2011 (r142531)

Change-Id: I32cdb5da2c07c84e01f42b4e87161196f468806a
ndroid.mk
00a92abaf907802bfa4d6f38bdd242c6bfc34c09 21-Oct-2011 Logan Chien <loganchien@google.com> Merge with clang upstream Oct 20th 2011 (r142531)

Change-Id: I42181113f38ce445f2a48694d6f654438562b71e
6db51f707e93816364039a2a904d13d3968c7f05 21-Oct-2011 DeLesley Hutchins <delesley@google.com> Added support for thread safety attributes on destructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142685 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
f1ac63702143d84db778d32eb185a77fc97db5f5 21-Oct-2011 DeLesley Hutchins <delesley@google.com> Thread safety analysis refactoring: invalid lock expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142666 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
e0eaa8531f8fd9189710aac3b6f3aadb62bb14d1 21-Oct-2011 DeLesley Hutchins <delesley@google.com> Thread safety analysis: add support for attributes on constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142665 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
a60448d6dfc91f4c30987e237bf70ef50ac7705b 21-Oct-2011 DeLesley Hutchins <delesley@google.com> Refactoring and code cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142654 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
2dde35bc626153492f5f58202506c88a27fbff5b 19-Oct-2011 John McCall <rjmccall@apple.com> More metaprogramming with builtin types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142433 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
a7da2155167676a6a5d9fca4de947a9cab2a4908 18-Oct-2011 Hans Wennborg <hans@hanshq.net> Suggest %zu for size_t args to printf.

For PR11152. Make PrintSpecifier::fixType() suggest "%zu" for size_t, etc.
rather than looking at the underlying type and suggesting "%llu" or other
platform-specific length modifiers. Applies to C99 and C++11.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142342 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
8121639910129a2b59aa85fc597e47cacad8b978 17-Oct-2011 DeLesley Hutchins <delesley@google.com> Substitute for arguments in method calls -- functionality

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142267 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
9f80a97408ee0da939654d851ff42ad07d47e9c7 17-Oct-2011 DeLesley Hutchins <delesley@google.com> Substitute for arguments in method calls -- refactoring

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142260 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
0ddaeb9b031070ec64afe92d9892875ac44df427 17-Oct-2011 John McCall <rjmccall@apple.com> Add a new placeholder type to represent "unbridged"
casts in ARC.

No semantic analysis yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142208 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
aa4a99b4a62615db243f7a5c433169f2fc704420 15-Oct-2011 Anton Korobeynikov <asl@math.spbu.ru> Provide half floating point support as a storage only type.
Lack of half FP was a regression compared to llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142016 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
85df96c1f04867e26ba069aa0cc6a4cd6a01292e 14-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Refactor static analyzer to use simpler interface to constant expression evaluation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141983 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
9e7617220135a6f6226cf09cb242cc1b905aedb4 13-Oct-2011 Ted Kremenek <kremenek@apple.com> Tweak -Wuninitialized's handling of 'int x = x' to report that as the root cause of an uninitialized variable IFF there are other uses of that uninitialized variable. Fixes <rdar://problem/9259237>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141881 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
a5937bbfd19e61d651a58b0f0ffeef68457902a5 08-Oct-2011 Ted Kremenek <kremenek@apple.com> Remove AnalysisContext::getLiveVariables(), and introduce a templatized mechanism to lazily create analyses that are attached to AnalysisContext objects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141425 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
iveVariables.cpp
63d3201619fdac284adfd3b9328562fa20a01c40 07-Oct-2011 Anna Zaks <ganna@apple.com> ProgramPoint cleanup after the previous commit r141408 (remove the copy constructor, mark withTag const).

Move getProgramPoint() utility from CoreEngine.cpp into ProgramPoint.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141414 91177308-0d34-0410-b5e6-96231b3b80d8
rogramPoint.cpp
c5f740ecdbc21d5ba08f97b89cc05c9d4f230fda 07-Oct-2011 Ted Kremenek <kremenek@apple.com> Fix infinite loop in -Wuninitialized reported in PR 11069.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141345 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
c80850353f4051f36be9f5be9738cf877406311a 06-Oct-2011 Ted Kremenek <kremenek@apple.com> [static analyzer] Fix crash in LiveVariables and Environment::getSVal() when analyzing C++ pointer-to-member calls. Fixes <rdar://problem/10243398>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141312 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
3c2b5f7d6102bd1878c4ce7fcdd8f67ec9c37064 02-Oct-2011 Ted Kremenek <kremenek@apple.com> Fix another major performance regression in LiveVariables by not canonicalizing the underlying ImmutableSets on every analyzed statement (just at merges). Fixes <rdar://problem/10087538>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140958 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
6a835dddf45922e71a87637fdfac0863de65123c 02-Oct-2011 Ted Kremenek <kremenek@apple.com> Fix LiveVariables analysis bug with MaterializeTemporaryExpr and fix handling in ExprEngine. Fixes <rdar://problem/10201666>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140956 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
7df2ff45f101c87398329d0ea23c1377328dca40 01-Oct-2011 John McCall <rjmccall@apple.com> Tweak the interface for analyzing the CF conventions for a name
to take a FunctionDecl* instead of an llvm::StringRef. Eventually
we might push more logic in there, like using slightly different
conventions for C++ methods.

Also, fix a bug where 'copy' and 'create' were being caught in
non-camel-cased strings. We want copyFoo and CopyFoo and XCopy
but not Xcopy or xcopy.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140911 91177308-0d34-0410-b5e6-96231b3b80d8
ocoaConventions.cpp
eb2d1f1c88836bd5382e5d7aa8f6b85148a88b27 23-Sep-2011 David Blaikie <dblaikie@gmail.com> Removing a bunch of dead returns/breaks after llvm_unreachables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140407 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
b219cfc4d75f0a03630b7c4509ef791b7e97b2c8 23-Sep-2011 David Blaikie <dblaikie@gmail.com> Switch assert(0/false) llvm_unreachable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140367 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ormatString.cpp
rintfFormatString.cpp
9859ea07b55727557a201e730caf01bcd6a7566a 20-Sep-2011 DeLesley Hutchins <delesley@google.com> Test commit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140149 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
a2d7e6511a8767dc67381c210601b895a8ebae39 20-Sep-2011 Anna Zaks <ganna@apple.com> [analyzer] Constify a method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140091 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
87aa1250a90af9d92ad9d6b7b65610a45bf478c1 17-Sep-2011 Ted Kremenek <kremenek@apple.com> Fix massive LiveVariables regression (due to LiveVariables rewrite) by addressing two performance problems:

- Speed of "merge()", which merged data flow facts. This was doing a set canonicalization on every insertion, which was super slow.
To fix this, we use ImmutableSetRef.

- Visit CFGBlocks in reverse postorder. This is a huge speedup, as on some test cases the algorithm would take many iterations
to converge.

This contains a bunch of copy-paste from UninitializedValues.cpp and ThreadSafety.cpp. The idea
was to get something working first, and then refactor the common logic for all three files into
a separate analysis/library entry point.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139968 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
1748b1256646cf0752f172c53ad7482f7beed185 16-Sep-2011 Caitlin Sadowski <supertri@google.com> Thread safety: Adding FIXMEs and a couple cleanups

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139894 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
cb96751b25a934b22402c1e4e0805db7608a5f2b 15-Sep-2011 Caitlin Sadowski <supertri@google.com> Thread safety: completeing the implementation of shared/exclusive locks required attributes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139804 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
4e4bc75d3570835e13183c66ac08974cdc016007 15-Sep-2011 Caitlin Sadowski <supertri@google.com> Thread safety: refactoring various out of scope warnings to use the same inteface. This eliminates a lot of unnecessary duplicated code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139801 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
19903465e960329c0d5d93327f4046d036b0bc75 14-Sep-2011 Caitlin Sadowski <supertri@google.com> Thread safety: adding additional documentation to the main thread safety interface, and making the destructor for the thread safety handler pure virtual

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139722 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
194418f1db5f5f78bc3e614d1e10a863455d882c 14-Sep-2011 Caitlin Sadowski <supertri@google.com> Thread safety: adding test cases for unparseable lock expressions and expanding the handling of these expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139720 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
83754162f698a5dafad93fb89be0953651a604d0 13-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Add a bit to the CFGBlock to track when it contains a no-return
CFGElement. This will allow greatly simplifying the logic in
-Wreturn-type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139593 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
dba3fb5413437dc613734fa4ffac892b11a37d25 13-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Consolidate the logic for building a no-return CFG block into a single
location with a single comment rather than scattering it in three
places.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139592 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
c8cfc74bdcc999828bc232294d937fb191940d5b 13-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Enhance the CFG construction to detect no-return destructors for
temporary objects and local variables. When detected, these split the
block, marking the new one as having only the exit block as a successor.
This prevents a large number of false positives in warnings sensitive to
no-return constructs such as -Wreturn-type, and fixes the remainder of
PR10063 along with several variations of this bug that had not been
reported. The test cases are extended across the board to cover these
patterns.

This also checks in a stress test for these types of CFGs. The stress
test declares some 32k variables, a mixture of no-return and normal
destructors. Previously, this resulted in roughly 2500 CFG blocks, but
didn't model any of the no-return destructors. With this patch, it
results in over 33k blocks, many of them now unreachable.

The nice thing about how the analyzer is set up? This causes *no*
regression in performance of building the CFG. It actually in some cases
makes it faster, as best I can benchmark. The analysis for -Wreturn-type
(and any other that cares about no-return code paths) is technically
slower now as it has to look at many more candidate blocks, but it
computes the correct answer. I have more test cases to follow, I think
they all work now. Also I have further work that should dramatically
simplify analyses in the presence of no-return.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139586 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
7613c73af842a7f989968161409f53a692dc5b30 13-Sep-2011 Caitlin Sadowski <supertri@google.com> Thread safety: small formatting change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139548 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
afc5b15022886c9e9e84d7aa0f2168b83e712310 10-Sep-2011 Benjamin Kramer <benny.kra@googlemail.com> Silence "end of non-void function" warnings with llvm_unreachable and add an assert.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139474 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
a1364be341550d71dff27dd8de0c6872ba6c707e 10-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Extend the Stmt AST to make it easier to look through label, default,
and case statements. Use this to make the logic in the CFG builder more
robust at finding the actual statements within a compound statement,
even when there are many layers of labels obscuring it.

Also extend the test cases for a large chunk of PR10063. Still more work
to do here though.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139437 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
d5b16055782034ca90153880c36bd88b59c63aa0 10-Sep-2011 Caitlin Sadowski <supertri@google.com> Thread safety: removing unnecessary import and reordering import list

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139426 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
0fed26d94553881011aa7ec30cee3ed0da71c7a1 10-Sep-2011 Caitlin Sadowski <supertri@google.com> Thread safety: removing unnecessary import

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139425 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
99107ebc0a5aea953b736e12757e0919d5249d43 09-Sep-2011 Caitlin Sadowski <supertri@google.com> Thread safety: This patch deals with previously unhandled cases when building lock expressions. We now resolve this expressions, avoid crashing when encountering cast expressions, and have a diagnostic for unresolved lock expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139370 91177308-0d34-0410-b5e6-96231b3b80d8
hreadSafety.cpp
402aa0698fec81e574818a0a6c2000fac0b2c4c6 09-Sep-2011 Caitlin Sadowski <supertri@google.com> Thread Safety: Moving the analysis to a new file

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139369 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
hreadSafety.cpp
6f27542da8843b5c1c579b86e342385bcc43d5f0 02-Sep-2011 Ted Kremenek <kremenek@apple.com> -Wuninitialized: fix insidious bug resulting from interplay of blocks and dead code. Fixes <rdar://problem/10060250>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139027 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
80cb6e69d9e85231588ae604e4bc2bc9a07389af 29-Aug-2011 Nico Weber <nicolasweber@gmx.de> Warn on missing [super finalize] calls.

This matches gcc's logic. Second half of PR10661.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138730 91177308-0d34-0410-b5e6-96231b3b80d8
ocoaConventions.cpp
e7a2764b2c98859aa42a3fd36d55cd34c7fe883e 25-Aug-2011 Ted Kremenek <kremenek@apple.com> Teach -Wunreachable-code about dead code caused by macro expansions. This should suppress false positives resulting from 'assert' and friends.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138576 91177308-0d34-0410-b5e6-96231b3b80d8
eachableCode.cpp
0f3b4ca1764cd6d457f511d340fba504f41763c3 24-Aug-2011 Ted Kremenek <kremenek@apple.com> Start reworking -Wunreachable-code. The original analysis had serious flaws with how it
handled SCC's of dead code, or simply having false negatives by overly suppressing warnings.

WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138410 91177308-0d34-0410-b5e6-96231b3b80d8
eachableCode.cpp
f0e71aede7ccf3e311feac6a414c431f7a0fc3c8 24-Aug-2011 Ted Kremenek <kremenek@apple.com> CFG: record set of C++ 'try' dispatch blocks, which could be of interest to various analyses (e.g., reachability).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138409 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
f1d10d939739f1a4544926d807e4f0f9fb64be61 24-Aug-2011 Ted Kremenek <kremenek@apple.com> Constify the result of CFGStmt::getStmt().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138408 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
FGStmtMap.cpp
iveVariables.cpp
ninitializedValues.cpp
540dda6f2e4982b3eab0300c804345f5b6104c11 23-Aug-2011 Ted Kremenek <kremenek@apple.com> Fix regression in -Wuninitialized involving VLAs. It turns out that we were modeling sizeof(VLAs)
incorrectly in the CFG, and also the static analyzer. This patch regresses the analyzer a bit, but
that needs to be followed up with a better solution.

Fixes <rdar://problem/10008112>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138372 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
e0e29332c89da22b6890929b97e6f568c917d85f 20-Aug-2011 Ted Kremenek <kremenek@apple.com> Remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138183 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
3060178ad9df29789505c1e6debcfc80a3a13587 18-Aug-2011 Chad Rosier <mcrosier@apple.com> Fix else style. No functionality change intended.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137896 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ocoaConventions.cpp
rintfFormatString.cpp
ninitializedValues.cpp
012614ecf78442368ec82ee30efb3bc047b413e6 17-Aug-2011 Ted Kremenek <kremenek@apple.com> Fix a handful of dead stores found by Clang's static analyzer. There's a bunch of others I haven't touched.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137867 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
9c378f705405d37f49795d5e915989de774fe11f 13-Aug-2011 Ted Kremenek <kremenek@apple.com> Cleanup various declarations of 'Stmt*' to be 'Stmt *', etc. in libAnalyzer and libStaticAnalyzer[*]. It was highly inconsistent, and very ugly to look at.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137537 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
FG.cpp
iveVariables.cpp
seudoConstantAnalysis.cpp
ninitializedValues.cpp
ca804539d908d3a0e8c72a0df5f1f571d29490bb 13-Aug-2011 Ted Kremenek <kremenek@apple.com> [analyzer] change "tag" in ProgramPoint from "void*" to a ProgramPointTag*.

Having a notion of an actual ProgramPointTag will aid in introspection of the analyzer's behavior.
For example, the GraphViz output of the analyzer will pretty-print the tags in a useful manner.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137529 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
rogramPoint.cpp
5290c80eba2c96aee32912adf77bea6eddb92026 12-Aug-2011 Ted Kremenek <kremenek@apple.com> Revert "Fix crash in CFGBuilder involving implicit destructor calls and gotos jumping after an object was declared. Fixes PR 10620."

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137459 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
a809447c5ce90f0efe7d6b7447d4cb6812bf3429 12-Aug-2011 Ted Kremenek <kremenek@apple.com> Fix crash in CFGBuilder involving implicit destructor calls and gotos jumping after an object was declared. Fixes PR 10620.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137426 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
de091aeb4658e986ed8fa5fbce7ab35ef2ae26ec 08-Aug-2011 Ted Kremenek <kremenek@apple.com> Fix another -Wuninitialized assertion failure (this one involving bit casts) resulting from the recent -Wuninitialized changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137068 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
f91a5b008d1a63630ae483247204c2651e512fa1 06-Aug-2011 Ted Kremenek <kremenek@apple.com> [analyzer] Simplify logic for ExprEngine::VisitUnaryExprOrTypeTraitExpr to avoid recursion to subexpression.

This exposed bugs in the live variables analysis, and a latent analyzer bug in the SymbolReaper.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137006 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
iveVariables.cpp
57fb591a54eab7db65d73e77c632f047bca22c54 05-Aug-2011 Ted Kremenek <kremenek@apple.com> Fix assertion failure in -Wuninitialized involving no-op casts. Fixes PR 10577.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136939 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
39997fc2b8d300a85ead0a7d687964c6e63a8110 02-Aug-2011 Benjamin Kramer <benny.kra@googlemail.com> Make helper functions static.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136679 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
882998923889a2fcce9b49696506c499e22cf38f 29-Jul-2011 Ted Kremenek <kremenek@apple.com> [analyzer] Overhaul how the static analyzer expects CFGs by forcing CFGs to be linearized only when used by the static analyzer. This required a rewrite of LiveVariables, and exposed a ton of subtle bugs.

The motivation of this large change is to drastically simplify the logic in ExprEngine going forward.

Some fallout is that the output of some BugReporterVisitors is not as accurate as before; those will
need to be fixed over time. There is also some possible performance regression as RemoveDeadBindings
will be called frequently; this can also be improved over time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136419 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
iveVariables.cpp
5f9e272e632e951b1efe824cd16acb4d96077930 23-Jul-2011 Chris Lattner <sabre@nondot.org> remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
FGReachabilityAnalysis.cpp
ocoaConventions.cpp
ormatString.cpp
iveVariables.cpp
rintfFormatString.cpp
eachableCode.cpp
ninitializedValues.cpp
d837c0dc361a000b951593eaaa80c46b73d15b1d 22-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Move duplicate uninitialized warning suppression into the
AnalysisBasedWarnings Sema layer and out of the Analysis library itself.
This returns the uninitialized values analysis to a more pure form,
allowing its original logic to correctly detect some categories of
definitely uninitialized values. Fixes PR10358 (again).

Thanks to Ted for reviewing and updating this patch after his rewrite of
several portions of this analysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135748 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
bc5cb8a5fe2b88f917d47ceb58b53696a121e57e 21-Jul-2011 Ted Kremenek <kremenek@apple.com> Simplify passing of CFGBuildOptions around for AnalysisContext. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135666 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
dd4286b5b7b02b8bb962e4b996b8f36cb7935d4f 20-Jul-2011 Ted Kremenek <kremenek@apple.com> Fix -Wuninitialized regression involving functions invalidating parameters passed by reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135610 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
9d102547dc44d064b40473a5a5166a8bb0dec99a 20-Jul-2011 Logan Chien <loganchien@google.com> Merge with clang upstream r135574 (Jul 20th 2011)

Change-Id: Ib6cc2ba08a63e4cf8febc05fb6e3f2ca58f1d71d
62d126e942f9f420c6f398d32deb914d413226a3 19-Jul-2011 Ted Kremenek <kremenek@apple.com> Fix false negative in -Wuninitialized involving a () wrapping an lvalue-to-rvalue conversion in a DeclStmt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135525 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
d626ec404fd0f27244363200f1a85a7db219cd11 19-Jul-2011 Ted Kremenek <kremenek@apple.com> Fix assertion failure in UninitializedValues.cpp where an lvalue to rvalue conversion is wrapped in a parenthesis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135519 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
0c8e5a0f70cbdb800d939c1807d05f380b2854d4 19-Jul-2011 Ted Kremenek <kremenek@apple.com> Reduce -Wuninitialized time by 22% (on sqlite) by removing the recursive AST crawl.

This is accomplished by forcing the needed expressions for -Wuninitialized to always be CFGElements in the CFG.
This allows us to remove a fair amount of the code for -Wuninitialized.

Some fallout:
- AnalysisBasedWarnings.cpp now specifically toggles the CFGBuilder to create a CFG that is suitable for -Wuninitialized. This
is a layering violation, since the logic for -Wuninitialized is in libAnalysis. This can be fixed with the proper refactoring.
- Some of the source locations for -Wunreachable-code warnings have shifted. While not ideal, this is okay because that analysis
already needs some serious reworking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135480 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
74fb1a493cf5d2dd0fb51a4eadf74e85e10a3457 19-Jul-2011 Ted Kremenek <kremenek@apple.com> Add hooks into the CFG builder to force that specific expressions are always CFGElements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135479 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
99d3594a56fb8e6900611ede7330aae61e924ec4 17-Jul-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r135359 at Sun. 17th July 2011.
8435069798b5621615f9f65c471c7e7808316b20 17-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Revert r135217, which wasn't the correct fix for PR10358. With this
patch, we actually move the state-machine for the value set backwards
one step. This can pretty easily lead to infinite loops where we
continually try to propagate a bit, succeed for one iteration, but then
back up because we find an uninitialized use.

A reduced test case from PR10379 is included.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135359 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
797a7be0de6fbedaa85082b07ec9ce0674f30773 16-Jul-2011 Ted Kremenek <kremenek@apple.com> [analyzer] Per discussions with the Cocoa team, extend CF naming conventions to extend to camel case functions instead of just title case functions. Fixes <rdar://problem/9732321>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135350 91177308-0d34-0410-b5e6-96231b3b80d8
ocoaConventions.cpp
0556048ae8ff743d0abb9fa88a0d0ee8e9123742 16-Jul-2011 Ted Kremenek <kremenek@apple.com> [analyzer] Place checking for Core Foundation "Create" rule into a proper API. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135349 91177308-0d34-0410-b5e6-96231b3b80d8
ocoaConventions.cpp
174cba922331b896949d02d8b1a05f1998ed98e1 16-Jul-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r135344 at Sat. 16th July 2011.
05bcade0182524731cf4bc4984e08f63ddf62374 15-Jul-2011 Ted Kremenek <kremenek@apple.com> Fix false negative reported in PR 10358 by using 'Unknown' in -Wuninitialized to avoid cascading warnings. Patch by Kaelyn Uhrain.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135217 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
1ad35bebcc07d34202850f46b5b7be46fda1c5d1 14-Jul-2011 Ted Kremenek <kremenek@apple.com> Revert r135147 and r135075. The consensus was that this wasn't the right thing to do.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135152 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
9dbe16eb808ed3b58be6be48bf4ae7317db63e89 14-Jul-2011 Ted Kremenek <kremenek@apple.com> Add extra sanity checking in FormatString::matchesType() that we are comparing integers to integers. This happens not to be an issue now, but the extra check helps future proof in case of future refactorings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135147 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
826d5b4782d5c4c38c30eaae70a243c33a76edad 14-Jul-2011 Ted Kremenek <kremenek@apple.com> Reapply r135075, but modify format-strings.c and format-strings-fixit.c test cases to be more portable with an explicit target triple.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135134 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
13d99bf2e9e13820d74ecc6a28630721736c1f10 14-Jul-2011 NAKAMURA Takumi <geek4civic@gmail.com> Revert r135075, "format string checking: long and int have the same widths on 32-bit, so we shouldn't warn about using"

It fails on freebsd, mingw and msvc10.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135129 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
8da9316c5a97887da0bf84a2ea45daf43ddf572b 13-Jul-2011 Ted Kremenek <kremenek@apple.com> format string checking: long and int have the same widths on 32-bit, so we shouldn't warn about using
an "int" format specifier with a "long" type in 32-bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135075 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
dc00d8158db573f4a1f91cfaa2a89171c2e5f637 13-Jul-2011 Ted Kremenek <kremenek@apple.com> Re-relax conversion specifier checking for printf format strings and conversion specifiers. My recent change was a mistake.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135048 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
45eb7022ff059ff5a291e24f57ff56428a1e8210 13-Jul-2011 Ted Kremenek <kremenek@apple.com> Fix inversion in argument type checking for format strings with conversion specifiers for character types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135046 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
8052050c8ebfcfbbce8afed57fefc8c95fb9a333 08-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Make the worklist in the uninitialized values checker actually a queue.
Previously, despite the names 'enqueue' and 'dequeue', it behaved as
a stack and visited blocks in a LIFO fashion. This interacts badly with
extremely broad CFGs *inside* of a loop (such as a large switch inside
a state machine) where every block updates a different variable.

When encountering such a CFG, the checker visited blocks in essentially
a "depth first" order due to the stack-like behavior of the work list.
Combined with each block updating a different variable, the saturation
logic of the checker caused it to re-traverse blocks [1,N-1] of the
broad CFG inside the loop after traversing block N. These re-traversals
were to propagate the variable values derived from block N. Assuming
approximately the same number of variables as inner blocks exist, the
end result is O(N^2) updates. By making this a queue, we also make the
traversal essentially "breadth-first" across each of the N inner blocks
of the loop. Then all of this state is propagated around to all N inner
blocks of the loop. The result is O(N) updates.

The truth is in the numbers:
Before, gcc.c: 96409 block visits (max: 61546, avg: 591)
After, gcc.c: 69958 block visits (max: 33090, avg: 429)
Before, PR10183: 2540494 block vists (max: 2536495, avg: 37360)
After, PR10183: 137803 block visits (max: 134406, avg: 2026)

The nearly 20x reduction in work for PR10183 corresponds to a roughly
100x speedup in compile time.

I've tested it on all the code I can get my hands on, and I've seen no
slowdowns due to this change. Where I've collected stats, the ammount of
work done is on average less. I'll also commit shortly some synthetic
test cases useful in analyzing the performance of CFG-based warnings.

Submitting this based on Doug's feedback that post-commit review should
be good. Ted, please review! Hopefully this helps compile times until
then.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134697 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
5d98994c7749312a43ce6adf45537979a98e7afd 06-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Build up statistics about the work done for analysis based warnings.
Special detail is added for uninitialized variable analysis as this has
serious performance problems than need to be tracked.

Computing some of this data is expensive, for example walking the CFG to
determine its size. To avoid doing that unless the stats data is going
to be used, we thread a bit into the Sema object to track whether
detailed stats should be collected or not. This bit is used to avoid
computations whereever the computations are likely to be more expensive
than checking the state of the flag. Thus, counters are in some cases
unconditionally updated, but the more expensive (and less frequent)
aggregation steps are skipped.

With this patch, we're able to see that for 'gcc.c':
*** Analysis Based Warnings Stats:
232 functions analyzed (0 w/o CFGs).
7151 CFG blocks built.
30 average CFG blocks per function.
1167 max CFG blocks per function.
163 functions analyzed for uninitialiazed variables
640 variables analyzed.
3 average variables per function.
94 max variables per function.
96409 block visits.
591 average block visits per function.
61546 max block visits per function.

And for the reduced testcase in PR10183:
*** Analysis Based Warnings Stats:
98 functions analyzed (0 w/o CFGs).
8526 CFG blocks built.
87 average CFG blocks per function.
7277 max CFG blocks per function.
68 functions analyzed for uninitialiazed variables
1359 variables analyzed.
19 average variables per function.
1196 max variables per function.
2540494 block visits.
37360 average block visits per function.
2536495 max block visits per function.

That last number is the somewhat scary one that indicates the problem in
PR10183.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134494 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
786dcd9dca76e3780fdb9642c0db33ed13db1187 06-Jul-2011 Douglas Gregor <dgregor@apple.com> Teach the static analyzer's interpretation of Cocoa conventions to
obey the objc_method_family attribute when provided. Fixes
<rdar://problem/9726279>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134493 91177308-0d34-0410-b5e6-96231b3b80d8
ocoaConventions.cpp
170579ffc614510815c2fd34112da2970a7e9336 06-Jul-2011 Fariborz Jahanian <fjahanian@apple.com> Added a missing case label.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134454 91177308-0d34-0410-b5e6-96231b3b80d8
ocoaConventions.cpp
3c54415a4e1db09b210a466469c72d2582ce1d83 02-Jul-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r134305 at Sat. 2nd July 2011.
d6a4d18f52a775ec9012f5eaec9e5190b0499823 29-Jun-2011 Daniel Dunbar <daniel@zuster.org> Revert r133024, "[format strings] correctly suggest correct type for '%@'
specifiers. Fixes <rdar://problem/9607158>." because it causes false positives
on some code that uses CF toll free bridging.
- I'll let Doug or Ted figure out the right fix here, possibly just to accept
any pointer type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134041 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
7062281f240ef9c4fb343614fb2406532307c4a5 23-Jun-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r133678 at Thu. 23th Jun 2011.
03e80030515c800d1ab44125b9052dfffd1bd04c 21-Jun-2011 Douglas Gregor <dgregor@apple.com> Introduce a new AST node describing reference binding to temporaries.

MaterializeTemporaryExpr captures a reference binding to a temporary
value, making explicit that the temporary value (a prvalue) needs to
be materialized into memory so that its address can be used. The
intended AST invariant here is that a reference will always bind to a
glvalue, and MaterializeTemporaryExpr will be used to convert prvalues
into glvalues for that binding to happen. For example, given

const int& r = 1.0;

The initializer of "r" will be a MaterializeTemporaryExpr whose
subexpression is an implicit conversion from the double literal "1.0"
to an integer value.

IR generation benefits most from this new node, since it was
previously guessing (badly) when to materialize temporaries for the
purposes of reference binding. There are likely more refactoring and
cleanups we could perform there, but the introduction of
MaterializeTemporaryExpr fixes PR9565, a case where IR generation
would effectively bind a const reference directly to a bitfield in a
struct. Addresses <rdar://problem/9552231>.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133521 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
6970155edde8c79cf22824322470485434b8eb83 17-Jun-2011 Francois Pichet <pichet2000@gmail.com> Finish 2 sentences.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133214 91177308-0d34-0410-b5e6-96231b3b80d8
ocoaConventions.cpp
16c8f9d68ae6d302083763d4733e728634717dec 16-Jun-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r133163 at Fri. 17th Jun 2011.
f85e193739c953358c865005855253af4f68a497 16-Jun-2011 John McCall <rjmccall@apple.com> Automatic Reference Counting.

Language-design credit goes to a lot of people, but I particularly want
to single out Blaine Garst and Patrick Beard for their contributions.

Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself,
in no particular order.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133103 91177308-0d34-0410-b5e6-96231b3b80d8
eachableCode.cpp
84862f6a0bdaad6f0648e10dfab6058cfa512864 15-Jun-2011 Ted Kremenek <kremenek@apple.com> [format strings] correctly suggest correct type for '%@' specifiers. Fixes <rdar://problem/9607158>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133024 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
926df6cfabf3eaa4afc990c097fa4619b76a9b57 11-Jun-2011 Douglas Gregor <dgregor@apple.com> Implement Objective-C Related Result Type semantics.

Related result types apply Cocoa conventions to the type of message
sends and property accesses to Objective-C methods that are known to
always return objects whose type is the same as the type of the
receiving class (or a subclass thereof), such as +alloc and
-init. This tightens up static type safety for Objective-C, so that we
now diagnose mistakes like this:

t.m:4:10: warning: incompatible pointer types initializing 'NSSet *'
with an
expression of type 'NSArray *' [-Wincompatible-pointer-types]
NSSet *array = [[NSArray alloc] init];
^ ~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1:
note:
instance method 'init' is assumed to return an instance of its
receiver
type ('NSArray *')
- (id)init;
^

It also means that we get decent type inference when writing code in
Objective-C++0x:

auto array = [[NSMutableArray alloc] initWithObjects:@"one", @"two",nil];
// ^ now infers NSMutableArray* rather than id




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132868 91177308-0d34-0410-b5e6-96231b3b80d8
ocoaConventions.cpp
e5df885367b9e122ac11c89ddfbc62375695cdab 10-Jun-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r132843 at Fri. 10th Jun 2011.
ac73ea8c12772fd0dcec71b83c193a2837de7f8b 10-Jun-2011 Jordy Rose <jediknil@belkadan.com> [analyzer] PR8962 again. Ban ParenExprs (and friends) from block-level expressions (by calling IgnoreParens before adding expressions to blocks). Undo 132769 (LiveVariables' local IgnoreParens), since it's no longer necessary.

Also, have Environment stop looking through NoOp casts; it didn't match the behavior of LiveVariables. And once that's gone, the whole cast block of that switch is unnecessary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132840 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
FG.cpp
iveVariables.cpp
7fead31dbee1a1349d360eff7b56dc6571449443 09-Jun-2011 Jordy Rose <jediknil@belkadan.com> [analyzer] Ignore parentheses around block-level expressions when computing liveness. Fixes the other half of PR8962.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132769 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
c7f532f9b8e934a0a284d15a739333372e979f61 03-Jun-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r132540 at Fri. 3rd Jun 2011.
049f6d0239e242dc338be6ac6f6c5175803d2163 31-May-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Utilize PackedVector, introduced with llvm commit r132325.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132326 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
43c9791207a2bd7cef8b17e9bfc4dd87db21690f 28-May-2011 Nowar Gu <nowar100@gmail.com> Merge upstream r132249 at Sat. 28th. May 2011.
29c9e62f412c9db3ee238db2472390685a6303f3 24-May-2011 Ted Kremenek <kremenek@apple.com> Add explicit CFG support for ignoring static_asserts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132001 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
d01d2b2de449d68e6c44d99a12c0c1fc53222113 14-May-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r131335 at Sat. 14th May 2011.
8cad3046be06ea73ff8892d947697a21d7a440d3 13-May-2011 Peter Collingbourne <peter@pcc.me.uk> Refactoring of constant expression evaluator

This introduces a generic base class for the expression evaluator
classes, which handles a few common expression types which were
previously handled separately in each class. Also, the expression
evaluator now uses ConstStmtVisitor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131281 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
1de85338543dd6228eb518185e385d94d377f4cb 11-May-2011 John McCall <rjmccall@apple.com> Teach CFG building how to deal with CXXMemberCallExprs and BoundMemberTy,
then teach -Wreturn-type to handle the same. Net effect: we now correctly
handle noreturn attributes on member calls in the CFG.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131178 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
e6c28039c63d829577a2e37170e06a1dbdf89748 11-May-2011 Ted Kremenek <kremenek@apple.com> Fix crash in -Wuninitialized when using switch statments whose condition is a logical operation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131158 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
bc869de349227707a07ccc783344d255cf37ec16 10-May-2011 Ted Kremenek <kremenek@apple.com> Elide __label__ declarations from the CFG. This resolves a crash in CFGRecStmtDeclVisitor (crash in static analyzer).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131141 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
75c4064932d481ac710a80aa88b3370ad8a6af1d 28-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Silence more -Wnon-pod-memset given its current implementation. I may be
able to revert these based on a patch I'm working on, but no reason for
people to be spammed with warnings in the interim.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130394 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
26517e4ffe7c2c366496feb02370ba24ab5ae8f5 28-Apr-2011 Ted Kremenek <kremenek@apple.com> Remove unused method CFGBlock::hasBinaryBranchTerminator().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130336 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
06d88ec4204be7af2cf935f39a3e3391d281ad52 28-Apr-2011 Eli Friedman <eli.friedman@gmail.com> Don't print fixits for format specifiers in cases where the fixit does not actually fix the warning. PR8781.

I'm not sure what the preferred way to write a test for whether a fixit is emitted.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130335 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
1e713f50e904b96623425efa7119fcb98243e111 26-Apr-2011 Ted Kremenek <kremenek@apple.com> When generating printf fixits, preserve the original formating for unsigned integers (e.g., 'x', 'o').

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130164 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
b403d6d746239095a2c7bac958c924d92434e2b4 18-Apr-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix PR9741. The implicit declarations created for range-based for loops weren't being added to the DeclContext (nor were they being marked as implicit). Also, the declarations were being emitted in the wrong order when building the CFG.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129700 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
fc8f0e14ad142ed811e90fbd9a30e419e301c717 15-Apr-2011 Chris Lattner <sabre@nondot.org> fix a bunch of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129559 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
efdf988611c1eb02770643cd3fabd5df2f579353 15-Apr-2011 Douglas Gregor <dgregor@apple.com> When we transform a C++ exception declaration (e.g., for template
instantiation), be sure to add the transformed declaration into the
current DeclContext. Also, remove the -Wuninitialized hack that works
around this bug. Fixes <rdar://problem/9200676>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129544 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
ad762fcdc16b9e4705b12b09d92b8c026212b906 15-Apr-2011 Richard Smith <richard-llvm@metafoo.co.uk> Add support for C++0x's range-based for loops, as specified by the C++11 draft standard (N3291).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129541 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
97e50714c262cc421f960303171d2c1afbc9bb4f 14-Apr-2011 Ted Kremenek <kremenek@apple.com> Return the correct lastly populated block from CFGBuilder::VisitUnaryExprOrTypeTraitExpr().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129499 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
866849498461cf9022316034516475188b25955b 13-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Teach -Wuninitialized about C++'s typeid expression, including both the
evaluated and unevaluated contexts. Add some testing of sizeof and
typeid.

Both of the typeid tests added here were triggering warnings previously.
Now the one false positive is suppressed without suppressing the warning
on actually buggy code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129431 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
2eba7abeab4abddd28644200397f8a1d5badccdd 09-Apr-2011 Logan Chien <tzuhsiang.chien@gmail.com> Merge with clang upstream r129173 (Apr 8th 2011)

Upstream Revision
git-id: 0ff32595e4b92c5bdee78946b39f9e990b20cc90
svn-id: 129173
a21612f95792c1ea8b4362f0861f0c724c39388e 07-Apr-2011 Ted Kremenek <kremenek@apple.com> Teach -Wuninitialized to not warn about variables declared in C++ catch statements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129102 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
9a7319305fc25222b91d585dfa056c8cdbac8434 06-Apr-2011 Nowar Gu <nowar100@gmail.com> Merge upstream until 2011.04.05.
b88fb027bfe2f85da3a341f42549900bd658ac8b 05-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Commit a bit of a hack to fully handle the situation where variables are
marked explicitly as uninitialized through direct self initialization:

int x = x;

With r128894 we prevented warnings about this code, and this patch
teaches the analysis engine to continue analyzing subsequent uses of
'x'. This should wrap up PR9624.

There is still an open question of whether we should suppress the
maybe-uninitialized warnings resulting from variables initialized in
this fashion. The definitely-uninitialized uses should always be warned.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128932 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
d40066b0fb883839a9100e5455e33190b9b8abac 05-Apr-2011 Ted Kremenek <kremenek@apple.com> Fix PR 9626 (duplicated self-init warnings under -Wuninitialized) with numerous CFG and UninitializedValues analysis changes:

1) Change the CFG to include the DeclStmt for conditional variables, instead of using the condition itself as a faux DeclStmt.
2) Update ExprEngine (the static analyzer) to understand (1), so not to regress.
3) Update UninitializedValues.cpp to initialize all tracked variables to Uninitialized at the start of the function/method.
4) Only use the SelfReferenceChecker (SemaDecl.cpp) on global variables, leaving the dataflow analysis to handle other cases.

The combination of (1) and (3) allows the dataflow-based -Wuninitialized to find self-init problems when the initializer
contained control-flow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128858 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ninitializedValues.cpp
f8adeefa9e9882bff402e092024dd457f8574673 04-Apr-2011 Ted Kremenek <kremenek@apple.com> -Wuninitialized: don't warn about uninitialized variables in unreachable code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128840 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ninitializedValues.cpp
2166948cc721b138b3aaf4358d28ec2dada22901 02-Apr-2011 Nico Weber <nicolasweber@gmx.de> Make -Wheader-hygiene not complain about USING_NAMESPACE_THROUGH_MACRO in a non-header file.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128780 91177308-0d34-0410-b5e6-96231b3b80d8
eachableCode.cpp
f445debe3a6825e6528655db0906ce4fa41240ea 01-Apr-2011 csmon <csmon@csmon-desktop.(none)> Merge branch 'upstream' into logan-fastforward-20110320
bc8b44c4ee7f9c4c3ad296369e72feda61bdb580 01-Apr-2011 Ted Kremenek <kremenek@apple.com> -Wuninitialized should not warn about variables captured by blocks as byref.

Note this can potentially be enhanced to detect if the __block variable
is actually written by the block, or only when the block "escapes" or
is actually used, but that requires more analysis than it is probably worth
for this simple check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128681 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
b831c673621c5587642343cace9def134916a17b 29-Mar-2011 Ted Kremenek <kremenek@apple.com> Add workaround for Sema issue found in <rdar://problem/9188004>, which leads to an assertion failure in the uninitialized variables analysis. The problem is that Sema isn't properly registering a variable in a DeclContext (which -Wuninitialized relies on), but
my expertise on the template instantiation logic isn't good enough to fix this problem for real. This patch worksaround the
problem in -Wuninitialized, but we should fix it for real later.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128443 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
da57f3eeab7b7f7f6e6788956f0a0d9adf196a7d 26-Mar-2011 Benjamin Kramer <benny.kra@googlemail.com> Make helpers static.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128339 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
a8d459e8a68b1270b0c35fb73e8cc090b2b69e36 23-Mar-2011 Ted Kremenek <kremenek@apple.com> Fix CFG-construction bug when run from AnalysisBasedWarnings::IssueWarnings() where block-level expressions that need
to be recorded in the Stmt*->CFGBlock* map were not always done so. Fixes <rdar://problem/9171946>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128170 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
97d2d2e368d3ead34d83c328383711c7dabab60a 22-Mar-2011 Logan Chien <tzuhsiang.chien@gmail.com> Merge with clang upstream r127980 (Mar 20th 2011)
aeafaf67b019bf195fb1adec7a45ab00ace0efb6 20-Mar-2011 Logan Chien <tzuhsiang.chien@gmail.com> Apply changes to migrate to Mar 18th 2011.
ndroid.mk
8e02635c9c276720a1e6f926b33303a53cebe9c7 18-Mar-2011 Logan Chien <tzuhsiang.chien@gmail.com> Merge with clang upstream r127869 (Mar 18th 2011)
af13d5b25b360e698cc1cf1055ad7d14e008e505 19-Mar-2011 Ted Kremenek <kremenek@apple.com> Rename class 'CFGReachabilityAnalysis' to 'CFGReverseBlockReachabilityAnalysis'.

This rename serves two purposes:

- It reflects the actual functionality of this analysis.
- We will have more than one reachability analysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127930 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
FGReachabilityAnalysis.cpp
1cbc31515e9b979f55178ffd4587e8671f7ebbfa 17-Mar-2011 Ted Kremenek <kremenek@apple.com> Extend -Wuninitialized to support vector types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127794 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
432c478fe0fec3946610d5dc7905daf5fbadf47b 16-Mar-2011 Ted Kremenek <kremenek@apple.com> Teach CFGBuilder that the 'default' branch of a switch statement is dead if all enum values in a switch conditioned are handled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127727 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
4ddb3871307376d27d0f276c9da0ecce0384f01f 15-Mar-2011 Ted Kremenek <kremenek@apple.com> Appease GCC. I'm surprised Clang accepted this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127672 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
76709bf816e5e1b70b859bb607cf3ee91db12b76 15-Mar-2011 Ted Kremenek <kremenek@apple.com> Split warnings from -Wuninitialized-experimental into "must-be-initialized" and "may-be-initialized" warnings, each controlled by different flags.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127669 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
f7bafc77ba12bb1beb665243a0334cd81e024728 15-Mar-2011 Ted Kremenek <kremenek@apple.com> Split warnings from -Wuninitialized-experimental into "must-be-initialized" and "may-be-initialized" warnings, each controlled by different flags.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127666 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
496398d523de712ac1084c53a397ca3987fe43db 15-Mar-2011 Ted Kremenek <kremenek@apple.com> UninitializedValues: introduce ValueVector:reference class to forward to llvm::BitVector. No real functionality change, but this is a stepping stone to moving to tri-state logic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127665 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
afb10c4bda2ac2c268fa7e6c11141584f57de119 15-Mar-2011 Ted Kremenek <kremenek@apple.com> UninitializedValues: wrap BitVector references in a new class ValueVector. No functionality change. This defines the minimum interface that ValueVector needs to support when we no longer base it strictly on a direct interpretation of BitVector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127664 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
136f8f24b0b6c0e57aaa4375d280d72dc5492615 15-Mar-2011 Ted Kremenek <kremenek@apple.com> Substitue term "BitVector" with "ValueVector" to prep for further revisions. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127663 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
6f34213f8d6ae8c77685b53664527e39bfaaca3b 15-Mar-2011 Ted Kremenek <kremenek@apple.com> Rename UninitializedValuesV2 to UninitializedValues.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127657 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ninitializedValues.cpp
ninitializedValuesV2.cpp
f3f5379f6da7f8f141a53e2945871a5aa5431e02 15-Mar-2011 Ted Kremenek <kremenek@apple.com> Remove old UninitializedValues analysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127656 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ninitializedValues.cpp
8026f6d82f7fa544bc0453714fe94bca62a1196e 13-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Instead of storing an ASTContext* in FunctionProtoTypes with computed noexcept specifiers, unique FunctionProtoTypes with a ContextualFoldingSet, as suggested by John McCall.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127568 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
e9cd9c0016f103fd45d41d136d5d1084aa42eb75 13-Mar-2011 Ted Kremenek <kremenek@apple.com> Fix CFG assertion failure reported in PR 9467. This was due to recent changes in optimizing CFGs for switch statements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127563 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
60618fa7f88d5162bb5b40988b6b38d4d75d6fc6 12-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Propagate the new exception information to FunctionProtoType.
Change the interface to expose the new information and deal with the enormous fallout.
Introduce the new ExceptionSpecificationType value EST_DynamicNone to more easily deal with empty throw specifications.
Update the tests for noexcept and fix the various bugs uncovered, such as lack of tentative parsing support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127537 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
f4e3cfbe8abd124be6341ef5d714819b4fbd9082 11-Mar-2011 Peter Collingbourne <peter@pcc.me.uk> Add support for the OpenCL vec_step operator, by generalising and
extending the existing support for sizeof and alignof. Original
patch by Guy Benyei.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127475 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ninitializedValuesV2.cpp
0d28d360b5559abda755e50b855ba5e59727d9cd 10-Mar-2011 Ted Kremenek <kremenek@apple.com> When doing reachability analysis for warnings issued under DiagRuntimeBehavior, don't construct a ParentMap or CFGStmtMap.
Instead, create a small set of Stmt* -> CFGBlock* mappings during CFG construction for only the statements we care about
relating to the diagnostics we want to check for reachability.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127396 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
FG.cpp
3179a45a0e91c1dcf3492222170cf4499531bb92 10-Mar-2011 Ted Kremenek <kremenek@apple.com> Require AddStmtChoice::alwaysAdd() to take a CFGBuilder& and Stmt*. Prep for functionality changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127387 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
247e9665d897a7bbbf60c1c0d3b6609c4504a961 10-Mar-2011 Ted Kremenek <kremenek@apple.com> Remove unused 'AddStmtChoice' argument to CFGBuilder::appendStmt().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127386 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
b8ad5ee345fa1fdd1fa9253f2d01f69becc88a04 10-Mar-2011 Ted Kremenek <kremenek@apple.com> Rework interaction between AnalysisContext and CFG::BuildOptions to keep a BuildOptions object around instead of keeping a copy of the flags.

Moreover, change AnalysisContext to use an OwningPtr for created analysis objects instead
of directly managing them.

Finally, add a 'forcedBlkExprs' entry to CFG::BuildOptions that will be used by the
CFGBuilder to force specific expressions to be block-level expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127385 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
FG.cpp
d271e4b0c6c42a0e670226e697963df427e35a56 07-Mar-2011 Logan Chien <tzuhsiang.chien@gmail.com> Apply changes to merge with clang upstream (6th Mar 2011)
ndroid.mk
27d70656d3ce7c9e030b6dea468cfc96687010d5 09-Mar-2011 Logan Chien <tzuhsiang.chien@gmail.com> Merge with clang upstream (Nov 6th 2011)
6e40035988965340555c942d6e7afb6c7527beb1 07-Mar-2011 Ted Kremenek <kremenek@apple.com> Fix null dereference in CFGBlock::FilterEdge that was reported in PR 9412.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127176 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
0498247f87ea0d716e0c2931fea812280649e33d 04-Mar-2011 Ted Kremenek <kremenek@apple.com> Correctly handle nested switch statements in CFGBuilder when on switch statement has a condition that evaluates to a constant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126977 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
c5aff4497e5bfd7523e00b87560c1a5aa65136cc 03-Mar-2011 Ted Kremenek <kremenek@apple.com> Teach CFGImplicitDtor::getDestructorDecl() about arrays of objects with destructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126910 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
697d42db6cba7a5994d955ce31be2c097902cf0c 03-Mar-2011 Ted Kremenek <kremenek@apple.com> Teach CFGImplicitDtor::getDestructorDecl() about reference types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126909 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
2ae00543d6e1bd7dba0ce2dacec740bb6049a2dd 03-Mar-2011 Matt Beaumont-Gay <matthewbg@google.com> Let's go with John and Ted's preferred fix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126907 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
8e23e6d27eb8147063053e606dbda098b7b52d7e 03-Mar-2011 Matt Beaumont-Gay <matthewbg@google.com> Keep GCC from complaining about falling off the end of the function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126897 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
c9f8f5a726bbb562e4b2d4b19d66e6202dcb2657 02-Mar-2011 Ted Kremenek <kremenek@apple.com> Introduce CFGImplicitDtor::isNoReturn() to query whether a destructor actually returns. Use this for -Wreturn-type to prune false positives reported in PR 6884.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126875 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
88134fd256c82a178c3ce13a686d0e0898448e0d 02-Mar-2011 Shih-wei Liao <sliao@google.com> Add NOTICE for lib/Analysis.

NOTICE of static libraries will get propagated as well, even though libclang* are not installed on a device.
It's a hack in the build system.

NOTICE added to static library for the propagation above and for compliance.

Change-Id: I19c0c343653474b1cc8288944b71b573dc3cea00
OTICE
e4a3cccfdcd4d014f5bdae7b387a1b402f77a21b 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Remove invalid assertion from CFG builder. When building the CFG pieces for a ternary '?' expression, it is possible for the confluence block to only have a single predecessor due to calls to 'noreturn' functions. Fixes assertion failure reported in PR 8619."
41aff6d5da1f7583c52cc3ac34f5f411973380e6 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Revert r118991."
b72756e6f56aefb1262a994b8218c61900cc8445 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Do not add implicit dtors for CXXBindTemporaryExpr with elidable CXXConstructExpr."
85f3d76c0ecfdefcf83ea44a57b7a16119c8a045 02-Mar-2011 John McCall <rjmccall@apple.com> Move some of the logic about classifying Objective-C methods into
conventional categories into Basic and AST. Update the self-init checker
to use this logic; CFRefCountChecker is complicated enough that I didn't
want to touch it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126817 91177308-0d34-0410-b5e6-96231b3b80d8
ocoaConventions.cpp
e71f3d587844110d836c82250830b27b1651afdb 02-Mar-2011 Ted Kremenek <kremenek@apple.com> Teach CFGBuilder to prune trivially unreachable case statements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126797 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
3c0349e87cdbd7316d06d2411d86ee1086e717a5 01-Mar-2011 Ted Kremenek <kremenek@apple.com> In preparation for fixing PR 6884, rework CFGElement to have getAs<> return pointers instead of fresh CFGElements.

- Also, consoldiate getDtorKind() and getKind() into one "kind".
- Add empty getDestructorDecl() method to CFGImplicitDtor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126738 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
FGStmtMap.cpp
eachableCode.cpp
ninitializedValuesV2.cpp
7a17851eee37f933eb57a5af7e1a0eb455443f6a 28-Feb-2011 Anders Carlsson <andersca@mac.com> Get rid of the areExceptionsEnabled() getter from LangOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126598 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
053ec969e3023e4b4a666546476ff74e6bfdfd9a 27-Feb-2011 Logan <tzuhsiang.chien@gmail.com> Merge with clang upstream Nov 10th 2010.
f226d18f0f49394cec460699f4268e32bd0ce833 24-Feb-2011 Ted Kremenek <kremenek@apple.com> Fix tiny error in CFG construction for BinaryConditionalOperators, making sure the branch always has two successors. Also teach Environment::getSVal() about OpaqueValueExprs.

This fixes a crash reported in PR9287, and also fixes a false positive involving the value of such ternary
expressions not properly getting propagated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126362 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
c56c004e0b8030e8ca8614e7febe581221938b75 23-Feb-2011 Ted Kremenek <kremenek@apple.com> Teach CFGBuilder about null pointer constants in conditionals, and how they can be used to prune branches. Fixes false null pointer dereference warning in PR 8183.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126305 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
42461eecee98fff3671b3c14ce10f1a9e18cc95c 23-Feb-2011 Ted Kremenek <kremenek@apple.com> Migrate CFGReachabilityAnalysis out of the IdempotentOperationsChecker and into its own analysis file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126289 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
FGReachabilityAnalysis.cpp
MakeLists.txt
283a358aecb75e30fcd486f2206f6c03c5e7f11d 23-Feb-2011 Ted Kremenek <kremenek@apple.com> Have IdempotentOperationsChecker pull its CFGStmtMap from AnalysisContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126288 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
6b12da9f89b7863e6fc995312355b94197b75657 21-Feb-2011 Ted Kremenek <kremenek@apple.com> Fix a CFGBuilder bug exposed on convoluted control-flow in the Linux kernel.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126149 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
c1cfdf8647a499b6b3024f4bd14a236cddb23988 20-Feb-2011 Anders Carlsson <andersca@mac.com> Add a LangOptions::areExceptionsEnabled and start using it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126062 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
d40baf6a77f6353a93f181da5d1347d3730aad37 19-Feb-2011 John McCall <rjmccall@apple.com> Fix a -Wuninitialized warning; it's actually a false positive,
but it's not reasonable for the diagnostic to figure that out.
Pointed out by Benjamin Kramer.

Also clarify the logic here.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126017 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
56ca35d396d8692c384c785f9aeebcf22563fe1e 17-Feb-2011 John McCall <rjmccall@apple.com> Change the representation of GNU ?: expressions to use a different expression
class and to bind the shared value using OpaqueValueExpr. This fixes an
unnoticed problem with deserialization of these expressions where the
deserialized form would lose the vital pointer-equality trait; or rather,
it fixes it because this patch also does the right thing for deserializing
OVEs.

Change OVEs to not be a "temporary object" in the sense that copy elision is
permitted.

This new representation is not totally unawkward to work with, but I think
that's really part and parcel with the semantics we're modelling here. In
particular, it's much easier to fix things like the copy elision bug and to
make the CFG look right.

I've tried to update the analyzer to deal with this in at least some
obvious cases, and I think we get a much better CFG out, but the printing
of OpaqueValueExprs probably needs some work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125744 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
eachableCode.cpp
ninitializedValues.cpp
ad8dcf4a9df0e24051dc31bf9e6f3cd138a34298 17-Feb-2011 Chris Lattner <sabre@nondot.org> Step #1/N of implementing support for __label__: split labels into
LabelDecl and LabelStmt. There is a 1-1 correspondence between the
two, but this simplifies a bunch of code by itself. This is because
labels are the only place where we previously had references to random
other statements, causing grief for AST serialization and other stuff.

This does cause one regression (attr(unused) doesn't silence unused
label warnings) which I'll address next.

This does fix some minor bugs:
1. "The only valid attribute " diagnostic was capitalized.
2. Various diagnostics printed as ''labelname'' instead of 'labelname'
3. This reduces duplication of label checking between functions and blocks.

Review appreciated, particularly for the cindex and template bits.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125733 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
fe59b7472c06b36efb74fbb50bbdf464fa30c0d8 15-Feb-2011 Ted Kremenek <kremenek@apple.com> Fix memory leak in CFGBuilder resulting from tracking scope information using SmallVectors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125550 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
7502c1d3ce8bb97bcc4f7bebef507040bd93b26f 13-Feb-2011 John McCall <rjmccall@apple.com> Give some convenient idiomatic accessors to Stmt::child_range and
Stmt::const_child_range, then make a bunch of places use them instead
of the individual iterator accessors.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125450 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
FG.cpp
seudoConstantAnalysis.cpp
ninitializedValues.cpp
848ec83483ca4ba52ed72c7e29ebc330f8c87252 12-Feb-2011 Ted Kremenek <kremenek@apple.com> Don't report dead stores on unreachable code paths. Fixes <rdar://problem/8405222>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125415 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
ninitializedValues.cpp
886e1606c28e970bb288abf4dbc40feb16822a79 10-Feb-2011 NAKAMURA Takumi <geek4civic@gmail.com> CMake: LLVM_NO_RTTI must be obsolete now!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125275 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
9fcbceed43e5610fdff43defe533934733453ae2 01-Feb-2011 Ted Kremenek <kremenek@apple.com> Enhance -Wuninitialized to better reason about || and &&, tracking dual dataflow facts and properly merging them.

Fixes PR 9076.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124666 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValuesV2.cpp
96554fd1aa7350498de8911fb6f303a9262e6ec0 27-Jan-2011 Ted Kremenek <kremenek@apple.com> Teach -Wuninitialized about indirect goto. Fixes PR 9071.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124394 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValuesV2.cpp
dfbb02a16ac8c764b5ba1742450513d6212d2f9f 27-Jan-2011 NAKAMURA Takumi <geek4civic@gmail.com> Fix whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124364 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
0099530a2288df7c2140dd8992b7310b9f6930a9 27-Jan-2011 NAKAMURA Takumi <geek4civic@gmail.com> 7bit-ize.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124363 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
40900ee8f3072d05456134b57c0fad85a6bb21a6 27-Jan-2011 Ted Kremenek <kremenek@apple.com> Teach -Wuninitialized not to assert when analyzing
blocks that reference captured variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124348 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValuesV2.cpp
1ea800c4ca76d5bb41aa8a1e0a6c7628b9fff28d 27-Jan-2011 Ted Kremenek <kremenek@apple.com> Teach -Wuninitialized about ObjC fast enumeration loops.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124347 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValuesV2.cpp
dd0f7942c5415ce146dcc02d57fc503c683f8625 26-Jan-2011 Ted Kremenek <kremenek@apple.com> Tweak -Wuninitialized-experimental to not emit
a warning for uses of an uninitialized variable
when the use is a void cast, e.g. (void) x.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124278 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValuesV2.cpp
a8c17a5babab35f2db26bf218e7571d1af4afedf 25-Jan-2011 Ted Kremenek <kremenek@apple.com> Teach -Wuninitialized-experimental to also warn
about uninitialized variables captured by blocks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124213 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValuesV2.cpp
9660803cd332d5c605899435019bb3b37fca3acc 23-Jan-2011 Ted Kremenek <kremenek@apple.com> Teach -Wuninitialized-experimental about sizeof().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124076 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValuesV2.cpp
6178e53c59cde02b956f86743901133d72499636 20-Jan-2011 Ted Kremenek <kremenek@apple.com> Removing debug printing logic from UninitializedValuesV2.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123944 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValuesV2.cpp
2d4bed140f65d713673d2d32ec3adadc960078c6 20-Jan-2011 Ted Kremenek <kremenek@apple.com> Relax CFG assertions in UninitializedValuesV2 when
handling pseudo-path sensitivity, and instead
use those assertion conditions as dynamic checks.
These assertions would be violated when analyzing
a CFG where some branches where optimized away
during CFG construction because their branch
conditions could be trivially determined.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123943 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValuesV2.cpp
13bd4236ab8297350be388ab442b4c42eb8fe437 20-Jan-2011 Ted Kremenek <kremenek@apple.com> Add rudimentary path-sensitivity to UnintializedValuesV2
analysis for short-circuited operations. For branch written like "if (x && y)",
we maintain two sets of dataflow values for the outgoing
branches. This suppresses some common false positives
for -Wuninitialized-experimental.

This change introduces some assertion failures
when running on the LLVM codebase. WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123923 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValuesV2.cpp
f4c7371fb1d3cebcfb40abad4537bb82515704ea 19-Jan-2011 John McCall <rjmccall@apple.com> Change QualType::getTypePtr() to return a const pointer, then change a
thousand other things which were (generally inadvertantly) relying on that.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123814 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ocoaConventions.cpp
150e0efec6302fa5a8c3b5c3c4ecf5778d3a29f5 19-Jan-2011 Logan <tzuhsiang.chien@gmail.com> Add build rules for clang executable.
ndroid.mk
c21fed361c11f13db345cba69101578578d8fb79 18-Jan-2011 Ted Kremenek <kremenek@apple.com> Teach UninitializedValuesV2 to implicitly reason about C++
references by monitoring whether an access to
a variable is solely to compute it's lvalue or
to do an lvalue-to-rvalue conversion (i.e., a load).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123777 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValuesV2.cpp
4dccb90e92ba9e4abffe0177493b6db9949678dd 18-Jan-2011 Ted Kremenek <kremenek@apple.com> Correctly enable test/Sema/unit-variables.c,
thus identifying a minor logical flaw in
UninitializedValuesV2.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123734 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValuesV2.cpp
c104e53639de4424b83955acfadc977773b5883d 18-Jan-2011 Ted Kremenek <kremenek@apple.com> Teach UninitializedValuesV2 about "int x = x" and
also properly handle confluence of loops.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123733 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValuesV2.cpp
04eeba43040969c05cfcb563195ef5b199297b62 16-Jan-2011 Anders Carlsson <andersca@mac.com> Add AnalysisContext::dumpCFG.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123602 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
2d78c374508dc1f4595fe5172b39bf51b07aa48c 15-Jan-2011 Francois Pichet <pichet2000@gmail.com> Unbreak the MSVC build again: replace bzero by memset.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123538 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValuesV2.cpp
610068c8cd2321f90e147b12cf794e1f840b6405 15-Jan-2011 Ted Kremenek <kremenek@apple.com> Add initial prototype for implementation of
-Wuninitialized based on CFG dataflow analysis. WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123512 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ninitializedValuesV2.cpp
5078d46af381b27be1c7e3c3e0c517e4cf7cc064 11-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Add 'bool ignorePrefix' parameter to cocoa::deriveNamingConvention to control whether
the prefix should be ignored.

E.g. if ignorePrefix is true, "_init" and "init" selectors will both be result in InitRule, but if
ignorePrefix is false, only "init" will return InitRule.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123262 91177308-0d34-0410-b5e6-96231b3b80d8
ocoaConventions.cpp
cbb67480094b3bcb5b715acd827cbad55e2a204c 08-Jan-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Renamed CXXBaseOrMemberInitializer to CXXCtorInitializer. This is both shorter,
more accurate, and makes it make sense for it to hold a delegating constructor
call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123084 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
eeef924c4fcb79a3bcc8782afce343e641bbcb83 08-Jan-2011 Chandler Carruth <chandlerc@gmail.com> Remove a kludge from analysis based warnings that used to detect
temporaries with no-return destructors. The CFG now properly supports
temporaries and implicit destructors which both makes this kludge no
longer work, and conveniently removes the need for it.

Turn on CFG handling of implicit destructors and initializers. Several
ad-hoc benchmarks don't indicate any measurable performance impact from
growing the CFG, and it fixes real correctness problems with warnings.

As a result of turning on these CFG elements, we started to tickle an
inf-loop in the unreachable code logic used for warnings. The fix is
trivial.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123056 91177308-0d34-0410-b5e6-96231b3b80d8
eachableCode.cpp
65197b4b0c55bb74af0450230d61ee9461223721 08-Jan-2011 Ted Kremenek <kremenek@apple.com> Add semantic checking that the "thousands grouping"
prefix in a printf format string is matched
with the appropriate conversion specifier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123055 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
bd18d4584aae0ed6f7111ef5713784cf29fe663f 08-Jan-2011 Ted Kremenek <kremenek@apple.com> Add printf format string parsing support for '
prefix to format conversions (POSIX extension).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123054 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
9ce5270f0aadaaf03a0cf705787f42ce9eb1194c 07-Jan-2011 Ted Kremenek <kremenek@apple.com> Fix crash in CFGBuilder on invalid code. We still need
to reject this code, but at least clang doesn't
crash anymore.

Crash reported in PR 8880.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123017 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
3f59c975aa5d047f7edd1b900b5e885c38af0ef7 26-Dec-2010 Chris Lattner <sabre@nondot.org> The -fshort-wchar option causes wchar_t to become unsigned, in addition to being
16-bits in size. Implement this by splitting WChar into two enums, like we have
for char. This fixes a miscompmilation of XULRunner, PR8856.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122558 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
9ef6537a894c33003359b1f9b9676e9178e028b7 23-Dec-2010 Ted Kremenek <kremenek@apple.com> Rename static analyzer namespace 'GR' to 'ento'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122492 91177308-0d34-0410-b5e6-96231b3b80d8
ocoaConventions.cpp
5a4f98ff943e6a501b0fe47ade007c9bbf96cb88 22-Dec-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Refactoring: Move stuff into namespace 'GR'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122423 91177308-0d34-0410-b5e6-96231b3b80d8
ocoaConventions.cpp
5eef59ee77456640a2d03bb90fc717d5a43e175d 17-Dec-2010 Ted Kremenek <kremenek@apple.com> Fix assertion failure in cocoa::deriveNamingConvention()
when the selector is the string 'mutable'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122046 91177308-0d34-0410-b5e6-96231b3b80d8
ocoaConventions.cpp
bb8fef382ad89b4bc202a1dbd4cd52ced7734479 17-Dec-2010 Ted Kremenek <kremenek@apple.com> Move CocoaConventions.[h,cpp] from libChecker
to libAnalysis. Similar to Format (format string checking),
CocoaConventions has the
potential to serve clients other than the
static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122040 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ocoaConventions.cpp
0a3ed3143b00f237decb1288c1ff574ae09eba4e 17-Dec-2010 Ted Kremenek <kremenek@apple.com> Rename several methods/functions in the analyzer
to start with lowercase characters. No
functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122035 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
892697dd2287caf7c29aaaa82909b0e90b8b63fe 16-Dec-2010 Ted Kremenek <kremenek@apple.com> Start migration of static analyzer to using the
implicit lvalue-to-rvalue casts that John McCall
recently introduced. This causes a whole bunch
of logic in the analyzer for handling lvalues
to vanish. It does, however, raise a few issues
in the analyzer w.r.t to modeling various constructs
(e.g., field accesses to compound literals).

The .c/.m analysis test cases that fail are
due to a missing lvalue-to-rvalue cast that
will get introduced into the AST. The .cpp
failures were more than I could investigate in
one go, and the patch was already getting huge.
I have XFAILED some of these tests, and they
should obviously be further investigated.

Some highlights of this patch include:

- CFG no longer requires an lvalue bit for
CFGElements
- StackFrameContext doesn't need an 'asLValue'
flag
- The "VisitLValue" path from GRExprEngine has
been eliminated.

Besides the test case failures (XFAILed), there
are surely other bugs that are fallout from
this change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121960 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
FG.cpp
seudoConstantAnalysis.cpp
eachableCode.cpp
4765fa05b5652fcc4356371c2f481d0ea9a1b007 06-Dec-2010 John McCall <rjmccall@apple.com> Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoretical
reason this is limited to C++, and it's certainly not limited to temporaries.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120996 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
00eb3f9c5b33e3d99aee1f8b75dd9c9678fdd66b 04-Dec-2010 Francois Pichet <pichet2000@gmail.com> More anonymous struct/union redesign. This one deals with anonymous field used in a constructor initializer list:

struct X {
X() : au_i1(123) {}
union {
int au_i1;
float au_f1;
};
};

clang will now deal with au_i1 explicitly as an IndirectFieldDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120900 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
f6a1648197562e0b133440d612d9af297d0a86cc 04-Dec-2010 John McCall <rjmccall@apple.com> Although we currently have explicit lvalue-to-rvalue conversions, they're
not actually frequently used, because ImpCastExprToType only creates a node
if the types differ. So explicitly create an ICE in the lvalue-to-rvalue
conversion code in DefaultFunctionArrayLvalueConversion() as well as several
other new places, and consistently deal with the consequences throughout the
compiler.

In addition, introduce a new cast kind for loading an ObjCProperty l-value,
and make sure we emit those nodes whenever an ObjCProperty l-value appears
that's not on the LHS of an assignment operator.

This breaks a couple of rewriter tests, which I've x-failed until future
development occurs on the rewriter.

Ted Kremenek kindly contributed the analyzer workarounds in this patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120890 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
7966297a70996977f167a8676568f02f4283bdd6 02-Dec-2010 Ted Kremenek <kremenek@apple.com> Fix range in printf warnings for invalid conversion specifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120735 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
d706434b0231c76fd9acf30060646a7aa8f69aef 24-Nov-2010 Zhongxing Xu <xuzhongxing@gmail.com> Let StackFrameContext represent if the call expr is evaluated as lvalue.
This is required for supporting const reference to temporary objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120093 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
5281b8ed0e395603e5ff15ecc01ee0d0dff2e0fd 24-Nov-2010 Zhongxing Xu <xuzhongxing@gmail.com> print asLValue attribute of CFGStmt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120086 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
94a3dcf146451eb6b0192873e267c4cb0f6147e8 24-Nov-2010 Zhanyong Wan <wan@google.com> Refactor AddStmtChoice to make it easier to use; also add comments on how the class works. Reviewed by kremenek.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120080 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
36f327c309b1fb6b82f1987190f0be74000b14c1 22-Nov-2010 Zhanyong Wan <wan@google.com> Stylistic changes to CFG.cpp:

1. "no 'else' after 'return'" -- this is for conformance with the
coding standards.

2. move 'else' to the line of the previous '}' -- this is for consistency.

Reviewed by kremenek.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119983 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
99cae5b67b9711ca260e5b364a878a1a91183632 22-Nov-2010 Zhanyong Wan <wan@google.com> Fix PR8419. Reviewed by kremenek and xuzhongxing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119960 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
2e6c19abcf97c25f4d7458a9db89c5ab0158717d 21-Nov-2010 Anders Carlsson <andersca@mac.com> The 'X' printf type has a valid alternative form. Fixes PR8641.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119946 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
7fbbd12a038184d5a3ec1a101a74d7fd8c9e9a86 15-Nov-2010 Ted Kremenek <kremenek@apple.com> Remove invalid assertion from CFG builder. When building the CFG pieces for a ternary '?' expression,
it is possible for the confluence block to only have a single predecessor due to calls to 'noreturn'
functions. Fixes assertion failure reported in PR 8619.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119284 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
e4ae4dc87fa57e3062077514964b6d75bfa1fed1 15-Nov-2010 Ted Kremenek <kremenek@apple.com> Remove invalid assertion from CFG builder. When building the CFG pieces for a ternary '?' expression,
it is possible for the confluence block to only have a single predecessor due to calls to 'noreturn'
functions. Fixes assertion failure reported in PR 8619.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119284 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
9c790bbfdf3d8f00a3c2ae233aa19e29a2cc1178 14-Nov-2010 Zhongxing Xu <xuzhongxing@gmail.com> Revert r118991.

Elidable CXXConstructExpr should inhibit calling destructor for temporary
that is copied, not the one created. This is because eliding copy constructor
means that the object that was to be copied will be constructed directly in
memory the copy would be constructed in.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119044 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
249c9458e2cc5b671634baefe8517d7598883a20 14-Nov-2010 Zhongxing Xu <xuzhongxing@gmail.com> Revert r118991.

Elidable CXXConstructExpr should inhibit calling destructor for temporary
that is copied, not the one created. This is because eliding copy constructor
means that the object that was to be copied will be constructed directly in
memory the copy would be constructed in.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119044 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
88cb2d4e1d0a645f7b3eb010856a23682847ee02 13-Nov-2010 Zhongxing Xu <xuzhongxing@gmail.com> Do not add implicit dtors for CXXBindTemporaryExpr with elidable
CXXConstructExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118991 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
9a4084dc06dc1b0033c461013bee3bae74be0555 13-Nov-2010 Zhongxing Xu <xuzhongxing@gmail.com> Do not add implicit dtors for CXXBindTemporaryExpr with elidable
CXXConstructExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118991 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
204c2921a0f1c0f590cf5a5b19e40694623bd8a1 06-Nov-2010 Anders Carlsson <andersca@mac.com> Don't warn when matching %p to nullptr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118344 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
624259984448cf19f4e94b7e31c7c32e99a39ea5 06-Nov-2010 Anders Carlsson <andersca@mac.com> Don't warn when matching %p to nullptr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118344 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
ccd11d60bf5349c100f78a40996a0129df7a4aca 03-Nov-2010 Zhongxing Xu <xuzhongxing@gmail.com> Do not add elidable CXXConstructExpr as block-level expr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118165 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
3ff5b26ddd5857a50db4bfacdd198fb32eaebdac 03-Nov-2010 Zhongxing Xu <xuzhongxing@gmail.com> Do not add elidable CXXConstructExpr as block-level expr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118165 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
e762d6951d6f6fd21f38acdb47c83b8cfe67ef70 03-Nov-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added generating destructors for temporary objects. Two cases I know of, that are not handled properly:
1. For statement: const C& c = C(0) ?: C(1) destructors generated for condition will not differ from those generated for case without prolonged lifetime of temporary,
2. There will be no destructor for constant reference member bound to temporary at the exit from constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118158 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
8599e7677e067fd01d3b2ee4c0875747d367fd8e 03-Nov-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added generating destructors for temporary objects. Two cases I know of, that are not handled properly:
1. For statement: const C& c = C(0) ?: C(1) destructors generated for condition will not differ from those generated for case without prolonged lifetime of temporary,
2. There will be no destructor for constant reference member bound to temporary at the exit from constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118158 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
1551b3c5634728bb236eaa8b0895ecadf14c4a98 01-Nov-2010 Zhongxing Xu <xuzhongxing@gmail.com> Explicitly handle CXXBindTemporaryExpr, CXXFunctionalCastExpr,
and ImplicitCastExpr to propagate asLValue AddStmtChoice property.
But do not propagate AlwaysAdd property.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117909 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
a725ed468585b881c43654eeb56b28554a84808a 01-Nov-2010 Zhongxing Xu <xuzhongxing@gmail.com> Explicitly handle CXXBindTemporaryExpr, CXXFunctionalCastExpr,
and ImplicitCastExpr to propagate asLValue AddStmtChoice property.
But do not propagate AlwaysAdd property.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117909 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
4f15dd00ce7ce04b016613f49241c91c685efbed 01-Nov-2010 Zhongxing Xu <xuzhongxing@gmail.com> Make all CXXConstructExpr's block-level expressions. This is required by
method inlining. Temporarily fail a test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117907 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
81bc7d07b701042371a5723b6f394cd2482ed7be 01-Nov-2010 Zhongxing Xu <xuzhongxing@gmail.com> Make all CXXConstructExpr's block-level expressions. This is required by
method inlining. Temporarily fail a test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117907 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
2acc42b71d70979dd16122d5636d3660da5f0856 29-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added CFGTerminator class, that holds information about CFGBlock terminator statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117642 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
eachableCode.cpp
4ba72a0b28135209c435630682febe1f854ccfa6 29-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added CFGTerminator class, that holds information about CFGBlock terminator statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117642 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
eachableCode.cpp
2471c6f88c53acfa570651a04a093ef4af5e1f1d 27-Oct-2010 Zhongxing Xu <xuzhongxing@gmail.com> If visiting RHS causes us to finish 'Block', e.g. the RHS is a StmtExpr
containing a DoStmt, and the LHS doesn't create a new block, then we should
return RBlock. Otherwise we'll incorrectly return NULL.

Also relax an assertion in VisitWhileStmt(). Reset 'Block' when it is finished.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117436 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
a1898ddd5d0e46330898930b9185b628b5cede63 27-Oct-2010 Zhongxing Xu <xuzhongxing@gmail.com> If visiting RHS causes us to finish 'Block', e.g. the RHS is a StmtExpr
containing a DoStmt, and the LHS doesn't create a new block, then we should
return RBlock. Otherwise we'll incorrectly return NULL.

Also relax an assertion in VisitWhileStmt(). Reset 'Block' when it is finished.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117436 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
b87aad8ce09af19eb811bdb9be3fcbc11b2028a6 25-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added generation of destructors for member constant size arrays.
There's only one destructor call generated for each not empty array (at least for now this should be enough).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117252 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
8c5e5d6d8a316af5a9842169f541cac49717887d 25-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added generation of destructors for member constant size arrays.
There's only one destructor call generated for each not empty array (at least for now this should be enough).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117252 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
3f46279e9c4887ed72406e740830f0a58adcc38a 25-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added generation of destructors for constant size arrays.
There's only one destructor call generated for each not empty array (at least for now this should be enough).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117251 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
b1c52870b8c2feaa7cd112295368bec53af490a0 25-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added generation of destructors for constant size arrays.
There's only one destructor call generated for each not empty array (at least for now this should be enough).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117251 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
9106582d6afd4e33bd39f3e7173acdbb4e9b7849 24-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> - Fixed subexpressions evaluation order for binary operators to match order in code generated with the compiler,
- Fixed test cases for unreachable code warnings produced by Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117220 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
e1667190dff025936a21e5eb43889ac93b570468 24-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> - Fixed subexpressions evaluation order for binary operators to match order in code generated with the compiler,
- Fixed test cases for unreachable code warnings produced by Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117220 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
16b6f68e2012abb1b36c44dd9412e09e09488e20 21-Oct-2010 Ted Kremenek <kremenek@apple.com> Previously, the printf warnings would say your arguments type was 'int' when it was really a 'char'
or a 'short'. This fixes that and allows the hints to suggest 'h' modifiers for small ints.

Patch by Justin Bogner!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116996 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
4d8ae4d57ed18d60da4d3786fb740607aa7c3688 21-Oct-2010 Ted Kremenek <kremenek@apple.com> Previously, the printf warnings would say your arguments type was 'int' when it was really a 'char'
or a 'short'. This fixes that and allows the hints to suggest 'h' modifiers for small ints.

Patch by Justin Bogner!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116996 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
68790944c3bb21baf8d3d28c9d4da5027f1bd229 15-Oct-2010 John McCall <rjmccall@apple.com> Death to blocks, or at least the word "block" in one particular obnoxiously
ambiguous context.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116567 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
b6bbcc9995186799a60ce17d0c1acff31601653a 15-Oct-2010 John McCall <rjmccall@apple.com> Death to blocks, or at least the word "block" in one particular obnoxiously
ambiguous context.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116567 91177308-0d34-0410-b5e6-96231b3b80d8
ninitializedValues.cpp
b0406ccde76ee9b4f8601a693f4cd49388873a73 06-Oct-2010 Stephen Hines <srhines@google.com> Add LOCAL_MODULE_TAGS to clang Android.mk files.

Change-Id: Iba0dd9023388948d2c3fcb3522cea5d5d9a264a7
ndroid.mk
5e6b9b1985b2fa574dcec76c8a5b541713e05e6c 05-Oct-2010 Zhongxing Xu <xuzhongxing@gmail.com> * Simplify code
* Fix dump() to make it consistent with the test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115609 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
4e493e0dbac2aaac04c041f3d7dee9eccfb97689 05-Oct-2010 Zhongxing Xu <xuzhongxing@gmail.com> * Simplify code
* Fix dump() to make it consistent with the test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115609 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
f2132ecf6389e72d23742103303e8f89bfd7dc4c 05-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added support for base and member destructors in destructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115592 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
7c625d8ffc20b92fff9e1690cd2484fcb6498183 05-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added support for base and member destructors in destructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115592 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
0c96a062ccfa67c646bb7d19d90fe43670aaec5c 04-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added support for C++ initializers in CFG.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115493 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
82bc3fd823d85ee3ef9a641c0975b6ad25f55047 04-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added support for C++ initializers in CFG.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115493 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
7d67e13a20aba29dc10a8c0e341e4a1cfdf94542 01-Oct-2010 Zhongxing Xu <xuzhongxing@gmail.com> Now the whether adding implicit dtors is controlled by cmd option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115275 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
a1a5d8e75076470c35fb069b98bf2b01904b5960 01-Oct-2010 Zhongxing Xu <xuzhongxing@gmail.com> Now the whether adding implicit dtors is controlled by cmd option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115275 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
6680dea273954b5e3f07d4fb9be1d504f87e3807 01-Oct-2010 Zhongxing Xu <xuzhongxing@gmail.com> The return value is never used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115272 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
6a16a306f6226030f8d38ae7e32082888fa937a1 01-Oct-2010 Zhongxing Xu <xuzhongxing@gmail.com> The return value is never used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115272 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
46be1c6c115b5c89434e5c8f09f3c9ebc37fecec 01-Oct-2010 Zhongxing Xu <xuzhongxing@gmail.com> Use default augument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115271 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
b6edff55db4ff240d56d33594d68a711e4b1e24a 01-Oct-2010 Zhongxing Xu <xuzhongxing@gmail.com> Use default augument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115271 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
0b537070b1419dd485c7ddcd8a047e08205b437e 01-Oct-2010 Zhongxing Xu <xuzhongxing@gmail.com> Simplify interface for addLocalScopeForStmt().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115270 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
02acdfaeb3f3805b65e4707e5dff096209adb367 01-Oct-2010 Zhongxing Xu <xuzhongxing@gmail.com> Simplify interface for addLocalScopeForStmt().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115270 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
e721268558242dd1474ab20ca6fcb73cbcc57290 01-Oct-2010 Zhongxing Xu <xuzhongxing@gmail.com> The old logic would add non-struct and non C++ struct variables to the local
scope. Now we only add C++ struct with non-trivial destructor variables to the
local scope.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115269 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
26bc70557cba0da863dfc19bb88f0db6613ec625 01-Oct-2010 Zhongxing Xu <xuzhongxing@gmail.com> The old logic would add non-struct and non C++ struct variables to the local
scope. Now we only add C++ struct with non-trivial destructor variables to the
local scope.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115269 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
6bc22517f79f76ed13a1cb43fdbc51a8fd73c0b1 01-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added generating CFGAutomaticObjDtors for exception variable in catch statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115266 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
0e97bcbee9d5f7735edecbccfb5031a2f065f286 01-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added generating CFGAutomaticObjDtors for exception variable in catch statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115266 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
87189bf52beca5fcedc27789d5623e71881c7fb2 01-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added generating CFGAutomaticObjDtors for init statement, condition variable and implicit scope in for statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115265 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
47575f1f775f5f250be4f395fa694a7274a65f33 01-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added generating CFGAutomaticObjDtors for init statement, condition variable and implicit scope in for statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115265 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
d6294f50b2c2636026cb4b0ea47ec4a4b59af6ff 01-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> dded generating CFGAutomaticObjDtors for condition variable and implicit scopes in switch statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115264 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
8ae6058cecba902c0069c24bdc9c26d475559291 01-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> dded generating CFGAutomaticObjDtors for condition variable and implicit scopes in switch statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115264 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
dba89ff72dbead21bf9b8638904cf2d72d37e200 01-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added generating CFGAutomaticObjDtors for condition variable and implicit scopes in while and do statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115262 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
05adedcb5e199e377e35f576288caf5ceed40136 01-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added generating CFGAutomaticObjDtors for condition variable and implicit scopes in while and do statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115262 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
e69d60450a43ba92232b6f4b35e7c01e4c1f4d0e 01-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added generating CFGAutomaticObjDtors for condition variable and implicit scopes in if statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115256 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
04e046cbf7153fc261d730d460f081322d5c42f6 01-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added generating CFGAutomaticObjDtors for condition variable and implicit scopes in if statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115256 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
a2bdec00e0a9a7b4a9cd2ef667a8beca91cb5fa6 01-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Fixed checking for trivial destructor in CFGBuilder::addLocalScopeForVarDecl. Checked type does not have to represent C++ class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115254 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
63426e5df054d04226a5456d17d26212d8eff30e 01-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Fixed checking for trivial destructor in CFGBuilder::addLocalScopeForVarDecl. Checked type does not have to represent C++ class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115254 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
8aec665691e45fa774b1f5adec32593e5e1fbc83 01-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added:
- Adding LocalScope for CompoundStmt,
- Adding CFGAutomaticObjDtors for end of scope, return, goto, break, continue,
- Regression tests for above cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115252 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
fcb72ac985c26372315fabc08d43d6f66ff906b4 01-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added:
- Adding LocalScope for CompoundStmt,
- Adding CFGAutomaticObjDtors for end of scope, return, goto, break, continue,
- Regression tests for above cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115252 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
470a7e4ef1de3152021f2f8701847e028ed3842f 01-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added methods for adding LocalScopes and CFGAutomaticObjDtors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115237 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
239a7c42df78abc7fd5611d806d5e199fec994d1 01-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added methods for adding LocalScopes and CFGAutomaticObjDtors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115237 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
971b75de8647f4bbce6b7580899eb0e222453409 01-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added methods for inserting CFGAutomaticObjDtors to CFGBlocks,
Fixed some misspells in comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115236 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
53de134e7b4686eed40bc031438d8a4560a2cda4 01-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added methods for inserting CFGAutomaticObjDtors to CFGBlocks,
Fixed some misspells in comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115236 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
abed169e087de5424b36d71838e1b2c3b1d3d0f8 01-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added:
- post-increament, distance and bool conversion methods to LocalScope::const_iterator,
- adding VarDecl to LocalScope.

Fixed some misspells in comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115227 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
35387a0daf3a6a7f5fcfc232eb4c28f62a4a1957 01-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added:
- post-increament, distance and bool conversion methods to LocalScope::const_iterator,
- adding VarDecl to LocalScope.

Fixed some misspells in comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115227 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
809f4dbe78085c5fbebd490877ac17d7dc8316f5 30-Sep-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added two new command line arguments:
-cfg-add-implicit-dtors - sets CFG::BuildOptions::AddImplicitDtors for AnalysisCosumer to true,
-cfg-add-initializers - sets CFG::BuildOptions::AddInitializers for AnalysisCosumer to true.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115142 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
9121ba232903ebe61e7bbe14ca294cf0f07dfa96 30-Sep-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added two new command line arguments:
-cfg-add-implicit-dtors - sets CFG::BuildOptions::AddImplicitDtors for AnalysisCosumer to true,
-cfg-add-initializers - sets CFG::BuildOptions::AddInitializers for AnalysisCosumer to true.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115142 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
5bf932e2b581033d37b9978e2b0d861b6495c3b5 25-Sep-2010 Marcin Swiderski <marcin.sfider@gmail.com> In preparation for adding generation of destructors for objects with automatic storage added:
- LocalScope class with iterator used to pointing into it,
- fat doxygen comment for LocalScope indended usage,
- BlockScopePosPair class used for storing jump targets/sources (for: goto, break, continue), that replaces raw CFGBlock pointer used earlier for this purpose.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114790 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
f1308c738dc1e7a36101d9e96071d0d241bc2ccb 25-Sep-2010 Marcin Swiderski <marcin.sfider@gmail.com> In preparation for adding generation of destructors for objects with automatic storage added:
- LocalScope class with iterator used to pointing into it,
- fat doxygen comment for LocalScope indended usage,
- BlockScopePosPair class used for storing jump targets/sources (for: goto, break, continue), that replaces raw CFGBlock pointer used earlier for this purpose.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114790 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
5914bd8ab19c1e7bc190c6bc916436e5a8f64c10 21-Sep-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added:
- definitions of interfaces for CFGInitializer and CFGAutomaticObjDtor,
- support for above classes to print_elem function (renamed print_stmt),
- support for VarDecls in StmtPrinterHelper.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114403 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
1cff132e48e0ccc253c34e5a2fb12718bd4e7d2e 21-Sep-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added:
- definitions of interfaces for CFGInitializer and CFGAutomaticObjDtor,
- support for above classes to print_elem function (renamed print_stmt),
- support for VarDecls in StmtPrinterHelper.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114403 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
8796cbb2e5371298758b18800a313c4b786fd88a 16-Sep-2010 Zhongxing Xu <xuzhongxing@gmail.com> Tidy up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114062 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
49b4ef364ba042f7db2ba567310fb49917ad0086 16-Sep-2010 Zhongxing Xu <xuzhongxing@gmail.com> Tidy up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114062 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
bcd067d551ea9eb7dc811620c0228fb424937909 16-Sep-2010 Zhongxing Xu <xuzhongxing@gmail.com> Introduce new CFGElement hierarchy to support C++ CFG, based on Marcin's patch
and discussions with Ted and Jordy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114056 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
FGStmtMap.cpp
eachableCode.cpp
b36cd3e1757fb4fcd9509f35558c847b04bef35f 16-Sep-2010 Zhongxing Xu <xuzhongxing@gmail.com> Introduce new CFGElement hierarchy to support C++ CFG, based on Marcin's patch
and discussions with Ted and Jordy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114056 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
FGStmtMap.cpp
eachableCode.cpp
7dfbc984805f69f5b6127f29043e87be28e28003 15-Sep-2010 Ted Kremenek <kremenek@apple.com> Relax assertion in CFG builder when processing ForStmts. This fixes an assertion failure
on code containing GNU statement expressions reported in PR 8141.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113953 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
8f3b834471b158d65d490e3458fa16ba659ec105 15-Sep-2010 Ted Kremenek <kremenek@apple.com> Relax assertion in CFG builder when processing ForStmts. This fixes an assertion failure
on code containing GNU statement expressions reported in PR 8141.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113953 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
be96b95ff811874dadb5cf0f9f17b3de91f5b574 15-Sep-2010 Ted Kremenek <kremenek@apple.com> Add CFG::BuildOptions class to pass in CFG builder options under on parameter. Patch by Marcin Świderski!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113898 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
FG.cpp
6c52c7850bccb6991470668429a1e1edf01b0873 15-Sep-2010 Ted Kremenek <kremenek@apple.com> Add CFG::BuildOptions class to pass in CFG builder options under on parameter. Patch by Marcin Świderski!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113898 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
FG.cpp
3049ec9961d1a1f0570a24dc601e6a362129b35d 10-Sep-2010 Shih-wei Liao <sliao@google.com> Merge changes from upstream repository (r112367)

Change-Id: Ib88c8fd890e7c8c5597ea2b86cfa934438965c08
be49529fbbe8d40c4860b83824362d378eb3cf58 14-Sep-2010 Ted Kremenek <kremenek@apple.com> Fix CFGBuilder crash reported in PR 8141.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113826 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
44f8ef13a3af125eecd408d0fad79a4a1eda5366 14-Sep-2010 Ted Kremenek <kremenek@apple.com> Fix CFGBuilder crash reported in PR 8141.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113826 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
fe0fb28bcfc69003c77765352186302b6ba30a90 14-Sep-2010 Michael J. Spencer <bigcheesegs@gmail.com> Revert "CMake: Update to use standard CMake dependency tracking facilities instead"

This reverts commit r113631

Conflicts:

CMakeLists.txt
lib/CodeGen/CMakeLists.txt

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113817 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
560a921b85773ac7c2d1a7a4aec4682c822c5cb4 14-Sep-2010 Michael J. Spencer <bigcheesegs@gmail.com> Revert "CMake: Update to use standard CMake dependency tracking facilities instead"

This reverts commit r113631

Conflicts:

CMakeLists.txt
lib/CodeGen/CMakeLists.txt

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113817 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
9febb6c1221f60f0037eb3e4b6ed3f84adfde41d 14-Sep-2010 Ted Kremenek <kremenek@apple.com> Remove from the CFG the half-implemented support for scoping information. We decided that scope information doesn't belong in the CFG at all, since it is a lexical construct.

Patch by Marcin Świderski!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113798 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
fe255bc6dfddade15644aecead970791e96ddedc 14-Sep-2010 Ted Kremenek <kremenek@apple.com> Remove from the CFG the half-implemented support for scoping information. We decided that scope information doesn't belong in the CFG at all, since it is a lexical construct.

Patch by Marcin Świderski!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113798 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
42591fac8f92efab995608d36060579a9b688d66 10-Sep-2010 Michael J. Spencer <bigcheesegs@gmail.com> CMake: Update to use standard CMake dependency tracking facilities instead
of whatever we were using before...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113631 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
5a7f34958ca6f2fa8a52e9921cf521cbb92ae070 10-Sep-2010 Michael J. Spencer <bigcheesegs@gmail.com> CMake: Update to use standard CMake dependency tracking facilities instead
of whatever we were using before...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113631 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
3311f5e196908b166da7dbb06567e1d2c15268e2 10-Sep-2010 Ted Kremenek <kremenek@apple.com> Add ObjCAtSynchronizedStmt to the CFG and add GRExprEngine support (PreVisit for checkers).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113572 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
4beaa9f51b2da57c64740cef2bd1c2fdb0c325d5 10-Sep-2010 Ted Kremenek <kremenek@apple.com> Add ObjCAtSynchronizedStmt to the CFG and add GRExprEngine support (PreVisit for checkers).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113572 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
a38512534c7e4455907c202408362c1d0b265e85 09-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Clean up CMake dependencies

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113489 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ec9bf475657e4fd7c8e920ff816a4e3cdb2ea213 09-Sep-2010 Douglas Gregor <dgregor@apple.com> Clean up CMake dependencies

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113489 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
bf2b28c150c9c539175221926d6b84dc06f87d1a 09-Sep-2010 Ted Kremenek <kremenek@apple.com> Remove stray ';' and convert tabs to spaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113466 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
be39a566a914df8561d7a1e9654708297f0908c1 09-Sep-2010 Ted Kremenek <kremenek@apple.com> Remove stray ';' and convert tabs to spaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113466 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
d6a65a9b6c31e721bf992e67f1ddc8e943c55227 09-Sep-2010 Ted Kremenek <kremenek@apple.com> Enhance -Wunreachable-code to not consider the 'default:' branch of a switch statement live if a switch on an enum value has
explicit 'case:' statements for each enum value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113451 91177308-0d34-0410-b5e6-96231b3b80d8
eachableCode.cpp
8caec849a765de7b0b4ae8b9769397ce62236321 09-Sep-2010 Ted Kremenek <kremenek@apple.com> Enhance -Wunreachable-code to not consider the 'default:' branch of a switch statement live if a switch on an enum value has
explicit 'case:' statements for each enum value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113451 91177308-0d34-0410-b5e6-96231b3b80d8
eachableCode.cpp
bc056ea8365d7d3f527ab9f8c26ca7c9d20a27b1 09-Sep-2010 Ted Kremenek <kremenek@apple.com> Add 'filtered_pred_iterator' and 'filtered_succ_iterator' to CFGBlock. This allows a client
to selectively walk successors/predecessors based on commonly used filters. For starters, add
a filter to ignore 'default:' cases for SwitchStmts when all enum values are covered by CaseStmts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113449 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ee7f84d509c6382491673883598eb9ed2d3a6a8b 09-Sep-2010 Ted Kremenek <kremenek@apple.com> Add 'filtered_pred_iterator' and 'filtered_succ_iterator' to CFGBlock. This allows a client
to selectively walk successors/predecessors based on commonly used filters. For starters, add
a filter to ignore 'default:' cases for SwitchStmts when all enum values are covered by CaseStmts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113449 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
4b626f5c71b64accacddcd3e106b48997e940365 06-Sep-2010 Zhongxing Xu <xuzhongxing@gmail.com> FinishBlock() is essentially doing nothing except returning '!badCFG'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113149 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
d438b3dbdcde4df4f61a99054104643e6aadf78b 06-Sep-2010 Zhongxing Xu <xuzhongxing@gmail.com> FinishBlock() is essentially doing nothing except returning '!badCFG'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113149 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
17e84b9d325f47eb3f99e00e749bef8db900f0ee 06-Sep-2010 Zhongxing Xu <xuzhongxing@gmail.com> Simplify CFG construction: bail out early when we have a bad CFG.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113148 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
1b3b7cb15cbd02b7283bbf3ce7c0e9b0da30ef9d 06-Sep-2010 Zhongxing Xu <xuzhongxing@gmail.com> Simplify CFG construction: bail out early when we have a bad CFG.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113148 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
12e3f890b96bbb747f196db51c7178716136ec8b 31-Aug-2010 Ted Kremenek <kremenek@apple.com> Improve CFG printing support for CXXOperatorCallExpr and CXXBindTemporaryExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112619 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
4e0cfa8eacf76f203d6ee6ce164162ccd4275ccd 31-Aug-2010 Ted Kremenek <kremenek@apple.com> Improve CFG printing support for CXXOperatorCallExpr and CXXBindTemporaryExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112619 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
cb796064800c9fba2472d897c20b98e812e2c2db 31-Aug-2010 Ted Kremenek <kremenek@apple.com> Explicitly handle CXXOperatorCallExpr when building CFGs. We should treat it the same as CallExprs.

Fixes: <rdar://problem/8375510> [Boost] CFGBuilder crash in Boost.Graph

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112618 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
a427f1d8f0848997029d1bdc0c5c137f982f775d 31-Aug-2010 Ted Kremenek <kremenek@apple.com> Explicitly handle CXXOperatorCallExpr when building CFGs. We should treat it the same as CallExprs.

Fixes: <rdar://problem/8375510> [Boost] CFGBuilder crash in Boost.Graph

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112618 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
325b94cd22e2158e451d3098e29f2d1ecc75b9cc 31-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Revert my lame attempt at appeasing the CFGBuilder

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112580 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
5722b148e886dd08ef7ee49f033ebe4fd21b1b5e 31-Aug-2010 Douglas Gregor <dgregor@apple.com> Revert my lame attempt at appeasing the CFGBuilder

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112580 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
376c483c4ecca4c110cbfc4ac4b0bee34e3b0fa2 31-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Teach the CFGBuilder not do die on CXXBindTemporaryExpr, CXXOperatorCallExpr. Fixes a Boost.Graph crasher.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112578 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
35fe7eeb1284ed786ed647b34fa01fc18646b3c7 31-Aug-2010 Douglas Gregor <dgregor@apple.com> Teach the CFGBuilder not do die on CXXBindTemporaryExpr, CXXOperatorCallExpr. Fixes a Boost.Graph crasher.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112578 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
e2608445c41ac2edc61de70bcee7624bced07732 28-Aug-2010 Ted Kremenek <kremenek@apple.com> Delete the relaxedLiveness object in the dtor of AnalysisContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112380 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
91c83e76d8ad42d1fd8e249b72a36d552997f77c 28-Aug-2010 Ted Kremenek <kremenek@apple.com> Delete the relaxedLiveness object in the dtor of AnalysisContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112380 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
7c7f0a5086cfc01a994369c2e1f798de6ef8d54b 28-Aug-2010 Ted Kremenek <kremenek@apple.com> Explicitly handle CXXExprWithTemporaries during CFG construction by just visiting the subexpression. While we don't do anything intelligent right now, this obviates a bogus -Wunreahable-code warning reported in PR 6130.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112334 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
47e331ed28c2536bec227c5e2fa094ab3d46eed1 28-Aug-2010 Ted Kremenek <kremenek@apple.com> Explicitly handle CXXExprWithTemporaries during CFG construction by just visiting the subexpression. While we don't do anything intelligent right now, this obviates a bogus -Wunreahable-code warning reported in PR 6130.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112334 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ae25559e95e45ec9b5ee58d4ebb76e1f5455b7ce 28-Aug-2010 Tom Care <tcare@apple.com> Add alternate version of LiveVariables analysis that does not kill liveness at assignments. This 'relaxed' liveness is useful in path sensitive analysis for situations where the resulting extended liveness allows us to find some bugs.
- Added killAtAssign flag to LiveVariables
- Added relaxed LiveVariables to AnalysisContext with an accessor

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112306 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
iveVariables.cpp
ec49bf464c91a52b3a463940da6589d03bf40248 28-Aug-2010 Tom Care <tom.care@uqconnect.edu.au> Add alternate version of LiveVariables analysis that does not kill liveness at assignments. This 'relaxed' liveness is useful in path sensitive analysis for situations where the resulting extended liveness allows us to find some bugs.
- Added killAtAssign flag to LiveVariables
- Added relaxed LiveVariables to AnalysisContext with an accessor

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112306 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
iveVariables.cpp
5398382962035530c817fe7359371f7a5147d34f 26-Aug-2010 Tom Care <tcare@apple.com> Add missing null checks in PseudoConstantAnalysis

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112100 91177308-0d34-0410-b5e6-96231b3b80d8
seudoConstantAnalysis.cpp
916d0541fa1723e3055d78f65dede844007989c3 26-Aug-2010 Tom Care <tom.care@uqconnect.edu.au> Add missing null checks in PseudoConstantAnalysis

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112100 91177308-0d34-0410-b5e6-96231b3b80d8
seudoConstantAnalysis.cpp
ed1384c6f884541eafc852f97deac5e81412b7e1 26-Aug-2010 Tom Care <tcare@apple.com> Improved the handling of blocks and block variables in PseudoConstantAnalysis
- Removed the assumption that __block vars are all non-constant
- Simplified some repetitive code in RunAnalysis
- Added block walking support
- Code/comments cleanup
- Separated out test for block pseudoconstants

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112098 91177308-0d34-0410-b5e6-96231b3b80d8
seudoConstantAnalysis.cpp
967fea6cd9ae60ea31d27d440967990d2c705729 26-Aug-2010 Tom Care <tom.care@uqconnect.edu.au> Improved the handling of blocks and block variables in PseudoConstantAnalysis
- Removed the assumption that __block vars are all non-constant
- Simplified some repetitive code in RunAnalysis
- Added block walking support
- Code/comments cleanup
- Separated out test for block pseudoconstants

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112098 91177308-0d34-0410-b5e6-96231b3b80d8
seudoConstantAnalysis.cpp
aeb70b12ab1af1ba7e5e48cee3903d1a768bca90 25-Aug-2010 John McCall <rjmccall@apple.com> GCC didn't care for my attempt at API compatibility, so brute-force everything
to the new constants.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112047 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
iveVariables.cpp
seudoConstantAnalysis.cpp
eachableCode.cpp
ninitializedValues.cpp
2de56d1d0c3a504ad1529de2677628bdfbb95cd4 25-Aug-2010 John McCall <rjmccall@apple.com> GCC didn't care for my attempt at API compatibility, so brute-force everything
to the new constants.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112047 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
iveVariables.cpp
seudoConstantAnalysis.cpp
eachableCode.cpp
ninitializedValues.cpp
2353bc83ebc42dd79c1ab563d487c237d845bf03 25-Aug-2010 Ted Kremenek <kremenek@apple.com> Fix printf format string checking for '%lc' (which expects a wint_t or compatible argument). Fixes PR 7981.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111978 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
9325eaf08fcccbc0d038e703f570c64daacdaa31 25-Aug-2010 Ted Kremenek <kremenek@apple.com> Fix printf format string checking for '%lc' (which expects a wint_t or compatible argument). Fixes PR 7981.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111978 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
42428f550b3d34c61a9549593eaaa063083ee4fd 24-Aug-2010 Tom Care <tcare@apple.com> Improvements to IdempotentOperationChecker and its use of PseudoConstantAnalysis
- Added wasReferenced function to PseudoConstantAnalysis to determine if a variable was ever referenced in a function (outside of a self-assignment)
- BlockDeclRefExpr referenced variables are now explicitly added to the non-constant list
- Remove unnecessary ignore of implicit casts
- Generalized parameter self-assign detection to detect deliberate self-assigns of variables to avoid unused variable warnings
- Updated test cases with deliberate self-assignments
- Fixed bug with C++ references and pseudoconstants
- Added test case for C++ references and pseudoconstants

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111965 91177308-0d34-0410-b5e6-96231b3b80d8
seudoConstantAnalysis.cpp
ef52bcb606c73950139a775af61495f63fbc3603 24-Aug-2010 Tom Care <tom.care@uqconnect.edu.au> Improvements to IdempotentOperationChecker and its use of PseudoConstantAnalysis
- Added wasReferenced function to PseudoConstantAnalysis to determine if a variable was ever referenced in a function (outside of a self-assignment)
- BlockDeclRefExpr referenced variables are now explicitly added to the non-constant list
- Remove unnecessary ignore of implicit casts
- Generalized parameter self-assign detection to detect deliberate self-assigns of variables to avoid unused variable warnings
- Updated test cases with deliberate self-assignments
- Fixed bug with C++ references and pseudoconstants
- Added test case for C++ references and pseudoconstants

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111965 91177308-0d34-0410-b5e6-96231b3b80d8
seudoConstantAnalysis.cpp
2c497ccd842431b6d143be0fefb45821ad1940a7 23-Aug-2010 Tom Care <tcare@apple.com> Several small changes to PseudoConstantAnalysis and the way IdempotentOperationChecker uses it.
- Psuedo -> Pseudo (doh...)
- C++ reference support
- Added pseudoconstant test case for __block vars
- Separated out static local checking from pseudoconstant analysis and generalized to non-local checking
- Added missing test cases for storage false positives

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111832 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
MakeLists.txt
seudoConstantAnalysis.cpp
suedoConstantAnalysis.cpp
db34ab70961ca4b24b600eb47053d7af304659f5 23-Aug-2010 Tom Care <tom.care@uqconnect.edu.au> Several small changes to PseudoConstantAnalysis and the way IdempotentOperationChecker uses it.
- Psuedo -> Pseudo (doh...)
- C++ reference support
- Added pseudoconstant test case for __block vars
- Separated out static local checking from pseudoconstant analysis and generalized to non-local checking
- Added missing test cases for storage false positives

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111832 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
MakeLists.txt
seudoConstantAnalysis.cpp
suedoConstantAnalysis.cpp
08f845b775c7be1a417b1b20b445d47b5c72a1bb 22-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Detabify.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111768 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
a7e6845660f91ec611427e1db842780e1ec12bdb 22-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Detabify.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111768 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
94123d2d6164c19fe11d639459a054455f2ee887 20-Aug-2010 Ying Wang <wangying@google.com> Fix sim build.

Note that this only makes the sim build green, but the built images won't work for sure:
No libbcc.so, which depends on something else that can not build in sim mode.
No x86 bitcode is generated as well, I believe.

Change-Id: Idca8378427196622ac77cd56a38c6a160f03ba22
ndroid.mk
6e81bc87f575f058305248882b6396db38814816 18-Aug-2010 Tom Care <tcare@apple.com> Added psuedo-constant analysis and integrated it into the false positive reduction stage in IdempotentOperationChecker.
- Renamed IdempotentOperationChecker::isConstant to isConstantOrPseudoConstant to better reflect the function
- Changed IdempotentOperationChecker::PreVisitBinaryOperator to only run 'CanVary' once on undefined assumptions
- Created new PsuedoConstantAnalysis class and added it to AnalysisContext
- Changed IdempotentOperationChecker to exploit the new analysis
- Updated tests with psuedo-constants
- Added check to IdempotentOperationChecker to see if a Decl is const qualified

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111426 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
MakeLists.txt
suedoConstantAnalysis.cpp
245adabd97c8c770c13935a9075f2243cc6f1d57 18-Aug-2010 Tom Care <tom.care@uqconnect.edu.au> Added psuedo-constant analysis and integrated it into the false positive reduction stage in IdempotentOperationChecker.
- Renamed IdempotentOperationChecker::isConstant to isConstantOrPseudoConstant to better reflect the function
- Changed IdempotentOperationChecker::PreVisitBinaryOperator to only run 'CanVary' once on undefined assumptions
- Created new PsuedoConstantAnalysis class and added it to AnalysisContext
- Changed IdempotentOperationChecker to exploit the new analysis
- Updated tests with psuedo-constants
- Added check to IdempotentOperationChecker to see if a Decl is const qualified

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111426 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
MakeLists.txt
suedoConstantAnalysis.cpp
e225581c66316885a4e983802be6bc483c89a59f 17-Aug-2010 Ted Kremenek <kremenek@apple.com> Fix horrible CFG bug caused by a series of NullStmts appearing at the beginning of a do...while loop. This would cause
the body of the DoStmt to be disconnected from the preceding code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111283 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
334c19566104d3333cf662f0017088a18eddfa81 17-Aug-2010 Ted Kremenek <kremenek@apple.com> Fix horrible CFG bug caused by a series of NullStmts appearing at the beginning of a do...while loop. This would cause
the body of the DoStmt to be disconnected from the preceding code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111283 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
297eccb18bf36b9e8690ee0cc58e9855c13e8cc2 17-Aug-2010 Ted Kremenek <kremenek@apple.com> CFGBuilder: don't create the empty "loop back" block for DoStmts if the loop edge can never be taken.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111282 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
d173dc7825e999edab836f8215a82a96eae7c738 17-Aug-2010 Ted Kremenek <kremenek@apple.com> CFGBuilder: don't create the empty "loop back" block for DoStmts if the loop edge can never be taken.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111282 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
d3c20f9917a68374409dfd798c5eaa24a901fa96 12-Aug-2010 Tom Care <tcare@apple.com> Fix a bug where child statements could not be identified as being in a CFGBlock in CFGStmtMap::getBlock.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110881 91177308-0d34-0410-b5e6-96231b3b80d8
FGStmtMap.cpp
b5049d83fd83bd0dc8b19e94b5c05f38ea64d7ce 12-Aug-2010 Tom Care <tcare@apple.com> Fix a bug where child statements could not be identified as being in a CFGBlock in CFGStmtMap::getBlock.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110881 91177308-0d34-0410-b5e6-96231b3b80d8
FGStmtMap.cpp
27b1b352459551788cfd157386a9c5781cd5ae1c 05-Aug-2010 Ted Kremenek <kremenek@apple.com> Remove bonehead redeclaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110288 91177308-0d34-0410-b5e6-96231b3b80d8
FGStmtMap.cpp
eea0d9361de0c400a58bd7c1f23e3edee7b028d9 05-Aug-2010 Ted Kremenek <kremenek@apple.com> Remove bonehead redeclaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110288 91177308-0d34-0410-b5e6-96231b3b80d8
FGStmtMap.cpp
556788e816cdb1e5dcf0f0e40c70a95003b2ecf5 05-Aug-2010 Ted Kremenek <kremenek@apple.com> Fix CFGBuilder to not blow out the stack when processing deeply nested CaseStmts. Fixes <rdar://problem/8268753>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110286 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
0fc67e2d619088945ac71e9d2590d5158650885d 05-Aug-2010 Ted Kremenek <kremenek@apple.com> Fix CFGBuilder to not blow out the stack when processing deeply nested CaseStmts. Fixes <rdar://problem/8268753>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110286 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
66c1eaa34103a89e127f5759755cab0c1937ce35 04-Aug-2010 Ted Kremenek <kremenek@apple.com> Add CFGStmtMap, which defines a mapping from Stmt* to CFGBlock*. The immediate intended use is in the unreachable code analysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110230 91177308-0d34-0410-b5e6-96231b3b80d8
FGStmtMap.cpp
MakeLists.txt
a6d69302d7c86b1c71b9c18493bb811f7d152075 04-Aug-2010 Ted Kremenek <kremenek@apple.com> Add CFGStmtMap, which defines a mapping from Stmt* to CFGBlock*. The immediate intended use is in the unreachable code analysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110230 91177308-0d34-0410-b5e6-96231b3b80d8
FGStmtMap.cpp
MakeLists.txt
cf96172b257a1c4ed57cc7d0c03dd5c247413214 03-Aug-2010 Ted Kremenek <kremenek@apple.com> Add -cc1 option '-unoptimized-cfg' to toggle using a CFG (for static analysis) that doesn't prune CFG edges.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110087 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
9b823e8e1ccb8a2cb49923bad22a80ca96f41f92 03-Aug-2010 Ted Kremenek <kremenek@apple.com> Add -cc1 option '-unoptimized-cfg' to toggle using a CFG (for static analysis) that doesn't prune CFG edges.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110087 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
1a433044ac870a2d9fc6d8d6979276a59be702cb 03-Aug-2010 Ted Kremenek <kremenek@apple.com> Add 'AnalysisContext::getUnoptimizedCFG()' to allow clients to get access to the original
CFG without any edges pruned out because of trivially solvable conditions (e.g., 'if (0)').

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110085 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
FG.cpp
ad5a894df1841698c824381b414630799adc26ca 03-Aug-2010 Ted Kremenek <kremenek@apple.com> Add 'AnalysisContext::getUnoptimizedCFG()' to allow clients to get access to the original
CFG without any edges pruned out because of trivially solvable conditions (e.g., 'if (0)').

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110085 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
FG.cpp
017b4f655ede9fe69febc14fae4353f746ecb0cb 27-Jul-2010 Michael J. Spencer <bigcheesegs@gmail.com> Revert r109428 "Hoist argument type checking into CheckFormatHandler. This is prep for scanf format"

Got errors about ASTContext being undefined with Visual Studio 2010.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109491 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
canfFormatString.cpp
96827eb52405a71c65c200949f3e644368e86454 27-Jul-2010 Michael J. Spencer <bigcheesegs@gmail.com> Revert r109428 "Hoist argument type checking into CheckFormatHandler. This is prep for scanf format"

Got errors about ASTContext being undefined with Visual Studio 2010.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109491 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
canfFormatString.cpp
c0dd65e0f3e986a09729455447f3ef6d40bf3256 26-Jul-2010 Dan Gohman <gohman@apple.com> Fix namespace polution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109440 91177308-0d34-0410-b5e6-96231b3b80d8
ormatStringParsing.h
canfFormatString.cpp
3c46e8db99196179b30e7ac5c20c4efd5f3926d7 26-Jul-2010 Dan Gohman <gohman@apple.com> Fix namespace polution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109440 91177308-0d34-0410-b5e6-96231b3b80d8
ormatStringParsing.h
canfFormatString.cpp
5c5576bc9d26fc929291975b93761cfe978b31f1 26-Jul-2010 Ted Kremenek <kremenek@apple.com> Hoist argument type checking into CheckFormatHandler. This is prep for scanf format
string argument type checking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109428 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
canfFormatString.cpp
f762905bdefad77f91c7c6782a9c17e6b274d393 26-Jul-2010 Ted Kremenek <kremenek@apple.com> Hoist argument type checking into CheckFormatHandler. This is prep for scanf format
string argument type checking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109428 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
canfFormatString.cpp
d939d138f427a814bd102e1383429e19795d1cc9 22-Jul-2010 Zhongxing Xu <xuzhongxing@gmail.com> Make a bunch of new data structures for the new analysis
engine of the new translation unit. State marshal is there but no real
work is done. End nodes are passed back.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109105 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
2ce43c8f43254a9edea53a20dc0e69195bc82ae0 22-Jul-2010 Zhongxing Xu <xuzhongxing@gmail.com> Make a bunch of new data structures for the new analysis
engine of the new translation unit. State marshal is there but no real
work is done. End nodes are passed back.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109105 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
379712602da8d13e31c836f3c8df36a9f629e424 20-Jul-2010 Ted Kremenek <kremenek@apple.com> Hookup checking for invalid length modifiers in scanf format strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108907 91177308-0d34-0410-b5e6-96231b3b80d8
canfFormatString.cpp
1e51c200b17cb6b0238c10a8760ae04765688f16 20-Jul-2010 Ted Kremenek <kremenek@apple.com> Hookup checking for invalid length modifiers in scanf format strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108907 91177308-0d34-0410-b5e6-96231b3b80d8
canfFormatString.cpp
519fdb3b0eaca62058326f846d2e61be89c7dc67 20-Jul-2010 Ted Kremenek <kremenek@apple.com> Move 'hasValidLengthModifier' from PrintfFormatSpecifier to FormatSpecifier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108906 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
a412a499162c46211c10ad92045b9b5fd2298ede 20-Jul-2010 Ted Kremenek <kremenek@apple.com> Move 'hasValidLengthModifier' from PrintfFormatSpecifier to FormatSpecifier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108906 91177308-0d34-0410-b5e6-96231b3b80d8
ormatString.cpp
rintfFormatString.cpp
07feed3d58d48faff92630cf8f8eeed1e37700b3 20-Jul-2010 Ted Kremenek <kremenek@apple.com> Cleanup whitespace in switch statement. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108905 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
7fdba13847f01cfcdc7c9261b13e99e3cbecb5fc 20-Jul-2010 Ted Kremenek <kremenek@apple.com> Cleanup whitespace in switch statement. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108905 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
f00ee7a76eb78ada4a0654e029f750c2baf5475b 20-Jul-2010 Ted Kremenek <kremenek@apple.com> Add 'ConversionSpecifier' root class in 'analyze_format_string' namespace and
derived 'PrintfConversionSpecifier' from this class. We will do the same for
'ScanfConversionSpecifier'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108903 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
canfFormatString.cpp
6ecb950c65329f8d6ce9ad0514632df35a5ab61f 20-Jul-2010 Ted Kremenek <kremenek@apple.com> Add 'ConversionSpecifier' root class in 'analyze_format_string' namespace and
derived 'PrintfConversionSpecifier' from this class. We will do the same for
'ScanfConversionSpecifier'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108903 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
canfFormatString.cpp
241ab84357731064d6e05b7f4354d3daa6895b5f 20-Jul-2010 Ted Kremenek <kremenek@apple.com> Rename 'UnicodeStrArg' to 'SArg'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108901 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
de183a48dd8fcff5e0343e84c8a6b563088447ce 20-Jul-2010 Ted Kremenek <kremenek@apple.com> Rename 'UnicodeStrArg' to 'SArg'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108901 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
2723632e84df3e0fb87ef1bac6b2a7473198d3a2 20-Jul-2010 Ted Kremenek <kremenek@apple.com> Rename 'ConsumedSoFarArg' -> 'nArg' and 'OutIntPtrArg' to 'nArg' (scanf and printf checking).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108900 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
canfFormatString.cpp
35d353b47bce29200b910371dd9b8ba7f3058ab8 20-Jul-2010 Ted Kremenek <kremenek@apple.com> Rename 'ConsumedSoFarArg' -> 'nArg' and 'OutIntPtrArg' to 'nArg' (scanf and printf checking).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108900 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
canfFormatString.cpp
4cdb4a77223d5c955a0e654040748b365d35da34 20-Jul-2010 Ted Kremenek <kremenek@apple.com> Rename 'VoidPtrArg' to 'pArg' in printf/scanf checking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108899 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
66932056da99d2441e27c10b27c82706671e1dbf 20-Jul-2010 Ted Kremenek <kremenek@apple.com> Rename 'VoidPtrArg' to 'pArg' in printf/scanf checking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108899 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
c57babfe0db30eae833eeaf134596834c692c55a 20-Jul-2010 Ted Kremenek <kremenek@apple.com> Rename 'CStrArg' to 'sArg' for printf checking to match with the analagous enum for scanf checking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108898 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
99196b1031d37d37f395a3291ccdd12a3fc01242 20-Jul-2010 Ted Kremenek <kremenek@apple.com> Rename 'CStrArg' to 'sArg' for printf checking to match with the analagous enum for scanf checking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108898 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
d913dcc0b884633d7c0a205e6c7eeb633dc9d2fc 20-Jul-2010 Ted Kremenek <kremenek@apple.com> Rename analyze_printf::ConversionSpecifier::IntAsCharArg to 'cArg' to match
analagous enum in analyze_scanf. This is prep for refactoring the logic for handling
ConversionSpecifiers for both scanf and printf.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108897 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
92a6febe130dd9ad726983835297e11b2fa3b93f 20-Jul-2010 Ted Kremenek <kremenek@apple.com> Rename analyze_printf::ConversionSpecifier::IntAsCharArg to 'cArg' to match
analagous enum in analyze_scanf. This is prep for refactoring the logic for handling
ConversionSpecifiers for both scanf and printf.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108897 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
61c1e30ef2a94c86e6dc73e8f51598f362adafa7 19-Jul-2010 Ted Kremenek <kremenek@apple.com> Add missing conversion specifier parsing for 'u', 'x', 'o', and 's'. Fixes <rdar://problem/8204052>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108742 91177308-0d34-0410-b5e6-96231b3b80d8
canfFormatString.cpp
be86ecc82772546d9e404a32002e446ac0c725d9 19-Jul-2010 Ted Kremenek <kremenek@apple.com> Add missing conversion specifier parsing for 'u', 'x', 'o', and 's'. Fixes <rdar://problem/8204052>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108742 91177308-0d34-0410-b5e6-96231b3b80d8
canfFormatString.cpp
659445f0024e1aa1967a042a493e14da3ef31fd0 19-Jul-2010 Zhongxing Xu <xuzhongxing@gmail.com> Reapply r108617.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108668 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
c6238d2786cfd961b94580b3d3675a1b3ff0721c 19-Jul-2010 Zhongxing Xu <xuzhongxing@gmail.com> Reapply r108617.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108668 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
ef006823ecd2344aa0b47065d6d2b2bcbe95a853 18-Jul-2010 Chris Lattner <sabre@nondot.org> BUILD_ARCHIVE is the default for libraries, no need to set it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108633 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
9638eef7e3b2ca30406c5d369a44aa49ff26b201 18-Jul-2010 Chris Lattner <sabre@nondot.org> BUILD_ARCHIVE is the default for libraries, no need to set it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108633 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
388ee29bc6adf36fc7ee5ca14061aa482e896d29 17-Jul-2010 Benjamin Kramer <benny.kra@googlemail.com> Revert r108617, it broke the build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108621 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
ee30965ce96e0a7b04b1aa16df60e9ba8b0a33c9 17-Jul-2010 Benjamin Kramer <benny.kra@googlemail.com> Revert r108617, it broke the build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108621 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
924234001ccf7b7d50f80519301596935c74aaaf 17-Jul-2010 Zhongxing Xu <xuzhongxing@gmail.com> Prepare the analyzer for the callee in another translation unit:
Let AnalysisContext contain a TranslationUnit.
Let CallEnter refer to an AnalysisContext instead of a FunctionDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108617 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
69b81941aa4211ba6b8eaa89093f9e45aff81392 17-Jul-2010 Zhongxing Xu <xuzhongxing@gmail.com> Prepare the analyzer for the callee in another translation unit:
Let AnalysisContext contain a TranslationUnit.
Let CallEnter refer to an AnalysisContext instead of a FunctionDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108617 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
71b86be7f07080a3f6acd8e08647813bde2d2a3b 16-Jul-2010 Ted Kremenek <kremenek@apple.com> Hook up warning for an incomplete scanlist in scanf format strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108542 91177308-0d34-0410-b5e6-96231b3b80d8
canfFormatString.cpp
b7c21018ec1049580cf6df88db09e606550a7baa 16-Jul-2010 Ted Kremenek <kremenek@apple.com> Hook up warning for an incomplete scanlist in scanf format strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108542 91177308-0d34-0410-b5e6-96231b3b80d8
canfFormatString.cpp
4e30741b418226c0f5d725046843e516f3ce096a 16-Jul-2010 Ted Kremenek <kremenek@apple.com> Add the main scanf-parsing logic that I meant to include in my previous commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108502 91177308-0d34-0410-b5e6-96231b3b80d8
canfFormatString.cpp
d9c904de74afb6c6bc0e38030c4037ba64b04c0a 16-Jul-2010 Ted Kremenek <kremenek@apple.com> Add the main scanf-parsing logic that I meant to include in my previous commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108502 91177308-0d34-0410-b5e6-96231b3b80d8
canfFormatString.cpp
ea6cd7fae1540d4d6d1bb80c5c2f1164bc9ee017 16-Jul-2010 Ted Kremenek <kremenek@apple.com> Add missing header file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108501 91177308-0d34-0410-b5e6-96231b3b80d8
ormatStringParsing.h
d20b24c4c35c7bd0135705add9cd3526e3b2c8cb 16-Jul-2010 Ted Kremenek <kremenek@apple.com> Add missing header file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108501 91177308-0d34-0410-b5e6-96231b3b80d8
ormatStringParsing.h
ffd394a182427b2727f0a4002da939e629e12006 16-Jul-2010 Ted Kremenek <kremenek@apple.com> Add most of the boilerplate support for scanf format string checking. This includes
handling the parsing of scanf format strings and hooking the checking into Sema.
Most of this checking logic piggybacks on what was already there for checking printf format
strings, but the checking logic has been refactored to support both.

What is left to be done is to support argument type checking in format strings and of course
fix the usual tail of bugs that will follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108500 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ormatString.cpp
rintfFormatString.cpp
826a3457f737f1fc45a22954fd1bfde38160c165 16-Jul-2010 Ted Kremenek <kremenek@apple.com> Add most of the boilerplate support for scanf format string checking. This includes
handling the parsing of scanf format strings and hooking the checking into Sema.
Most of this checking logic piggybacks on what was already there for checking printf format
strings, but the checking logic has been refactored to support both.

What is left to be done is to support argument type checking in format strings and of course
fix the usual tail of bugs that will follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108500 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ormatString.cpp
rintfFormatString.cpp
e4a621552c52b7733af4b8c684abc54769ff0ec6 23-Jun-2010 Douglas Gregor <doug.gregor@gmail.com> Type Type::isRealFloatingType() that vectors are not floating-point
types, updating callers of both isFloatingType() and
isRealFloatingType() accordingly. Caught at least one issue where we
allowed one to declare a vector of vectors (!), along with cleaning up
the standard-conversion logic for C++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106595 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
0c293ea13d452c1a47a05ada5a5ee9acc69c66cc 23-Jun-2010 Douglas Gregor <dgregor@apple.com> Type Type::isRealFloatingType() that vectors are not floating-point
types, updating callers of both isFloatingType() and
isRealFloatingType() accordingly. Caught at least one issue where we
allowed one to declare a vector of vectors (!), along with cleaning up
the standard-conversion logic for C++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106595 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
2be7e0dc9029352174ae6aa1eccf773e034d40bc 18-Jun-2010 Tom Care <tcare@apple.com> Printf format strings: Added some more tests and fixed some minor bugs.
- Precision toStrings shouldn't print a dot when they have no value.
- Length of char length modifier is now returned correctly.
- Added several fixit tests.

Note: fixit tests are currently broken due to a bug in HighlightRange. Marking as XFAIL for now.

M test/Sema/format-strings-fixit.c
M include/clang/Analysis/Analyses/PrintfFormatString.h
M lib/Analysis/PrintfFormatString.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106275 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
4c6021995032a898fb0502d5d1fd2df37638e57b 18-Jun-2010 Tom Care <tcare@apple.com> Printf format strings: Added some more tests and fixed some minor bugs.
- Precision toStrings shouldn't print a dot when they have no value.
- Length of char length modifier is now returned correctly.
- Added several fixit tests.

Note: fixit tests are currently broken due to a bug in HighlightRange. Marking as XFAIL for now.

M test/Sema/format-strings-fixit.c
M include/clang/Analysis/Analyses/PrintfFormatString.h
M lib/Analysis/PrintfFormatString.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106275 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
aa20f645e13e6eb8c3854a2d19421f2cc36e2ec0 18-Jun-2010 Tom Care <tcare@apple.com> Bug 7394 - Fixed toString representation of Precisions in format strings.

M include/clang/Analysis/Analyses/PrintfFormatString.h
M lib/Analysis/PrintfFormatString.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106245 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
f521d6e151e0cf443bb767c6a83c06ea411530f8 18-Jun-2010 Tom Care <tcare@apple.com> Bug 7394 - Fixed toString representation of Precisions in format strings.

M include/clang/Analysis/Analyses/PrintfFormatString.h
M lib/Analysis/PrintfFormatString.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106245 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
cc9aa159c15c524f4a5fc73ac90e02a8578e9d29 17-Jun-2010 Tom Care <tcare@apple.com> Bug 7377: Fixed several bad printf format string bugs.
- Added warning for undefined behavior when using field specifier
- Added warning for undefined behavior when using length modifier
- Fixed warnings for invalid flags
- Added warning for ignored flags
- Added fixits for the above warnings
- Fixed accuracy of detecting several undefined behavior conditions
- Receive normal warnings in addition to security warnings when using %n
- Fix bug where '+' flag would remain on unsigned conversion suggestions

Summary of changes:
- Added expanded tests
- Added/expanded warnings
- Added position info to OptionalAmounts for fixits
- Extracted optional flags to a wrapper class with position info for fixits
- Added several methods to validate a FormatSpecifier by component, each checking for undefined behavior
- Fixed conversion specifier checking to conform to C99 standard
- Added hooks to detect the invalid states in CheckPrintfHandler::HandleFormatSpecifier

Note: warnings involving the ' ' (space) flag are temporarily disabled until whitespace highlighting no longer triggers assertions. I will make a post about this on cfe-dev shortly.

M test/Sema/format-strings.c
M include/clang/Basic/DiagnosticSemaKinds.td
M include/clang/Analysis/Analyses/PrintfFormatString.h
M lib/Analysis/PrintfFormatString.cpp
M lib/Sema/SemaChecking.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106233 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
e4ee9663168dfb2b4122c768091e30217328c9fa 17-Jun-2010 Tom Care <tcare@apple.com> Bug 7377: Fixed several bad printf format string bugs.
- Added warning for undefined behavior when using field specifier
- Added warning for undefined behavior when using length modifier
- Fixed warnings for invalid flags
- Added warning for ignored flags
- Added fixits for the above warnings
- Fixed accuracy of detecting several undefined behavior conditions
- Receive normal warnings in addition to security warnings when using %n
- Fix bug where '+' flag would remain on unsigned conversion suggestions

Summary of changes:
- Added expanded tests
- Added/expanded warnings
- Added position info to OptionalAmounts for fixits
- Extracted optional flags to a wrapper class with position info for fixits
- Added several methods to validate a FormatSpecifier by component, each checking for undefined behavior
- Fixed conversion specifier checking to conform to C99 standard
- Added hooks to detect the invalid states in CheckPrintfHandler::HandleFormatSpecifier

Note: warnings involving the ' ' (space) flag are temporarily disabled until whitespace highlighting no longer triggers assertions. I will make a post about this on cfe-dev shortly.

M test/Sema/format-strings.c
M include/clang/Basic/DiagnosticSemaKinds.td
M include/clang/Analysis/Analyses/PrintfFormatString.h
M lib/Analysis/PrintfFormatString.cpp
M lib/Sema/SemaChecking.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106233 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
00f90b974369ccd699c3d29e4edef8526d78083c 17-Jun-2010 Sean Hunt <rideau3@gmail.com> Update CMake build for new attribute changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106188 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ee6e4b4baa1acd85ba8b142862ac5986621aaffd 17-Jun-2010 Sean Hunt <rideau3@gmail.com> Update CMake build for new attribute changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106188 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
36be1a672ff7f0d7c8e4ab725e9e084ab52b048a 16-Jun-2010 Ted Kremenek <kremenek@apple.com> Extend format string type-checking to include '%p'. Fixes remaining cases PR 4468.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106151 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
13927a431dd733336cfd664bf0840747a71b0a43 16-Jun-2010 Ted Kremenek <kremenek@apple.com> Extend format string type-checking to include '%p'. Fixes remaining cases PR 4468.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106151 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
cce6ffdab07145e53ac227c9d21523b210cffcbe 11-Jun-2010 Tom Care <tcare@apple.com> Small fixes regarding printf fix suggestions.
- Added some handling of flags that become invalid when changing the conversion specifier.
- Changed fixit behavior to remove unnecessary length modifiers.
- Separated some tests out and added some comments.

modified:
lib/Analysis/PrintfFormatString.cpp
test/Sema/format-strings-fixit.c


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105807 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
876e994957472eda4b40136d4e1d6e08e2be338f 11-Jun-2010 Tom Care <tcare@apple.com> Small fixes regarding printf fix suggestions.
- Added some handling of flags that become invalid when changing the conversion specifier.
- Changed fixit behavior to remove unnecessary length modifiers.
- Separated some tests out and added some comments.

modified:
lib/Analysis/PrintfFormatString.cpp
test/Sema/format-strings-fixit.c


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105807 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
bb50b9b1930d42742d02f8aff555550c9b1f2c15 09-Jun-2010 Douglas Gregor <doug.gregor@gmail.com> Fix a typo that breaks the GCC build. Turns out that Clang isn't
diagnosing this code as an error when it should, so I've filed
http://llvm.org/bugs/show_bug.cgi?id=7325.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105683 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
c8c4b4088cf0b3afeda425b25fa7c77d3873b12c 09-Jun-2010 Douglas Gregor <dgregor@apple.com> Fix a typo that breaks the GCC build. Turns out that Clang isn't
diagnosing this code as an error when it should, so I've filed
http://llvm.org/bugs/show_bug.cgi?id=7325.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105683 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
c040236caae574e37816ac38f8b48b8fbeab0d41 09-Jun-2010 Tom Care <tcare@apple.com> Added FixIt support to printf format string checking.
- Refactored LengthModifier to be a class.
- Added toString methods in all member classes of FormatSpecifier.
- FixIt suggestions keep user specified flags unless incorrect.

Limitations:
- The suggestions are not conversion specifier sensitive. For example, if we have a 'pad with zeroes' flag, and the correction is a string conversion specifier, we do not remove the flag. Clang will warn us on the next compilation.

A test/Sema/format-strings-fixit.c
M include/clang/Analysis/Analyses/PrintfFormatString.h
M lib/Analysis/PrintfFormatString.cpp
M lib/Sema/SemaChecking.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105680 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
3bfc5f49e0e37e235bb0d33bcbcb36af9d1f84ab 09-Jun-2010 Tom Care <tcare@apple.com> Added FixIt support to printf format string checking.
- Refactored LengthModifier to be a class.
- Added toString methods in all member classes of FormatSpecifier.
- FixIt suggestions keep user specified flags unless incorrect.

Limitations:
- The suggestions are not conversion specifier sensitive. For example, if we have a 'pad with zeroes' flag, and the correction is a string conversion specifier, we do not remove the flag. Clang will warn us on the next compilation.

A test/Sema/format-strings-fixit.c
M include/clang/Analysis/Analyses/PrintfFormatString.h
M lib/Analysis/PrintfFormatString.cpp
M lib/Sema/SemaChecking.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105680 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
ed5bf62969af84e508b62c0a9b19756bbfb2ce38 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Makefiles: Set Clang CPP compiler flags in a single location, instead of scattered throughout the project Makefiles.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105638 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
c4dec1c58eeb2ef46cdb64120eb6b819c6927afb 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Makefiles: Set Clang CPP compiler flags in a single location, instead of scattered throughout the project Makefiles.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105638 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
e55e5e35d511ea62e635374aeca1c09ba7ce6d88 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Makefile: Switch Clang Makefiles to always include the top-level Clang Makefile.
- This eliminates most dependencies on how Clang is installed relative to LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105637 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
afed099bd2e759efd4bb63fdc525d3445f94cc13 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Makefile: Switch Clang Makefiles to always include the top-level Clang Makefile.
- This eliminates most dependencies on how Clang is installed relative to LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105637 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
c8bfd0f8bb22ea019c673898bbdb07a834f0d821 08-Jun-2010 Shih-wei Liao <sliao@google.com> Git hiccup. Retry....

Change-Id: I5a329137a43f36bab32ea62386ade11da550c0b0
ndroid.mk
200213f20fef82c10b7da00873c99b93cee6da63 08-Jun-2010 Shih-wei Liao <sliao@google.com> Fix llvm.mk and the other 49 mk files

Change-Id: I5aa02363c1083297d163a575f5a35c495f950230
ndroid.mk
ea285162342df160e7860e26528bc7110bc6c0cd 04-Jun-2010 Shih-wei Liao <sliao@google.com> Initial slang.

Change-Id: I4f84a741e5fbc440cd4c251406d2b611a237f713
nalysisContext.cpp
ndroid.mk
FG.cpp
MakeLists.txt
iveVariables.cpp
akefile
rintfFormatString.cpp
eachableCode.cpp
ninitializedValues.cpp
e68ce471f63742ef6d0581fcc439563f5c404d85 04-Jun-2010 Jordy Rose <jediknil@belkadan.com> Assignments to reference variables shouldn't kill the variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105452 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
5d55376106f1aeabfab0bcd7e0167db904409a06 04-Jun-2010 Jordy Rose <jediknil@belkadan.com> Assignments to reference variables shouldn't kill the variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105452 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
154df70abaf264fd972c0a6679bf37867058437a 03-Jun-2010 Zhongxing Xu <xuzhongxing@gmail.com> Make addStmt always add stmt. Delegate other cases to Visit() directly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105384 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
df119892cf291847d6aebb117512225a8e67c0d5 03-Jun-2010 Zhongxing Xu <xuzhongxing@gmail.com> Make addStmt always add stmt. Delegate other cases to Visit() directly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105384 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
82466d9e1914a4d897463045a175c7d5aa12b269 03-Jun-2010 Zhongxing Xu <xuzhongxing@gmail.com> CFG: add all LHS of assingments as lvalue. This improves support for C++ reference. Patch by Jordy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105383 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
fc61d94fbdbcd2b423976e21f24d423fcd442486 03-Jun-2010 Zhongxing Xu <xuzhongxing@gmail.com> CFG: add all LHS of assingments as lvalue. This improves support for C++ reference. Patch by Jordy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105383 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
b7be965ff561d784a5de8d794b56a442085c8760 30-May-2010 Sean Hunt <rideau3@gmail.com> Convert DeclNodes to use TableGen.

The macros required for DeclNodes use have changed to match the use of
StmtNodes. The FooFirst enumerator constants have been named firstFoo
to match usage elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105165 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
9a55591af3e5506b95a9718e15380129fbfc5ebc 30-May-2010 Sean Hunt <rideau3@gmail.com> Convert DeclNodes to use TableGen.

The macros required for DeclNodes use have changed to match the use of
StmtNodes. The FooFirst enumerator constants have been named firstFoo
to match usage elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105165 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
006f67f505020b39f85740006425c16b0a6c91d8 21-May-2010 Ted Kremenek <kremenek@apple.com> Fix crash in CFG construction for 'break' statements appearing in statement expressions
within the increment code of a for loop.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104375 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
3f64a0e3be2c9408f8256bd3aa9f0ce9e268982c 21-May-2010 Ted Kremenek <kremenek@apple.com> Fix crash in CFG construction for 'break' statements appearing in statement expressions
within the increment code of a for loop.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104375 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
6f3bb9626d55a2649f7dd1c472589832eb04599e 13-May-2010 Ted Kremenek <kremenek@apple.com> Don't add a null successor to a CFGBlock when the contents of an @synchronized statement is empty.
Fixes <rdar://problem/7979430>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103717 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
fadebbafe622752c3c6565b53ce8cd42bbbbd90c 13-May-2010 Ted Kremenek <kremenek@apple.com> Don't add a null successor to a CFGBlock when the contents of an @synchronized statement is empty.
Fixes <rdar://problem/7979430>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103717 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
468e42e9ca5531889f8f1aa4fa467d277c701638 05-May-2010 Douglas Gregor <doug.gregor@gmail.com> Unbreak CMake build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103077 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
71b1d0e5f07de274af2b3c48955af66b1b7f0403 05-May-2010 Douglas Gregor <dgregor@apple.com> Unbreak CMake build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103077 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
3a9e9cc5306002c737c5136b199f04985e12028c 01-May-2010 Ted Kremenek <kremenek@apple.com> Add null check in CFGBuilder::VisitStmt() to make CFG construction
more resilient to bad code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102793 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
f42e3371079de333c3822a060c008bf6680677c8 01-May-2010 Ted Kremenek <kremenek@apple.com> Add null check in CFGBuilder::VisitStmt() to make CFG construction
more resilient to bad code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102793 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
6e11e561213209516279809be06409255954cd26 29-Apr-2010 Ted Kremenek <kremenek@apple.com> Fix CFG crasher involving statement expressions reported in PR 6938.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102576 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
862b24f8e9b1a3b332399591e48b303f57f01d0a 29-Apr-2010 Ted Kremenek <kremenek@apple.com> Fix CFG crasher involving statement expressions reported in PR 6938.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102576 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
b660e007b647a4107659f05e3e7afc63833cdd14 14-Apr-2010 Zhongxing Xu <xuzhongxing@gmail.com> Use direct assignment instead of user defined conversion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101236 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
21f6d6ea71b89aeae6b9262c8cbdff7f6328e749 14-Apr-2010 Zhongxing Xu <xuzhongxing@gmail.com> Use direct assignment instead of user defined conversion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101236 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
93f43aaa739a0c1480197f4d12531b7887719aea 13-Apr-2010 Zhongxing Xu <xuzhongxing@gmail.com> CFGBuilder: always add C++ member call expr as block-level expr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101127 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
c5354a2ecd9fdd7f2c0eb784f7932fb5126e2a01 13-Apr-2010 Zhongxing Xu <xuzhongxing@gmail.com> CFGBuilder: always add C++ member call expr as block-level expr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101127 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
c8cc79dc43fdf92c099deb0603499a16f84f0dc4 11-Apr-2010 Ted Kremenek <kremenek@apple.com> Fix CFG bug where bases of member expressions were not always evaluated in a lvalue context. Fixes <rdar://problem/7813989>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100966 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
115c1b9cc758d15f38e1d2ad4cf07b1cacfb3115 11-Apr-2010 Ted Kremenek <kremenek@apple.com> Fix CFG bug where bases of member expressions were not always evaluated in a lvalue context. Fixes <rdar://problem/7813989>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100966 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
3642950824ae5cea571825ebf2612576741b9491 11-Apr-2010 Ted Kremenek <kremenek@apple.com> Fix bug in AddStmtChoice:asLValue() where 'AsLValueNotAlwaysAdd' would not be treated as indicating an lvalue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100965 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
431ac2d9c2f7596af6187daf88be411cb1ea34cf 11-Apr-2010 Ted Kremenek <kremenek@apple.com> Fix bug in AddStmtChoice:asLValue() where 'AsLValueNotAlwaysAdd' would not be treated as indicating an lvalue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100965 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
d74d69cd5ea01ea77dbee45903d589243d1625d2 11-Apr-2010 Ted Kremenek <kremenek@apple.com> Sort visitor methods. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100964 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
7ea2136685403045f91b3a8b83e34c51ac0e082e 11-Apr-2010 Ted Kremenek <kremenek@apple.com> Sort visitor methods. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100964 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
e6c39d3a3e77c17bb9aa97be6e2e1ae2dbd654db 07-Apr-2010 Shih-wei Liao <sliao@google.com> libbcc

Change-Id: Ieaa3ebd5a38f370752495549f8870b534eeedfc5
nalysisContext.cpp
FG.cpp
MakeLists.txt
iveVariables.cpp
akefile
rintfFormatString.cpp
ninitializedValues.cpp
433d7d2c70b9be3f9edd40579f512ecab8755049 30-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99920 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
264ba48dc98f3f843935a485d5b086f7e0fdc4f1 30-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99920 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
fdee3fd78798a34a1b2215f48199196c1fb0ad3a 29-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> 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 .



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99805 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
802c66edc5073991f2315ea84ecace1867c6027f 29-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> 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 .



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99805 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
0d20606bd2b637b8fb233520482c0d9d823ddca8 25-Mar-2010 Ted Kremenek <kremenek@apple.com> Fix '+=' accumulation error when parsing numeric amounts in a format string.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99479 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
fdb703ab3a3c28aeb53b3db4c54e14a30d78dc4e 25-Mar-2010 Ted Kremenek <kremenek@apple.com> Fix '+=' accumulation error when parsing numeric amounts in a format string.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99479 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
839bff1203adf923e1a75ed2695b8fd824810920 23-Mar-2010 Ted Kremenek <kremenek@apple.com> Only perform CFG-based warnings on 'static inline' functions that
are called (transitively) by regular functions/blocks within a
translation untion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99233 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
d064fdc4b7b64ca55b40b70490c79d6f569df78e 23-Mar-2010 Ted Kremenek <kremenek@apple.com> Only perform CFG-based warnings on 'static inline' functions that
are called (transitively) by regular functions/blocks within a
translation untion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99233 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
27c4182d9c44e33a144944a4123b5bc6d6d7a854 12-Mar-2010 Jeffrey Yasskin <jyasskin@google.com> Allow users to set CPPFLAGS and CXXFLAGS on the make command line.

Tested: make CPPFLAGS=-m64 CXXFLAGS=-m64 -j8 && (cd tools/clang;make test)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98399 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
3352406820d133c78161e8d710f95b8ac152a1e7 12-Mar-2010 Jeffrey Yasskin <jyasskin@google.com> Allow users to set CPPFLAGS and CXXFLAGS on the make command line.

Tested: make CPPFLAGS=-m64 CXXFLAGS=-m64 -j8 && (cd tools/clang;make test)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98399 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
e7f99eb4dad9fcdee7ad9943675b59b8db32ef4c 10-Mar-2010 Ted Kremenek <kremenek@apple.com> When computing in AnalysisContext the variables referenced
by a block, also look at the contained blocks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98111 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
2cfe28b6a061e72c6c8726d7ecb879093a1ab7a3 10-Mar-2010 Ted Kremenek <kremenek@apple.com> When computing in AnalysisContext the variables referenced
by a block, also look at the contained blocks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98111 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
6d572dcc5d69c529cdd8a897d936f90356db329f 03-Mar-2010 Benjamin Kramer <benny.kra@googlemail.com> Simplify code a bit and remove unneeded semicolons.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97654 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
792bea97c42dabffce457cc79f6bfede9ed21712 03-Mar-2010 Benjamin Kramer <benny.kra@googlemail.com> Simplify code a bit and remove unneeded semicolons.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97654 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
1681904cd1dd18b542611b9b9fd8a93d4c55ef02 03-Mar-2010 Ted Kremenek <kremenek@apple.com> Fix an algorithmic bug in LiveVariables pointed out by Zhongxing.
If an initializer in a DeclStmt references the declared variable, that
extends the liveness of that variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97624 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
ead78fdfa6113ef10884c184fb40db4b44305dd9 03-Mar-2010 Ted Kremenek <kremenek@apple.com> Fix an algorithmic bug in LiveVariables pointed out by Zhongxing.
If an initializer in a DeclStmt references the declared variable, that
extends the liveness of that variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97624 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
37e11fcf122ffeccfb2d359b0cffbe485bed4192 02-Mar-2010 Ted Kremenek <kremenek@apple.com> [CFG]

After discussion with Zhongxing, don't force the initializer of DeclStmts to be
block-level expressions.

This led to some interesting fallout:

[UninitializedValues]

Always visit the initializer of DeclStmts (do not assume they are block-level expressions).

[BasicStore]

With initializers of DeclStmts no longer block-level expressions, this causes self-referencing initializers (e.g. 'int x = x') to no longer cause the initialized variable to be live before the DeclStmt. While this is correct, it caused BasicStore::RemoveDeadBindings() to prune off the values of these variables from the initial store (where they are set to uninitialized). The fix is to back-port some (and only some) of the lazy-binding logic from RegionStore to
BasicStore. Now the default values of local variables are determined lazily as opposed
to explicitly initialized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97591 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ninitializedValues.cpp
5ba290a12fb9390a77ea4dca3d98deb53022d182 02-Mar-2010 Ted Kremenek <kremenek@apple.com> [CFG]

After discussion with Zhongxing, don't force the initializer of DeclStmts to be
block-level expressions.

This led to some interesting fallout:

[UninitializedValues]

Always visit the initializer of DeclStmts (do not assume they are block-level expressions).

[BasicStore]

With initializers of DeclStmts no longer block-level expressions, this causes self-referencing initializers (e.g. 'int x = x') to no longer cause the initialized variable to be live before the DeclStmt. While this is correct, it caused BasicStore::RemoveDeadBindings() to prune off the values of these variables from the initial store (where they are set to uninitialized). The fix is to back-port some (and only some) of the lazy-binding logic from RegionStore to
BasicStore. Now the default values of local variables are determined lazily as opposed
to explicitly initialized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97591 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ninitializedValues.cpp
d4277f6b8bcf05270e44d016dab2cc923e673068 02-Mar-2010 Zhongxing Xu <xuzhongxing@gmail.com> Register all parameters even if they didn't occur in the function body.
We may query their liveness because they are added to store when passing
argument values.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97562 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
15f6b42b68d296cabf117752094693afe813dffb 02-Mar-2010 Zhongxing Xu <xuzhongxing@gmail.com> Register all parameters even if they didn't occur in the function body.
We may query their liveness because they are added to store when passing
argument values.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97562 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
02ebc3edc4fe0c300c736e9b7a65d0adcb14bd05 01-Mar-2010 Ted Kremenek <kremenek@apple.com> Allow a '0' precision in format strings (as the man page says it is okay).
Fixes <rdar://problem/7700339>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97482 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
d49d87719b8e272134e76601e3efc0197785aa8a 01-Mar-2010 Ted Kremenek <kremenek@apple.com> Allow a '0' precision in format strings (as the man page says it is okay).
Fixes <rdar://problem/7700339>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97482 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
62f46195bb61f91f9b3b476f4dcfa10126c18ff2 27-Feb-2010 Ted Kremenek <kremenek@apple.com> For printf format string checking, add support for positional format strings.
Along the way, coelesce some of the diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97297 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
efaff195ba1fa55b6fe0b0b2435b81451387d241 27-Feb-2010 Ted Kremenek <kremenek@apple.com> For printf format string checking, add support for positional format strings.
Along the way, coelesce some of the diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97297 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
42f1adfc93e40ec0d8d4e7ceaac2dd664b1cb727 26-Feb-2010 Ted Kremenek <kremenek@apple.com> For printf format string checking, move the tracking of the data argument index out of
Sema and into analyze_printf::ParseFormatString(). Also use a bitvector to determine
what arguments have been covered (instead of just checking to see if the last argument consumed is the max argument). This is prep. for support positional arguments (an IEEE extension).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97248 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
7f70dc85d5055c19c8003f43a59135de211ad1b9 26-Feb-2010 Ted Kremenek <kremenek@apple.com> For printf format string checking, move the tracking of the data argument index out of
Sema and into analyze_printf::ParseFormatString(). Also use a bitvector to determine
what arguments have been covered (instead of just checking to see if the last argument consumed is the max argument). This is prep. for support positional arguments (an IEEE extension).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97248 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
2f4bcd224b9a9161714891c80d91c255eceab90b 24-Feb-2010 Zhongxing Xu <xuzhongxing@gmail.com> Always add CallExpr as block-level expression. Inline-based interprocedural
analysis needs this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97014 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
910716678e8af41432f3dfb16b340168597f8c45 24-Feb-2010 Zhongxing Xu <xuzhongxing@gmail.com> Always add CallExpr as block-level expression. Inline-based interprocedural
analysis needs this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97014 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
59b4e1fe167ba8d40d5de35825a40be2d241928b 24-Feb-2010 Ted Kremenek <kremenek@apple.com> Add support for '%C' and '%S' printf conversion specifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97005 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
87260c7eabf88eb2009ba2ba20150cd897483241 24-Feb-2010 Ted Kremenek <kremenek@apple.com> Add support for '%C' and '%S' printf conversion specifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97005 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
c6c8c8187e9210f5ad3e24f21da12ef1e455471c 23-Feb-2010 Ted Kremenek <kremenek@apple.com> Move the rest of the unreachable code analysis from libSema
to libAnalysis (with only the error reporting in libSema).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96893 91177308-0d34-0410-b5e6-96231b3b80d8
eachableCode.cpp
72919a334752bc87001a7e3a0b6e5892768fac20 23-Feb-2010 Ted Kremenek <kremenek@apple.com> Move the rest of the unreachable code analysis from libSema
to libAnalysis (with only the error reporting in libSema).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96893 91177308-0d34-0410-b5e6-96231b3b80d8
eachableCode.cpp
5e55d2171743df526c2d916cc69c8d7f744e9ebd 23-Feb-2010 Ted Kremenek <kremenek@apple.com> Start moving some of the logic for the unreachable code analysis out of libSema
and into libAnalysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96872 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
eachableCode.cpp
3d2eed823d534ee370cfd7742c1e96ab3ee9a80b 23-Feb-2010 Ted Kremenek <kremenek@apple.com> Start moving some of the logic for the unreachable code analysis out of libSema
and into libAnalysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96872 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
eachableCode.cpp
8e427f4032b877ac443e5a0791880dea5298e599 22-Feb-2010 Daniel Dunbar <daniel@zuster.org> Revert "Simplify code: Succ is guaranteed to be not NULL.", which turns out to
not be guaranteed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96782 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
c3daac59e26b63c08208de2fbaceb1ff01be3492 22-Feb-2010 Daniel Dunbar <daniel@zuster.org> Revert "Simplify code: Succ is guaranteed to be not NULL.", which turns out to
not be guaranteed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96782 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
c437669213eac94642391cfe57a5c00292183c65 22-Feb-2010 Zhongxing Xu <xuzhongxing@gmail.com> Simplify code: Succ is guaranteed to be not NULL.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96772 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
8414a8c82d92fa8d35ed5d479d7fd6ae8b9d1cd4 22-Feb-2010 Zhongxing Xu <xuzhongxing@gmail.com> Simplify code: Succ is guaranteed to be not NULL.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96772 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
07bbd4f47b17dde1c0e9ea667e72b394142d332a 17-Feb-2010 Zhongxing Xu <xuzhongxing@gmail.com> Add a utility method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96471 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
8ddf7cead8a67342a4584a203e0bf736b7efedbe 17-Feb-2010 Zhongxing Xu <xuzhongxing@gmail.com> Add a utility method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96471 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
5c8a08c5da6439047a8521f1b4ea6a61438917b4 16-Feb-2010 Ted Kremenek <kremenek@apple.com> Refactor the logic for printf argument type-checking into analyze_printf::ArgTypeResult.
Implement printf argument type checking for '%s'.

Fixes <rdar://problem/3065808>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96310 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
4e4b30ec62d78b24e6556fea2624855c193d0e3e 16-Feb-2010 Ted Kremenek <kremenek@apple.com> Refactor the logic for printf argument type-checking into analyze_printf::ArgTypeResult.
Implement printf argument type checking for '%s'.

Fixes <rdar://problem/3065808>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96310 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
f8fd82ba49827db0f6a6ba00c55a7b56b12a19fa 10-Feb-2010 Shih-wei Liao <sliao@google.com> Check in LLVM r95781.
nalysisContext.cpp
FG.cpp
MakeLists.txt
iveVariables.cpp
akefile
rintfFormatString.cpp
ninitializedValues.cpp
2e8f8dc12c16b7a499d4898ad55cafe1c71b1e25 09-Feb-2010 Ted Kremenek <kremenek@apple.com> Convert tabs to spaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95621 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
df17f9d95ba03ba41d8d39ccb688a4eb2ee00e9a 09-Feb-2010 Ted Kremenek <kremenek@apple.com> Convert tabs to spaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95621 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
ddcc5f218a5293f773404465fbf799665d5c57b6 06-Feb-2010 Ted Kremenek <kremenek@apple.com> Teach RegionStore::InvalidateRegions() to also invalidate static variables referenced by blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95459 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
85248734f404fbb9b2f88ecd5296761a8578def6 06-Feb-2010 Ted Kremenek <kremenek@apple.com> Teach RegionStore::InvalidateRegions() to also invalidate static variables referenced by blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95459 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
41c4e6c50f5fa693f4144e028c2e01ea95d865b9 04-Feb-2010 Ted Kremenek <kremenek@apple.com> Move ParseFormatString() and FormatStringHandler back into the analyze_printf namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95324 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
74d56a168966ff015824279a24aaf566180ed97d 04-Feb-2010 Ted Kremenek <kremenek@apple.com> Move ParseFormatString() and FormatStringHandler back into the analyze_printf namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95324 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
441c1f9f024457b9e8bde81f3729c87df0c5dac3 02-Feb-2010 Ted Kremenek <kremenek@apple.com> Add format string type checking support for 'long double'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95026 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
f911eba72e6d7275e5cfdb79ab23fb2aa9cc01d0 02-Feb-2010 Ted Kremenek <kremenek@apple.com> Add format string type checking support for 'long double'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95026 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
977d502acf3d2d1e3c86c1885265e136db49abc1 30-Jan-2010 Daniel Dunbar <daniel@zuster.org> Recognize 'q' as a format length modifier (from BSD).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94894 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
01aefc6d20fbfd50bfb83926226dee86dd31c9c5 30-Jan-2010 Daniel Dunbar <daniel@zuster.org> Recognize 'q' as a format length modifier (from BSD).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94894 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
73c3961b15974ec10c54a701c3b79ffcd956ffc6 30-Jan-2010 Ted Kremenek <kremenek@apple.com> Add format string checking of 'double' arguments. Fixes <rdar://problem/6931734>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94867 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
c9a89fec60a20eb3269caa95eca048d45ab215ad 30-Jan-2010 Ted Kremenek <kremenek@apple.com> Add format string checking of 'double' arguments. Fixes <rdar://problem/6931734>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94867 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
8c8ca09bf8eeb0eaaf7992b2512ab4ec74c645de 30-Jan-2010 Ted Kremenek <kremenek@apple.com> Fix spacing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94852 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
40888ada6022cfd4ab2a7c07ab276639860ffc5a 30-Jan-2010 Ted Kremenek <kremenek@apple.com> Fix spacing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94852 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
ecf8e8a3ae64ef33cd1beec57e25a740f6c092f7 29-Jan-2010 Ted Kremenek <kremenek@apple.com> Per a suggestion from Cristian Draghici, add a method to FormatSpecifier that returns the expected type of the matching data argument. It isn't complete, but should handle several of the important cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94851 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
33567d2feb3e52fac6e0b46d5b3d137fc8467fb0 29-Jan-2010 Ted Kremenek <kremenek@apple.com> Per a suggestion from Cristian Draghici, add a method to FormatSpecifier that returns the expected type of the matching data argument. It isn't complete, but should handle several of the important cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94851 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
3a2004dc41f4a5735d1717ef63abfbbf25d36611 29-Jan-2010 Ted Kremenek <kremenek@apple.com> Enhancements to the alternate (WIP) format string checking:

- Add ConversionSpecifier::consumesDataArgument() as a helper method
to determine if a conversion specifier requires a matching argument.
- Add support for glibc-specific '%m' conversion
- Add an extra callback to HandleNull() for locations within the
format specifier that have a null character


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94834 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
4dcb18ff9d92c66c78077ac5cae4b83af37292e4 29-Jan-2010 Ted Kremenek <kremenek@apple.com> Enhancements to the alternate (WIP) format string checking:

- Add ConversionSpecifier::consumesDataArgument() as a helper method
to determine if a conversion specifier requires a matching argument.
- Add support for glibc-specific '%m' conversion
- Add an extra callback to HandleNull() for locations within the
format specifier that have a null character


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94834 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
bf5afe56417379aba6372d5c416e4d320d6a01d4 29-Jan-2010 Ted Kremenek <kremenek@apple.com> Alternate format string checking: issue warnings for incomplete format specifiers.

In addition, move ParseFormatString() and FormatStringHandler() from
the clang::analyze_printf to the clang namespace. Hopefully this will
resolve some link errors on Linux.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94794 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
808015a18bd97781ce437831a95a92fdfc8d5136 29-Jan-2010 Ted Kremenek <kremenek@apple.com> Alternate format string checking: issue warnings for incomplete format specifiers.

In addition, move ParseFormatString() and FormatStringHandler() from
the clang::analyze_printf to the clang namespace. Hopefully this will
resolve some link errors on Linux.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94794 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
76d8ee48b6f8591391f75ed175e49b385a85fc02 29-Jan-2010 Ted Kremenek <kremenek@apple.com> Alternate format string checking: issue a warning for invalid conversion specifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94792 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
26ac2e07b46bfb4d4f00752c96481c0a98c79c69 29-Jan-2010 Ted Kremenek <kremenek@apple.com> Alternate format string checking: issue a warning for invalid conversion specifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94792 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
e345a28e223993374c2c96d01f0ec2bfa8cf8daa 29-Jan-2010 Ted Kremenek <kremenek@apple.com> Yet another attempt to make the Linux buildbots happy. Apparently there are differences on how nested namespaces are handled...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94790 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
4b220fae2f525fda39685ddfa7759950db1185e2 29-Jan-2010 Ted Kremenek <kremenek@apple.com> Yet another attempt to make the Linux buildbots happy. Apparently there are differences on how nested namespaces are handled...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94790 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
e7ffcad1e083f395a0c3cc45d4ad8437e84eb8aa 29-Jan-2010 Ted Kremenek <kremenek@apple.com> Move definition of FormatStringHandler::~FormatStringHandler() within namespace directives. Hopefully this will make the Linux buildbots happy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94784 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
d7a3f01a5109807b4fad48a7ab75fa806b8b899d 29-Jan-2010 Ted Kremenek <kremenek@apple.com> Move definition of FormatStringHandler::~FormatStringHandler() within namespace directives. Hopefully this will make the Linux buildbots happy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94784 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
920439c0ec59e26196ce0defcda765c76c8b7778 29-Jan-2010 Ted Kremenek <kremenek@apple.com> Add precision/field width checking to AlternateCheckPrintfString().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94774 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
0d27735c51f5bd392e673cf39a675e14e9442387 29-Jan-2010 Ted Kremenek <kremenek@apple.com> Add precision/field width checking to AlternateCheckPrintfString().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94774 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
24f7ce70489c4f6850da824f1299d254ae5f251c 29-Jan-2010 Ted Kremenek <kremenek@apple.com> Fix off-by-one error in ParseFormatSpecifier() when reporting the location of a null character.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94762 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
e729acbba75903f42e79e72e46cdebe3f4c35521 29-Jan-2010 Ted Kremenek <kremenek@apple.com> Fix off-by-one error in ParseFormatSpecifier() when reporting the location of a null character.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94762 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
1328176b16ca8f3c103bbc32c83edf7131ea5715 28-Jan-2010 Ted Kremenek <kremenek@apple.com> Add position of conversion specifier character to 'ConversionSpecifier'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94739 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
a8d8fec7876666d90bb2a144d3b832b2d89a088a 28-Jan-2010 Ted Kremenek <kremenek@apple.com> Add position of conversion specifier character to 'ConversionSpecifier'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94739 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
5d5beb9fb6d034ee938886c12cc264dce8c0a16e 28-Jan-2010 Ted Kremenek <kremenek@apple.com> Rename namespace clang::printf to clang::analyze_printf to avoid problems where the reference to 'printf' is ambiguous.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94733 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
d2dcece5882215e92a80bff8a7b7fd2fd81d7086 28-Jan-2010 Ted Kremenek <kremenek@apple.com> Rename namespace clang::printf to clang::analyze_printf to avoid problems where the reference to 'printf' is ambiguous.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94733 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
e812a3122c72da6cf7e69c0c68939ca4bf1cbfc4 28-Jan-2010 Ted Kremenek <kremenek@apple.com> Allow HandleFormatSpecifier() to indicate that no more processing of the format string is desired.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94715 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
d5f2096e266b7905df660b7839e69e9ed6ba9018 28-Jan-2010 Ted Kremenek <kremenek@apple.com> Allow HandleFormatSpecifier() to indicate that no more processing of the format string is desired.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94715 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
17046e50050072bd8155259acae85bbeeb7bf999 28-Jan-2010 Ted Kremenek <kremenek@apple.com> Add '@' conversion specifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94713 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
c7cbb9bf8e0bf8c3191ef0b782ec198c433d2a4e 28-Jan-2010 Ted Kremenek <kremenek@apple.com> Add '@' conversion specifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94713 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
6a096f28201041bd84053b1e8a003f94aadf35e8 28-Jan-2010 Ted Kremenek <kremenek@apple.com> Remove invalid conversion specifiers from format string checking.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94707 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
f291976ecf537dc4f2d5537b1664d47ff4b94865 28-Jan-2010 Ted Kremenek <kremenek@apple.com> Remove invalid conversion specifiers from format string checking.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94707 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
a896e0eb6a386e3fecfa4847981291bcfaab98ab 28-Jan-2010 Ted Kremenek <kremenek@apple.com> Add a few more conversion specifiers to ParseFormatSpecifier (these appear in SemaChecking).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94704 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
c7ae51a3cd9460db8280e8623c90614f246e46d2 28-Jan-2010 Ted Kremenek <kremenek@apple.com> Add a few more conversion specifiers to ParseFormatSpecifier (these appear in SemaChecking).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94704 91177308-0d34-0410-b5e6-96231b3b80d8
rintfFormatString.cpp
1fa44fc90aa402c4bf12f964d46afff862073537 28-Jan-2010 Ted Kremenek <kremenek@apple.com> Add skeleton for a more structured way to analyzing pring format
strings than what we currently have in Sema. This is both an
experiment and a WIP.

The idea is simple: parse the format string incrementally,
constructing a well-structure representation of each format specifier.
Each format specifier is then handed back one-by-one to a client via a
callback. Malformed format strings are also handled with callbacks.
The idea is to separate the parsing of the format string from the
emission of diagnostics. Currently what we have in Sema for handling
format strings is a mongrel of both that is hard to follow and
difficult to modify (I can apply this label since I'm the original
author of that code).

This is in libAnalysis as it is reasonable generic and can potentially
be used both by libSema and libChecker.

Comments welcome.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94702 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
rintfFormatString.cpp
8f0a1c73fd2b83afd4b1fce6f964535b51d13659 28-Jan-2010 Ted Kremenek <kremenek@apple.com> Add skeleton for a more structured way to analyzing pring format
strings than what we currently have in Sema. This is both an
experiment and a WIP.

The idea is simple: parse the format string incrementally,
constructing a well-structure representation of each format specifier.
Each format specifier is then handed back one-by-one to a client via a
callback. Malformed format strings are also handled with callbacks.
The idea is to separate the parsing of the format string from the
emission of diagnostics. Currently what we have in Sema for handling
format strings is a mongrel of both that is hard to follow and
difficult to modify (I can apply this label since I'm the original
author of that code).

This is in libAnalysis as it is reasonable generic and can potentially
be used both by libSema and libChecker.

Comments welcome.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94702 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
rintfFormatString.cpp
e6d261e31fcc2204d4117ca753e843bc2c1164f4 25-Jan-2010 Ted Kremenek <kremenek@apple.com> Split libAnalysis into two libraries: libAnalysis and libChecker.

(1) libAnalysis is a generic analysis library that can be used by
Sema. It defines the CFG, basic dataflow analysis primitives, and
inexpensive flow-sensitive analyses (e.g. LiveVariables).

(2) libChecker contains the guts of the static analyzer, incuding the
path-sensitive analysis engine and domain-specific checks.

Now any clients that want to use the frontend to build their own tools
don't need to link in the entire static analyzer.

This change exposes various obvious cleanups that can be made to the
layout of files and headers in libChecker. More changes pending. :)

This change also exposed a layering violation between AnalysisContext
and MemRegion. BlockInvocationContext shouldn't explicitly know about
BlockDataRegions. For now I've removed the BlockDataRegion* from
BlockInvocationContext (removing context-sensitivity; although this
wasn't used yet). We need to have a better way to extend
BlockInvocationContext (and any LocationContext) to add
context-sensitivty.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94406 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
rrayBoundChecker.cpp
ttrNonNullChecker.cpp
asicConstraintManager.cpp
asicObjCFoundationChecks.cpp
asicObjCFoundationChecks.h
asicStore.cpp
asicValueFactory.cpp
ugReporter.cpp
ugReporterVisitors.cpp
uiltinFunctionChecker.cpp
FRefCount.cpp
MakeLists.txt
allAndMessageChecker.cpp
allInliner.cpp
astToStructChecker.cpp
heckDeadStores.cpp
heckObjCDealloc.cpp
heckObjCInstMethSignature.cpp
heckObjCUnusedIVars.cpp
heckSecuritySyntaxOnly.cpp
heckSizeofPointer.cpp
hecker.cpp
ereferenceChecker.cpp
ivZeroChecker.cpp
nvironment.cpp
xplodedGraph.cpp
ixedAddressChecker.cpp
RBlockCounter.cpp
RCoreEngine.cpp
RExprEngine.cpp
RExprEngineExperimentalChecks.cpp
RExprEngineExperimentalChecks.h
RExprEngineInternalChecks.h
RState.cpp
iveVariables.cpp
allocChecker.cpp
anagerRegistry.cpp
emRegion.cpp
SAutoreleasePoolChecker.cpp
SErrorChecker.cpp
oReturnFunctionChecker.cpp
SAtomicChecker.cpp
athDiagnostic.cpp
ointerArithChecker.cpp
ointerSubChecker.cpp
threadLockChecker.cpp
angeConstraintManager.cpp
egionStore.cpp
eturnPointerRangeChecker.cpp
eturnStackAddressChecker.cpp
eturnUndefChecker.cpp
Vals.cpp
Valuator.cpp
impleConstraintManager.cpp
impleConstraintManager.h
impleSValuator.cpp
tore.cpp
ymbolManager.cpp
ndefBranchChecker.cpp
ndefResultChecker.cpp
ndefinedArraySubscriptChecker.cpp
ndefinedAssignmentChecker.cpp
ninitializedValues.cpp
LASizeChecker.cpp
alueManager.cpp
1309f9a3b225ea846e5822691c39a77423125505 25-Jan-2010 Ted Kremenek <kremenek@apple.com> Split libAnalysis into two libraries: libAnalysis and libChecker.

(1) libAnalysis is a generic analysis library that can be used by
Sema. It defines the CFG, basic dataflow analysis primitives, and
inexpensive flow-sensitive analyses (e.g. LiveVariables).

(2) libChecker contains the guts of the static analyzer, incuding the
path-sensitive analysis engine and domain-specific checks.

Now any clients that want to use the frontend to build their own tools
don't need to link in the entire static analyzer.

This change exposes various obvious cleanups that can be made to the
layout of files and headers in libChecker. More changes pending. :)

This change also exposed a layering violation between AnalysisContext
and MemRegion. BlockInvocationContext shouldn't explicitly know about
BlockDataRegions. For now I've removed the BlockDataRegion* from
BlockInvocationContext (removing context-sensitivity; although this
wasn't used yet). We need to have a better way to extend
BlockInvocationContext (and any LocationContext) to add
context-sensitivty.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94406 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
rrayBoundChecker.cpp
ttrNonNullChecker.cpp
asicConstraintManager.cpp
asicObjCFoundationChecks.cpp
asicObjCFoundationChecks.h
asicStore.cpp
asicValueFactory.cpp
ugReporter.cpp
ugReporterVisitors.cpp
uiltinFunctionChecker.cpp
FRefCount.cpp
MakeLists.txt
allAndMessageChecker.cpp
allInliner.cpp
astToStructChecker.cpp
heckDeadStores.cpp
heckObjCDealloc.cpp
heckObjCInstMethSignature.cpp
heckObjCUnusedIVars.cpp
heckSecuritySyntaxOnly.cpp
heckSizeofPointer.cpp
hecker.cpp
ereferenceChecker.cpp
ivZeroChecker.cpp
nvironment.cpp
xplodedGraph.cpp
ixedAddressChecker.cpp
RBlockCounter.cpp
RCoreEngine.cpp
RExprEngine.cpp
RExprEngineExperimentalChecks.cpp
RExprEngineExperimentalChecks.h
RExprEngineInternalChecks.h
RState.cpp
iveVariables.cpp
allocChecker.cpp
anagerRegistry.cpp
emRegion.cpp
SAutoreleasePoolChecker.cpp
SErrorChecker.cpp
oReturnFunctionChecker.cpp
SAtomicChecker.cpp
athDiagnostic.cpp
ointerArithChecker.cpp
ointerSubChecker.cpp
threadLockChecker.cpp
angeConstraintManager.cpp
egionStore.cpp
eturnPointerRangeChecker.cpp
eturnStackAddressChecker.cpp
eturnUndefChecker.cpp
Vals.cpp
Valuator.cpp
impleConstraintManager.cpp
impleConstraintManager.h
impleSValuator.cpp
tore.cpp
ymbolManager.cpp
ndefBranchChecker.cpp
ndefResultChecker.cpp
ndefinedArraySubscriptChecker.cpp
ndefinedAssignmentChecker.cpp
ninitializedValues.cpp
LASizeChecker.cpp
alueManager.cpp
f4b34a030729fff07d8a6501bfabbbd097c15045 24-Jan-2010 Chris Lattner <sabre@nondot.org> -fno-rtti is now the default.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94379 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
0bb46d285cb2bb0f582d0935f58f57a9be8bf2cd 24-Jan-2010 Chris Lattner <sabre@nondot.org> -fno-rtti is now the default.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94379 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
702429807852dae8328ab4981a7b6400505dae37 22-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> Process cast according to the cast kind. Prepare for more specific cast
handling (for C++). No functionality change for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94153 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
b79b117d3b76da58b14ef835ccfcf2e988b7345f 22-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> Process cast according to the cast kind. Prepare for more specific cast
handling (for C++). No functionality change for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94153 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
9b81729d31ae7c7608885c3d38b05cd7dba9b2d1 21-Jan-2010 Mike Stump <mrs@apple.com> Improve unreachable code warnings with respect to dead binary and
unary operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94084 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
55f988efeb08b84c2dd9e4c05990b88c81fe2b58 21-Jan-2010 Mike Stump <mrs@apple.com> Improve unreachable code warnings with respect to dead binary and
unary operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94084 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
c5a125febb22d5636fbb9558ef1abbd58aa5b47d 21-Jan-2010 Mike Stump <mrs@apple.com> Speed up compilation by avoiding generating exceptional edges from
CallExprs as those edges help cause a n^2 explosion in the number of
destructor calls. Other consumers, such as static analysis, that
would like to have more a more complete CFG can select the inclusion
of those edges as CFG build time.

This also fixes up the two compilation users of CFGs to be tolerant of
having or not having those edges. All catch code is assumed be to
live if we didn't generate the exceptional edges for CallExprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94074 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
FG.cpp
4c45aa1b00b91847acfb082acfaced3ffa294d1d 21-Jan-2010 Mike Stump <mrs@apple.com> Speed up compilation by avoiding generating exceptional edges from
CallExprs as those edges help cause a n^2 explosion in the number of
destructor calls. Other consumers, such as static analysis, that
would like to have more a more complete CFG can select the inclusion
of those edges as CFG build time.

This also fixes up the two compilation users of CFGs to be tolerant of
having or not having those edges. All catch code is assumed be to
live if we didn't generate the exceptional edges for CallExprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94074 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
FG.cpp
4347259d31856682ac492d955359add71613f1c3 21-Jan-2010 Mike Stump <mrs@apple.com> Add infrastructure to add base initializers and member initializers to
the CFG. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94062 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
FG.cpp
b978a441c7d8bf59e7fede938e1f3b672573b443 21-Jan-2010 Mike Stump <mrs@apple.com> Add infrastructure to add base initializers and member initializers to
the CFG. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94062 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
FG.cpp
5aad6a8e2620222d2779a825f8d67851237a0ebc 20-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> Correct comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93999 91177308-0d34-0410-b5e6-96231b3b80d8
astToStructChecker.cpp
368979179c2ae4f1ff22786fc5c83c20f1cbc042 20-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> Correct comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93999 91177308-0d34-0410-b5e6-96231b3b80d8
astToStructChecker.cpp
bd322a2947dfe6dc9dd42a652eaf9167a33d7a95 20-Jan-2010 Mike Stump <mrs@apple.com> Wire up the EH context for the catch clauses to the outer EH context. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93963 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
f00cca5e05bb9ea51a3a21c8014ff9f3508d46e9 20-Jan-2010 Mike Stump <mrs@apple.com> Wire up the EH context for the catch clauses to the outer EH context. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93963 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
b82860e61380721b862c2970c2f8803f0beac824 20-Jan-2010 Mike Stump <mrs@apple.com> Add an exceptional edge from the try terminated block to the outer EH
context (try or the Exit block) when there isn't a catch (...).

Improve CFG printing for catch (...).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93962 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
a1f93631a84621d77aeb627691da85a8991af188 20-Jan-2010 Mike Stump <mrs@apple.com> Add an exceptional edge from the try terminated block to the outer EH
context (try or the Exit block) when there isn't a catch (...).

Improve CFG printing for catch (...).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93962 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
c86545a288b5b370a0055c0eba2e0315c95b2cb0 19-Jan-2010 Mike Stump <mrs@apple.com> Add CFG support for the start and end of scopes and infrastructure for
implicit destructor calls. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93922 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
079bd72439448b78629a28da6b1f8abe2cdeaf4d 19-Jan-2010 Mike Stump <mrs@apple.com> Add CFG support for the start and end of scopes and infrastructure for
implicit destructor calls. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93922 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
f31ee519ebca54f49ca131033f12a3d4929f99ed 19-Jan-2010 Ted Kremenek <kremenek@apple.com> Tighten code and rework indentation of some if() branches (for readability). No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93904 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
3fa1e4b27300a4ea4cf273182d4b6427ef87f3f8 19-Jan-2010 Ted Kremenek <kremenek@apple.com> Tighten code and rework indentation of some if() branches (for readability). No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93904 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
e9a8eb792cf6df541ec4f41a0eb35415c236272e 19-Jan-2010 Ted Kremenek <kremenek@apple.com> Remove extra space in uses of 'assert()'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93903 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
6db0ad32fa0987ff76d4c41393991ef4b6895ea3 19-Jan-2010 Ted Kremenek <kremenek@apple.com> Remove extra space in uses of 'assert()'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93903 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
d2112884dead99a9ff31f0b7f246f22b9bb12664 19-Jan-2010 Ted Kremenek <kremenek@apple.com> Re-alphabetize cases in switch statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93902 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
021c8afbab95c71fbdd95c0b5cea36fd316281f9 19-Jan-2010 Ted Kremenek <kremenek@apple.com> Re-alphabetize cases in switch statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93902 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
cd984d478c3e5971c955eab0c9dc409b5cd4d41f 19-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> Fix a serious bug: Tmp3 is the wrong destination set. We should create a new
intermediate destination set Tmp4.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93873 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
c39b2bdd4cef51021fe90de91c9fb6d1a15f4d0a 19-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> Fix a serious bug: Tmp3 is the wrong destination set. We should create a new
intermediate destination set Tmp4.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93873 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
981e505dc7aee8bc2292827f3564e8e36277f774 19-Jan-2010 Mike Stump <mrs@apple.com> Add try/catch CFG support. Also improve throw CFG support. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93840 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
5d1d20227878cd03db8b2dd23efd4cedfe874fee 19-Jan-2010 Mike Stump <mrs@apple.com> Add try/catch CFG support. Also improve throw CFG support. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93840 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
bcb7016f8b0f75e360798f22920b775bda13de66 18-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> Add support for computing size in elements for symbolic regions obtained from
malloc().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93722 91177308-0d34-0410-b5e6-96231b3b80d8
rrayBoundChecker.cpp
allocChecker.cpp
egionStore.cpp
eturnPointerRangeChecker.cpp
3ed04d37573c566205d965d2e91d54ccae898d0a 18-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> Add support for computing size in elements for symbolic regions obtained from
malloc().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93722 91177308-0d34-0410-b5e6-96231b3b80d8
rrayBoundChecker.cpp
allocChecker.cpp
egionStore.cpp
eturnPointerRangeChecker.cpp
1cd4f4f7768e95e925125fdd88adeb297cd29590 18-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> If the symbol has not been tracked, do not free it. This is possible when free
is called on a pointer that does not get its value directly from malloc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93706 91177308-0d34-0410-b5e6-96231b3b80d8
allocChecker.cpp
7e3cda9744204d19e0691bcb473cac1529b5fadd 18-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> If the symbol has not been tracked, do not free it. This is possible when free
is called on a pointer that does not get its value directly from malloc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93706 91177308-0d34-0410-b5e6-96231b3b80d8
allocChecker.cpp
8d0ab94915f7029f5fb09ac1d9cb1ad69f54b392 15-Jan-2010 Ted Kremenek <kremenek@apple.com> Don't suggest the developer use 'arc4random' instead of 'rand' when that function is not available. Fixes PR 6012.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93508 91177308-0d34-0410-b5e6-96231b3b80d8
heckSecuritySyntaxOnly.cpp
88c8bc83808588fdb97924144ca9fb5f27dfc9a6 15-Jan-2010 Ted Kremenek <kremenek@apple.com> Don't suggest the developer use 'arc4random' instead of 'rand' when that function is not available. Fixes PR 6012.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93508 91177308-0d34-0410-b5e6-96231b3b80d8
heckSecuritySyntaxOnly.cpp
73f9a40aa9351b45bb67d25afb1b41e07f9019b0 15-Jan-2010 Ted Kremenek <kremenek@apple.com> Teach BugReporter to "escape" the occurance of '%' characters in diagnostic messages when emitted results to the standard Diagnostics output. Fixes PR 6033.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93507 91177308-0d34-0410-b5e6-96231b3b80d8
ugReporter.cpp
c213b48206c55ca0eb1387cfa1651de504f147d1 15-Jan-2010 Ted Kremenek <kremenek@apple.com> Teach BugReporter to "escape" the occurance of '%' characters in diagnostic messages when emitted results to the standard Diagnostics output. Fixes PR 6033.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93507 91177308-0d34-0410-b5e6-96231b3b80d8
ugReporter.cpp
443b7e5fa98e6a31a86b52ab3689f8140d4076e3 15-Jan-2010 Ted Kremenek <kremenek@apple.com> Convert a few more uses of std::string& to llvm::StringRef.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93506 91177308-0d34-0410-b5e6-96231b3b80d8
ugReporter.cpp
8b9317186fd5243938128a0b0e0494498d78ab8c 15-Jan-2010 Ted Kremenek <kremenek@apple.com> Convert a few more uses of std::string& to llvm::StringRef.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93506 91177308-0d34-0410-b5e6-96231b3b80d8
ugReporter.cpp
76aaef78c657eff6a777f6adab449def707a2025 14-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> Fix pr6035.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93422 91177308-0d34-0410-b5e6-96231b3b80d8
Valuator.cpp
7b81e8fe6f8576340af7899c1828f1af0781d775 14-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> Fix pr6035.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93422 91177308-0d34-0410-b5e6-96231b3b80d8
Valuator.cpp
fe6189ee1a85456792b2dd58f3ef7c93de9c4ed0 13-Jan-2010 Mike Stump <mrs@apple.com> Add an unreachable code checker.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93287 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
fa6ef180c0d3609124217387618fbb51bbdd2e48 13-Jan-2010 Mike Stump <mrs@apple.com> Add an unreachable code checker.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93287 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
4371f88b7d0a868a974f9ff8df416993c01c9f47 11-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Fix pasto.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93181 91177308-0d34-0410-b5e6-96231b3b80d8
FRefCount.cpp
c027e54d669b8217a4c466f83aebee1a7c2c2e63 11-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Fix pasto.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93181 91177308-0d34-0410-b5e6-96231b3b80d8
FRefCount.cpp
1981dbd321e8ff34344e9804c1c9d0ee615ff447 11-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Avoid use of deprecated functions (CStrInCStrNoCase and StringsEqualNoCase).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93175 91177308-0d34-0410-b5e6-96231b3b80d8
FRefCount.cpp
e45c149996ccd0f2ac1da95493b8563c108abc1f 11-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Avoid use of deprecated functions (CStrInCStrNoCase and StringsEqualNoCase).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93175 91177308-0d34-0410-b5e6-96231b3b80d8
FRefCount.cpp
549ba49e99494d17bcade748696f3f48384a46cb 11-Jan-2010 Ken Dyck <ken.dyck@onsemi.com> Roll out ASTContext::getTypeSizeInChars(), replacing instances of
"ASTContext::getTypeSize() / 8". Replace [u]int64_t variables with CharUnits
ones as appropriate.

Also rename RawType, fromRaw(), and getRaw() in CharUnits to QuantityType,
fromQuantity(), and getQuantity() for clarity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93153 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
emRegion.cpp
tore.cpp
199c3d6cd16aebbb9c7f0d42af9d922c9628bf70 11-Jan-2010 Ken Dyck <ken.dyck@onsemi.com> Roll out ASTContext::getTypeSizeInChars(), replacing instances of
"ASTContext::getTypeSize() / 8". Replace [u]int64_t variables with CharUnits
ones as appropriate.

Also rename RawType, fromRaw(), and getRaw() in CharUnits to QuantityType,
fromQuantity(), and getQuantity() for clarity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93153 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
emRegion.cpp
tore.cpp
64dfe75cd30fdb12d5202f7382c4d45540360920 11-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> Enhance ScanReachableSymbols::scan(). Now another OSAtomic test case passes.
The old test case has a little mistake.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93148 91177308-0d34-0410-b5e6-96231b3b80d8
RState.cpp
951b334069f77c0af424e5ea15b75f4ee17b4583 11-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> Enhance ScanReachableSymbols::scan(). Now another OSAtomic test case passes.
The old test case has a little mistake.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93148 91177308-0d34-0410-b5e6-96231b3b80d8
RState.cpp
c39494f29bb4d12a26ba226a4cfe31d066b44d5c 11-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> Enhance SVals::getAsRegion: get the region that is converted to an integer.
This with previous patch fixes a OSAtomic test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93146 91177308-0d34-0410-b5e6-96231b3b80d8
Vals.cpp
604848a49d2a9c0985225bbe3a39fca223e961bb 11-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> Enhance SVals::getAsRegion: get the region that is converted to an integer.
This with previous patch fixes a OSAtomic test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93146 91177308-0d34-0410-b5e6-96231b3b80d8
Vals.cpp
8a2abfabeea60dafb4a54291291abf3928819866 11-Jan-2010 Ted Kremenek <kremenek@apple.com> Switch RegionStore over to using <BaseRegion+raw offset> to store
value bindings. Along with a small change to OSAtomicChecker, this
resolves <rdar://problem/7527292> and resolves some long-standing
issues with how values can be bound to the same physical address by
not have the same "key". This change is only a beginning; logically
RegionStore needs to better handle loads from addresses where the
stored value is larger/smaller/different type than the loaded value.
We handle these cases in an approximate fashion now (via
CastRetrievedVal and help in SimpleSValuator), but it could be made
much smarter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93137 91177308-0d34-0410-b5e6-96231b3b80d8
SAtomicChecker.cpp
egionStore.cpp
impleSValuator.cpp
tore.cpp
c50e6df965ff264952d8d5805d151f89c89af302 11-Jan-2010 Ted Kremenek <kremenek@apple.com> Switch RegionStore over to using <BaseRegion+raw offset> to store
value bindings. Along with a small change to OSAtomicChecker, this
resolves <rdar://problem/7527292> and resolves some long-standing
issues with how values can be bound to the same physical address by
not have the same "key". This change is only a beginning; logically
RegionStore needs to better handle loads from addresses where the
stored value is larger/smaller/different type than the loaded value.
We handle these cases in an approximate fashion now (via
CastRetrievedVal and help in SimpleSValuator), but it could be made
much smarter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93137 91177308-0d34-0410-b5e6-96231b3b80d8
SAtomicChecker.cpp
egionStore.cpp
impleSValuator.cpp
tore.cpp
95e4c6c2fd37049673775034cb00ec3f252bb584 11-Jan-2010 Ted Kremenek <kremenek@apple.com> Preliminary reworking of value-binding logic in RegionStore:

(1) Introduce a new 'BindingKey' class to match 'BindingValue'. This
gives us the flexibility to change the current key value from 'const
MemRegion*' to something more interesting.

(2) Rework additions/removals/lookups from the store to use new
'Remove', 'Add', 'Lookup' utility methods.

No "real" functionality change; just prep work and abstraction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93136 91177308-0d34-0410-b5e6-96231b3b80d8
egionStore.cpp
1c1ae6bdaf89145648484db5dfebcd04a60595c9 11-Jan-2010 Ted Kremenek <kremenek@apple.com> Preliminary reworking of value-binding logic in RegionStore:

(1) Introduce a new 'BindingKey' class to match 'BindingValue'. This
gives us the flexibility to change the current key value from 'const
MemRegion*' to something more interesting.

(2) Rework additions/removals/lookups from the store to use new
'Remove', 'Add', 'Lookup' utility methods.

No "real" functionality change; just prep work and abstraction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93136 91177308-0d34-0410-b5e6-96231b3b80d8
egionStore.cpp
ca2b94e2ce96eb5807721fa06ad9588a282ec0c7 09-Jan-2010 Ted Kremenek <kremenek@apple.com> Fix overzealous assertion in GRExprEngine::VisitLValue(). A
CallExpr/ObjCMessageExpr can be visited in an "lvalue" context if it
returns a struct temporary. Currently the analyzer doesn't reason
about struct temporary returned by function calls, but we shouldn't
crash here either.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93081 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
4a749b957f28292e8412b7c13b01ca4baeb78d24 09-Jan-2010 Ted Kremenek <kremenek@apple.com> Fix overzealous assertion in GRExprEngine::VisitLValue(). A
CallExpr/ObjCMessageExpr can be visited in an "lvalue" context if it
returns a struct temporary. Currently the analyzer doesn't reason
about struct temporary returned by function calls, but we shouldn't
crash here either.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93081 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
b90e774183a29794af9589e3324dc408dbd3606d 09-Jan-2010 Ted Kremenek <kremenek@apple.com> Fix broken diagnostic when returning the address of a stack-allocated array.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93071 91177308-0d34-0410-b5e6-96231b3b80d8
eturnStackAddressChecker.cpp
7960ec30d794da5de6cd017c728e1151f7b101b9 09-Jan-2010 Ted Kremenek <kremenek@apple.com> Fix broken diagnostic when returning the address of a stack-allocated array.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93071 91177308-0d34-0410-b5e6-96231b3b80d8
eturnStackAddressChecker.cpp
01ecd6f31b707cbb1aa53b73829cd1ae767ba5f5 09-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> When binding an rvalue to a reference, create a temporary object. Use
CXXObjectRegion to represent it.

In Environment, lookup a literal expression before make up a value for it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93047 91177308-0d34-0410-b5e6-96231b3b80d8
nvironment.cpp
RExprEngine.cpp
emRegion.cpp
bc37b8dd9914e02580f531fa6e5e72be34d9675e 09-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> When binding an rvalue to a reference, create a temporary object. Use
CXXObjectRegion to represent it.

In Environment, lookup a literal expression before make up a value for it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93047 91177308-0d34-0410-b5e6-96231b3b80d8
nvironment.cpp
RExprEngine.cpp
emRegion.cpp
75cedc50ba90361c4c37b36010449c8d8fd14a10 08-Jan-2010 Ted Kremenek <kremenek@apple.com> Fix handling in GRExprEngine of 'default' branch in switch statements
when the default case is winnowed down to be infeasible. When all
cases were ruled out (and the analysis state for the default case
would be infeasible) we would still consider the default case
possible. This fixes PR 5969.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93017 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
48569f9562740ac1f4b175cb17ce3d49035402c4 08-Jan-2010 Ted Kremenek <kremenek@apple.com> Fix handling in GRExprEngine of 'default' branch in switch statements
when the default case is winnowed down to be infeasible. When all
cases were ruled out (and the analysis state for the default case
would be infeasible) we would still consider the default case
possible. This fixes PR 5969.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93017 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
4788fa9f8674f14ded9720c548c7d98b76b90eba 05-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> Revert r92318. Instead fix the analyzer: do not call
ASTContext::hasSameUnqualifiedType() when one of the type is VariableArrayType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92723 91177308-0d34-0410-b5e6-96231b3b80d8
Valuator.cpp
5ea95fc163e9fb4fd7506b6a0c26decd67022943 05-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> Revert r92318. Instead fix the analyzer: do not call
ASTContext::hasSameUnqualifiedType() when one of the type is VariableArrayType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92723 91177308-0d34-0410-b5e6-96231b3b80d8
Valuator.cpp
4e96c5d20306d2c645dcd976b0ef677a1906524d 05-Jan-2010 Ted Kremenek <kremenek@apple.com> Make static analysis support for C++ 'this' expression context-sensitive. Essentially treat 'this' as a implicit parameter to the method call, and associate a region with it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92675 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
emRegion.cpp
egionStore.cpp
tore.cpp
de0d26310191215a6d1d189dc419f87af18ce6be 05-Jan-2010 Ted Kremenek <kremenek@apple.com> Make static analysis support for C++ 'this' expression context-sensitive. Essentially treat 'this' as a implicit parameter to the method call, and associate a region with it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92675 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
emRegion.cpp
egionStore.cpp
tore.cpp
be1f166f974c24a0b945cddf82e448d1b7d189ef 05-Jan-2010 Ted Kremenek <kremenek@apple.com> Remove references to 'Checker' and 'GRTransferFuncs' from
GRStateManager. Having these references was an abstraction violation,
as they really should only be known about GRExprEngine.

This change required adding a new 'ProcessAssume' callback in
GRSubEngine. GRExprEngine implements this callback by calling
'EvalAssume' on all registered Checker objects as well as the
registered GRTransferFunc object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92549 91177308-0d34-0410-b5e6-96231b3b80d8
asicConstraintManager.cpp
RExprEngine.cpp
angeConstraintManager.cpp
impleConstraintManager.cpp
impleConstraintManager.h
32a58084a4c53e6938dd81bfce224db25a5976d1 05-Jan-2010 Ted Kremenek <kremenek@apple.com> Remove references to 'Checker' and 'GRTransferFuncs' from
GRStateManager. Having these references was an abstraction violation,
as they really should only be known about GRExprEngine.

This change required adding a new 'ProcessAssume' callback in
GRSubEngine. GRExprEngine implements this callback by calling
'EvalAssume' on all registered Checker objects as well as the
registered GRTransferFunc object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92549 91177308-0d34-0410-b5e6-96231b3b80d8
asicConstraintManager.cpp
RExprEngine.cpp
angeConstraintManager.cpp
impleConstraintManager.cpp
impleConstraintManager.h
d0fd8bfa0dac7de50d82b5ef2d896fc723e1d17a 31-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Let constraint manager inform checkers that some assumption logic has happend.
Add new states for symbolic regions tracked by malloc checker. This enables us
to do malloc checking more accurately. See test case.

Based on Lei Zhang's patch and discussion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92342 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
allocChecker.cpp
impleConstraintManager.cpp
b94b81a9ab46c99b00c7ad28c5e1e212c63fc9ac 31-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Let constraint manager inform checkers that some assumption logic has happend.
Add new states for symbolic regions tracked by malloc checker. This enables us
to do malloc checking more accurately. See test case.

Based on Lei Zhang's patch and discussion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92342 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
allocChecker.cpp
impleConstraintManager.cpp
ab68160c651fb4cf1d92c1152308d701b944af76 30-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Simplify code by using an equivalent template class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92305 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
84eaeffe94ef63a182a02fcf935d4c651caf2359 30-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Simplify code by using an equivalent template class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92305 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
3cc4b35bacf2de5e7ac286b8d0ba949947dc8527 25-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Remove some dead variables clang-analyzer found.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92162 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
54d76db0aa7107597cac0b80d8e138a37e6d1de9 25-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Remove some dead variables clang-analyzer found.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92162 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
ec5251099bf0cabfb6708177daa083c6b59014e8 25-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Fix typo spotted by MSVC.

GRExprEngine.cpp(1348) : warning C4305: 'argument' : truncation from 'clang::ProgramPoint::Kind' to 'bool'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92154 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
9c825c3f77aa46c5cadaf60007598b71c6da3273 25-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Fix typo spotted by MSVC.

GRExprEngine.cpp(1348) : warning C4305: 'argument' : truncation from 'clang::ProgramPoint::Kind' to 'bool'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92154 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
cfaf8bb9f360856d5b90f3d2b84328fd6a58d5f7 24-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> As Ted suggested, record the callsite information with the StackFrameContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92121 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
allInliner.cpp
62d399e1880aacd9dc494fce374245b0da915ada 24-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> As Ted suggested, record the callsite information with the StackFrameContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92121 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
allInliner.cpp
2edf859e96eceb3774acada200b689fb60e185cb 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Enhance dataflow analyses to recognize branch statements in the CFG used as hooks for the initialization of condition variables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92119 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
bfbcefb7e99905218b3f0a895b7bc1992203123b 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Enhance dataflow analyses to recognize branch statements in the CFG used as hooks for the initialization of condition variables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92119 91177308-0d34-0410-b5e6-96231b3b80d8
iveVariables.cpp
13e9f2c45f23062fb42bf1d5198702ac75e1034f 24-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Inter-procedural analysis: now we can return from the callee.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92116 91177308-0d34-0410-b5e6-96231b3b80d8
allInliner.cpp
598278bee8e5797bc73d24d6ac8a1d6ff6413cae 24-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Inter-procedural analysis: now we can return from the callee.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92116 91177308-0d34-0410-b5e6-96231b3b80d8
allInliner.cpp
35a53a2713a3e3bdffdbd8b181f0f7361e4c840f 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Teach GRExprEngine to handle the initialization of the condition variable of a ForStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92114 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
919f0665c35f76636d600f0e351920f6a37ee6cf 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Teach GRExprEngine to handle the initialization of the condition variable of a ForStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92114 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
b21f663f1c88562e894289a3f3b18131862c03de 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Add CFG support for the initializer of the condition variable of a ForStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92113 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
58b87feeaedce7ef09c2931a39d82e5aea189f41 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Add CFG support for the initializer of the condition variable of a ForStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92113 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
9964666226d9b056df767d9ea8f245a16706339e 24-Dec-2009 Ted Kremenek <kremenek@apple.com> CFG tweak: in a WhileStmt, the condition variable initializer is evaluated every time the condition is checked.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92111 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
4ec010a6ccf4db2ab2ef9e68942642d50f7f193c 24-Dec-2009 Ted Kremenek <kremenek@apple.com> CFG tweak: in a WhileStmt, the condition variable initializer is evaluated every time the condition is checked.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92111 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
f7144faebd241d513e5d140db27e55cb3d7d97cc 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Teach GRExprEngine to handle the initialization of the condition variable of a WhileStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92106 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
4c508a12cedcf2896412a3700c1b2a35bf339828 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Teach GRExprEngine to handle the initialization of the condition variable of a WhileStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92106 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
1013bf65bda18e0987d750f9e5e7ef333b560485 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Add CFG support for the initializer of the condition variable of a WhileStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92105 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
76525467cfe07a2cec3a4e58043ec308ae5d67a3 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Add CFG support for the initializer of the condition variable of a WhileStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92105 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
7c087b1efd1375088e9a89c8847ea5503647e184 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Teach GRExprEngine to handle the initialization of the condition variable of a SwitchStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92102 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
fcfb503c280ed8c66d428fed911b2846c0f434fc 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Teach GRExprEngine to handle the initialization of the condition variable of a SwitchStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92102 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
c03b7d83631cb6b355b7ff015cc48cd79eb7396e 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Add CFG support for the initializer of the condition variable of a SwitchStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92101 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
6b501ebaf172b28d6d7e1737db27f915175ad3c8 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Add CFG support for the initializer of the condition variable of a SwitchStmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92101 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
d5f5891b08d7c537d85b229c93cb62dec0749559 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Tidy up FindSubExprAssignments to not deference the child_iterator multiple times.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92087 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
8a69366a1cd8fe1e9fd312048c0d5ce58eabeeb2 24-Dec-2009 Ted Kremenek <kremenek@apple.com> Tidy up FindSubExprAssignments to not deference the child_iterator multiple times.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92087 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
ad1010d663754058b1fa43a0ebe47d27e195d661 23-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> move a few more symbols to .rodata/.data.rel.ro

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92012 91177308-0d34-0410-b5e6-96231b3b80d8
asicObjCFoundationChecks.cpp
2550d70aabb5f603e8f74cc5fb6a69a7af5b51f3 23-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> move a few more symbols to .rodata/.data.rel.ro

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92012 91177308-0d34-0410-b5e6-96231b3b80d8
asicObjCFoundationChecks.cpp
a48a9f6d615af246eb18b93ccfd11aa087bc1403 23-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Migrate the call inliner to the Checker interface.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91991 91177308-0d34-0410-b5e6-96231b3b80d8
allInliner.cpp
3ff8481f4be3f30e1082488238d83f78342303e1 23-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Migrate the call inliner to the Checker interface.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91991 91177308-0d34-0410-b5e6-96231b3b80d8
allInliner.cpp
7c14a9dd4e4d118c73bff2edc95abe74a699b626 23-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> For inter-procedural analysis, predecessor node may be in another function.
So we should use the current program point.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91989 91177308-0d34-0410-b5e6-96231b3b80d8
RCoreEngine.cpp
cb74d720b89b68bb2ecf2827d0e2eb66d236ab85 23-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> For inter-procedural analysis, predecessor node may be in another function.
So we should use the current program point.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91989 91177308-0d34-0410-b5e6-96231b3b80d8
RCoreEngine.cpp
6c07b30ca5bdf6416e1177c47f365ca444a42ae5 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Add CFG support for the condition variable that can appear in IfStmts in C++ mode.
Add transfer function support in GRExprEngine for IfStmts with initialized condition variables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91987 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
RExprEngine.cpp
61dfbecd8e6181b2ba42ffb5feede27a2bab3b8a 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Add CFG support for the condition variable that can appear in IfStmts in C++ mode.
Add transfer function support in GRExprEngine for IfStmts with initialized condition variables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91987 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
RExprEngine.cpp
ee28f4df45bf1351b9ddce4f56bc237559d03fab 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Suppress dead store warnings involving objects initialized with CXXExprTemporaries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91986 91177308-0d34-0410-b5e6-96231b3b80d8
heckDeadStores.cpp
604d939ac15d1398761df313679673d30bb10f27 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Suppress dead store warnings involving objects initialized with CXXExprTemporaries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91986 91177308-0d34-0410-b5e6-96231b3b80d8
heckDeadStores.cpp
0e32ef9ae2d9bd142f0b69a594663e5f806f8a84 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Add stack trace pretty printing in GRExprEngine::VisitLValue().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91985 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
e59df87e787d4dc53e6a1af29e89d3ea1839ef0b 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Add stack trace pretty printing in GRExprEngine::VisitLValue().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91985 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
199194e4c47003ead665fed011348be4bc500210 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Teach GRExprEngine::VisitLValue to ignore CXXExprWithTempories (for now).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91982 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
c8be365b65912ebba182c39ccee4fc5c2fc7572c 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Teach GRExprEngine::VisitLValue to ignore CXXExprWithTempories (for now).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91982 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
84f5e5b118d531fe2e3e2d79a1857e5713895f3d 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Fix PR 5857. When casting from a symbolic region to an integer back to a pointer value, we were not correctly layering the correct ElementRegion on the original SymbolicRegion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91981 91177308-0d34-0410-b5e6-96231b3b80d8
Valuator.cpp
5bbc8e76408af22a0c706a4199c684bf5f5a5cb3 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Fix PR 5857. When casting from a symbolic region to an integer back to a pointer value, we were not correctly layering the correct ElementRegion on the original SymbolicRegion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91981 91177308-0d34-0410-b5e6-96231b3b80d8
Valuator.cpp
b87ff8b9c81472c8b8757a7e5e7613cbb619b462 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Teach GRExprEngine::VisitLValue that we don't handle CXXZeroInitValueExprs yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91970 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
7931c93a0a72347f0433a2a270525d3a5c61c9ba 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Teach GRExprEngine::VisitLValue that we don't handle CXXZeroInitValueExprs yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91970 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
f2d8275a51e59bbef5645272904bc5f4155188b3 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Also treat the type of the subexpression as a pointer in GRExprEngine::VisitCast when the expression is handled as an lvalue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91969 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
077a40df258beb46cb746af61da115e9718a6aff 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Also treat the type of the subexpression as a pointer in GRExprEngine::VisitCast when the expression is handled as an lvalue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91969 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
961cde695946e621f3395e88c37aded954411f17 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Add basic support for analyzing CastExprs as lvalues.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91952 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
949bdb43bf370b23a79a37b017e0a0566c0d66e0 23-Dec-2009 Ted Kremenek <kremenek@apple.com> Add basic support for analyzing CastExprs as lvalues.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91952 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
3c3ae1bef092924a9ea3bef0efa7627199c48c0a 22-Dec-2009 Ted Kremenek <kremenek@apple.com> Add transfer functions support for visiting an Objective-C message expression as an lvalue when the return type is a C++ reference.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91926 91177308-0d34-0410-b5e6-96231b3b80d8
FRefCount.cpp
RExprEngine.cpp
38ac4f504bf8ed514520b5a82be538bdb0860687 22-Dec-2009 Ted Kremenek <kremenek@apple.com> Add transfer functions support for visiting an Objective-C message expression as an lvalue when the return type is a C++ reference.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91926 91177308-0d34-0410-b5e6-96231b3b80d8
FRefCount.cpp
RExprEngine.cpp
52638fa346aa62af54ed5f58c271a2c632d37f0b 21-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Add comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91818 91177308-0d34-0410-b5e6-96231b3b80d8
egionStore.cpp
944ebc63c7b995864982366f31c07685d2aed509 21-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Add comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91818 91177308-0d34-0410-b5e6-96231b3b80d8
egionStore.cpp
bd755940f7de50660978e012ab5ccaecf579a382 19-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Use the FunctionDecl's result type to know exactly if it returns a reference.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91751 91177308-0d34-0410-b5e6-96231b3b80d8
FRefCount.cpp
910e4080986045cc2036f8d1f55398acc7fbb257 19-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Use the FunctionDecl's result type to know exactly if it returns a reference.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91751 91177308-0d34-0410-b5e6-96231b3b80d8
FRefCount.cpp
4152c0cbdd7437911de1a131c6c09dfbf30e4215 18-Dec-2009 Ted Kremenek <kremenek@apple.com> Enhance GRExprEngine::VisitCallExpr() to be used in an lvalue context. Uncovered a new failing test case along the way, but we're making progress on handling C++ references in the analyzer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91710 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
53287518f69b8f06f82a6cdbd13e4e3a13b58186 18-Dec-2009 Ted Kremenek <kremenek@apple.com> Enhance GRExprEngine::VisitCallExpr() to be used in an lvalue context. Uncovered a new failing test case along the way, but we're making progress on handling C++ references in the analyzer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91710 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
26cf15c28cfa72c8111388d97a439b84b9453d78 17-Dec-2009 Ted Kremenek <kremenek@apple.com> Tweak formatting and comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91615 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
7f14e6f23b0899ed0969cbebef7785f00d488372 17-Dec-2009 Ted Kremenek <kremenek@apple.com> Tweak formatting and comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91615 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
78d7c2f5d1fb0c6c34beba1899a83fa45e34796c 17-Dec-2009 Ted Kremenek <kremenek@apple.com> Convert GRExprEngine::VisitCallExpr() to use a worklist instead of recursion to evaluate the arguments of a CallExpr. This simplifies the logic and makes it easier to read. (it also avoids any issues with blowing out the stack if the CallExpr had a ridiculous number of arguments)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91613 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
3cead901aab394fe8e84953235959ece8002854f 17-Dec-2009 Ted Kremenek <kremenek@apple.com> Convert GRExprEngine::VisitCallExpr() to use a worklist instead of recursion to evaluate the arguments of a CallExpr. This simplifies the logic and makes it easier to read. (it also avoids any issues with blowing out the stack if the CallExpr had a ridiculous number of arguments)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91613 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
2093dc09537dc4448f45276721d5d355642d65c4 17-Dec-2009 Ted Kremenek <kremenek@apple.com> Reduce nesting by using early exits. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91610 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
5974ec518289a719fdd18122060bbcfe49d439e3 17-Dec-2009 Ted Kremenek <kremenek@apple.com> Reduce nesting by using early exits. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91610 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
72a284d92ba00daa51e10d48c17f2205548c95be 17-Dec-2009 Ted Kremenek <kremenek@apple.com> Sort switch statement. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91591 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
82a64e501d50513d403e9293c54fca228a2645a6 17-Dec-2009 Ted Kremenek <kremenek@apple.com> Sort switch statement. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91591 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
67f904fc58551df0a00b4c3928cc9210978bc36a 17-Dec-2009 Ted Kremenek <kremenek@apple.com> Fix check in GRExprEngine for the 'main' function to handle NULL IdentifierInfo*'s.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91577 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
5f75f92a9c2e6e3ad8fbb08532b6e5852d785b60 17-Dec-2009 Ted Kremenek <kremenek@apple.com> Fix check in GRExprEngine for the 'main' function to handle NULL IdentifierInfo*'s.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91577 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
ed14e87ed8e5e9f8b78e9dce7015ec09e1f7774d 17-Dec-2009 Ted Kremenek <kremenek@apple.com> Completely remove ObjCObjectRegion (tests pass this time).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91572 91177308-0d34-0410-b5e6-96231b3b80d8
asicStore.cpp
emRegion.cpp
egionStore.cpp
tore.cpp
c410d4d2bb2de2c186fb48857e99e7809e780081 17-Dec-2009 Ted Kremenek <kremenek@apple.com> Completely remove ObjCObjectRegion (tests pass this time).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91572 91177308-0d34-0410-b5e6-96231b3b80d8
asicStore.cpp
emRegion.cpp
egionStore.cpp
tore.cpp
3f458c766bf307eada14de134ab22cdc130feb1a 16-Dec-2009 Ted Kremenek <kremenek@apple.com> Temporarily revert 91553.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91557 91177308-0d34-0410-b5e6-96231b3b80d8
asicStore.cpp
a07cb9364de3c790c866e94652b6c95f3212f540 16-Dec-2009 Ted Kremenek <kremenek@apple.com> Temporarily revert 91553.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91557 91177308-0d34-0410-b5e6-96231b3b80d8
asicStore.cpp
25c0006c300c3e3dd4f4f68d52bfffc9a89f8468 16-Dec-2009 Ted Kremenek <kremenek@apple.com> Remove use of ObjCObjectRegion from BasicStoreManager.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91553 91177308-0d34-0410-b5e6-96231b3b80d8
asicStore.cpp
bc73b597ed395c01c2fe7229230367990cb7ebea 16-Dec-2009 Ted Kremenek <kremenek@apple.com> Remove use of ObjCObjectRegion from BasicStoreManager.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91553 91177308-0d34-0410-b5e6-96231b3b80d8
asicStore.cpp
4b6b478c90cba52c7d9b130d53c462c6fa8df456 16-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Add a new kind of region: CXXObjectRegion. Currently it has only one
attribute: the object type.
Add initial support for visiting CXXThisExpr.
Fix a bunch of 80-col violations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91535 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
emRegion.cpp
egionStore.cpp
tore.cpp
bb141217871e93767aa3f2de1b9946fa6d37066a 16-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Add a new kind of region: CXXObjectRegion. Currently it has only one
attribute: the object type.
Add initial support for visiting CXXThisExpr.
Fix a bunch of 80-col violations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91535 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
emRegion.cpp
egionStore.cpp
tore.cpp
81fff9b4cf00cd7ab30cbd3a977df3868a925169 16-Dec-2009 Ted Kremenek <kremenek@apple.com> Teach RetainSummaryManager::getSummary(FunctionDecl* FD) that 'FD->getIdentifier()' will not always return a non-null IdentifierInfo*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91512 91177308-0d34-0410-b5e6-96231b3b80d8
FRefCount.cpp
48c6d181dfcba412ae4b9e1dab59205913018806 16-Dec-2009 Ted Kremenek <kremenek@apple.com> Teach RetainSummaryManager::getSummary(FunctionDecl* FD) that 'FD->getIdentifier()' will not always return a non-null IdentifierInfo*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91512 91177308-0d34-0410-b5e6-96231b3b80d8
FRefCount.cpp
a5028a98d26397de17b4df8cdc7352629ca0fe24 16-Dec-2009 Ted Kremenek <kremenek@apple.com> Teach OSAtomicChecker that a FunctionDecl's name isn't always a simple IdentifierInfo*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91511 91177308-0d34-0410-b5e6-96231b3b80d8
SAtomicChecker.cpp
a0f7727abd351646a4c7efe38c563a894bcf5403 16-Dec-2009 Ted Kremenek <kremenek@apple.com> Teach OSAtomicChecker that a FunctionDecl's name isn't always a simple IdentifierInfo*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91511 91177308-0d34-0410-b5e6-96231b3b80d8
SAtomicChecker.cpp
ddf272269c7ac29975c8dc7583515c9b73cd6113 16-Dec-2009 Ted Kremenek <kremenek@apple.com> Teach NoReturnFunctionChecker that FunctionDecl::getIdentifier() is not guaranteed to return a non-null IdentifierInfo*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91510 91177308-0d34-0410-b5e6-96231b3b80d8
oReturnFunctionChecker.cpp
b01a322ed6bc20e08b6a25b070070aac2eb5dd9e 16-Dec-2009 Ted Kremenek <kremenek@apple.com> Teach NoReturnFunctionChecker that FunctionDecl::getIdentifier() is not guaranteed to return a non-null IdentifierInfo*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91510 91177308-0d34-0410-b5e6-96231b3b80d8
oReturnFunctionChecker.cpp
4e666bcfd58bbec6b5d31974226ed37266971423 16-Dec-2009 Ted Kremenek <kremenek@apple.com> Add (initial?) static analyzer support for handling C++ references.
This change was a lot bigger than I originally anticipated; among
other things it requires us storing more information in the CFG to
record what block-level expressions need to be evaluated as lvalues.

The big change is that CFGBlocks no longer contain Stmt*'s by
CFGElements. Currently CFGElements just wrap Stmt*, but they also
store a bit indicating whether the block-level expression should be
evalauted as an lvalue. DeclStmts involving the initialization of a
reference require us treating the initialization expression as an
lvalue, even though that information isn't recorded in the AST.
Conceptually this change isn't that complicated, but it required
bubbling up the data through the CFGBuilder, to GRCoreEngine, and
eventually to GRExprEngine.

The addition of CFGElement is also useful for when we want to handle
more control-flow constructs or other data we want to keep in the CFG
that isn't represented well with just a block of statements.

In GRExprEngine, this patch introduces logic for evaluating the
lvalues of references, which currently retrieves the internal "pointer
value" that the reference represents. EvalLoad does a two stage load
to catch null dereferences involving an invalid reference (although
this could possibly be caught earlier during the initialization of a
reference).

Symbols are currently symbolicated using the reference type, instead
of a pointer type, and special handling is required creating
ElementRegions that layer on SymbolicRegions (see the changes to
RegionStoreManager).

Along the way, the DeadStoresChecker also silences warnings involving
dead stores to references. This was the original change I introduced
(which I wrote test cases for) that I realized caused GRExprEngine to
crash.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91501 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
heckDeadStores.cpp
RCoreEngine.cpp
RExprEngine.cpp
egionStore.cpp
tore.cpp
852274d4257134906995cb252fb3dfd2d71deae8 16-Dec-2009 Ted Kremenek <kremenek@apple.com> Add (initial?) static analyzer support for handling C++ references.
This change was a lot bigger than I originally anticipated; among
other things it requires us storing more information in the CFG to
record what block-level expressions need to be evaluated as lvalues.

The big change is that CFGBlocks no longer contain Stmt*'s by
CFGElements. Currently CFGElements just wrap Stmt*, but they also
store a bit indicating whether the block-level expression should be
evalauted as an lvalue. DeclStmts involving the initialization of a
reference require us treating the initialization expression as an
lvalue, even though that information isn't recorded in the AST.
Conceptually this change isn't that complicated, but it required
bubbling up the data through the CFGBuilder, to GRCoreEngine, and
eventually to GRExprEngine.

The addition of CFGElement is also useful for when we want to handle
more control-flow constructs or other data we want to keep in the CFG
that isn't represented well with just a block of statements.

In GRExprEngine, this patch introduces logic for evaluating the
lvalues of references, which currently retrieves the internal "pointer
value" that the reference represents. EvalLoad does a two stage load
to catch null dereferences involving an invalid reference (although
this could possibly be caught earlier during the initialization of a
reference).

Symbols are currently symbolicated using the reference type, instead
of a pointer type, and special handling is required creating
ElementRegions that layer on SymbolicRegions (see the changes to
RegionStoreManager).

Along the way, the DeadStoresChecker also silences warnings involving
dead stores to references. This was the original change I introduced
(which I wrote test cases for) that I realized caused GRExprEngine to
crash.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91501 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
heckDeadStores.cpp
RCoreEngine.cpp
RExprEngine.cpp
egionStore.cpp
tore.cpp
3c919b55e4024676b4e5858c4f78ab74330aab0a 16-Dec-2009 Ted Kremenek <kremenek@apple.com> Remove ValueManager::getRegionValueSymbolValOrUnknown(). It was just extra veneer on top of getRegionValueSymbolVal().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91471 91177308-0d34-0410-b5e6-96231b3b80d8
egionStore.cpp
28172a27c0fb69439170aab53127582432e7d5a0 16-Dec-2009 Ted Kremenek <kremenek@apple.com> Remove ValueManager::getRegionValueSymbolValOrUnknown(). It was just extra veneer on top of getRegionValueSymbolVal().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91471 91177308-0d34-0410-b5e6-96231b3b80d8
egionStore.cpp
dbf0031fbbd30144c3ac070baa4f2d0e551a8de9 15-Dec-2009 Chris Lattner <sabre@nondot.org> update to match LLVM API change:

Remove isPod() from DenseMapInfo, splitting it out to its own
isPodLike type trait. This is a generally useful type trait for
more than just DenseMap, and we really care about whether something
acts like a pod, not whether it really is a pod.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91422 91177308-0d34-0410-b5e6-96231b3b80d8
FRefCount.cpp
06159e878569e5f39bf0e8f11b84ac3ad0970597 15-Dec-2009 Chris Lattner <sabre@nondot.org> update to match LLVM API change:

Remove isPod() from DenseMapInfo, splitting it out to its own
isPodLike type trait. This is a generally useful type trait for
more than just DenseMap, and we really care about whether something
acts like a pod, not whether it really is a pod.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91422 91177308-0d34-0410-b5e6-96231b3b80d8
FRefCount.cpp
c8d19013af4eabd3c1c121d60b9c90667a043847 15-Dec-2009 Ted Kremenek <kremenek@apple.com> Until we can make the dead stores checker smarter, dont' emit dead store warnings for C++ objects (whose constructors/destructors have possible side-effects).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91412 91177308-0d34-0410-b5e6-96231b3b80d8
heckDeadStores.cpp
43f19e3136a9610eeba3cdef9f9af70d93df2f7e 15-Dec-2009 Ted Kremenek <kremenek@apple.com> Until we can make the dead stores checker smarter, dont' emit dead store warnings for C++ objects (whose constructors/destructors have possible side-effects).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91412 91177308-0d34-0410-b5e6-96231b3b80d8
heckDeadStores.cpp
e4412c3743467daddea5aa4c014d6d96f8f8067c 15-Dec-2009 Ted Kremenek <kremenek@apple.com> Start the ball rolling on C++ support in the static analyzer. For
now, don't construct CFGs that contain C++ try/catch statements, and
have GRExprEngine abort a path if it encounters a C++ construct it
doesn't understand (which is mostly everything at this point).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91389 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
RExprEngine.cpp
c768a0c46e6c064c3281d663777ee95aea8652ee 15-Dec-2009 Ted Kremenek <kremenek@apple.com> Start the ball rolling on C++ support in the static analyzer. For
now, don't construct CFGs that contain C++ try/catch statements, and
have GRExprEngine abort a path if it encounters a C++ construct it
doesn't understand (which is mostly everything at this point).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91389 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
RExprEngine.cpp
ff583e4255851c3937219043280a559e8db2171f 14-Dec-2009 Ted Kremenek <kremenek@apple.com> Fix: <rdar://problem/7468209> SymbolManager::isLive() should not crash on captured block variables that are passed by reference


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91348 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
emRegion.cpp
ymbolManager.cpp
5348f94abd0e9d3945da8d059b55b156967e8ff9 14-Dec-2009 Ted Kremenek <kremenek@apple.com> Fix: <rdar://problem/7468209> SymbolManager::isLive() should not crash on captured block variables that are passed by reference


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91348 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
emRegion.cpp
ymbolManager.cpp
27838674b7b4bfe779ff0bd0617cb601a9969855 14-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Use insert to avoid destroying existing nodes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91258 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
7fbb1ba55857d9029eb13d1d3e51dd97f2d96372 14-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Use insert to avoid destroying existing nodes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91258 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
90bb3c80b527a01ce754028bfb1d71b7a02e725b 12-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Add initial support for realloc() in MallocChecker.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91216 91177308-0d34-0410-b5e6-96231b3b80d8
allocChecker.cpp
d9c84c8381261530b16512d2aac146de8271ea1e 12-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Add initial support for realloc() in MallocChecker.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91216 91177308-0d34-0410-b5e6-96231b3b80d8
allocChecker.cpp
9d02e7c5fa4e30ceb52a2956c0018ec41a5b6da0 12-Dec-2009 Jeffrey Yasskin <jyasskin@google.com> Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gave
no extra safety anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91207 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
9f61aa9e280adea9fbf3365f0e4f6ed568c9885a 12-Dec-2009 Jeffrey Yasskin <jyasskin@google.com> Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gave
no extra safety anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91207 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
9231e43928c9ffe90466b88930e212140b288e55 11-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Switch PathDiagnostic to StringRef.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91155 91177308-0d34-0410-b5e6-96231b3b80d8
athDiagnostic.cpp
d8e494faa9f4bc13cd0a136b4d1ee1cfd52860ea 11-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Switch PathDiagnostic to StringRef.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91155 91177308-0d34-0410-b5e6-96231b3b80d8
athDiagnostic.cpp
b9bfc6676906c75287b353ee529a8b9e41a4b1a7 11-Dec-2009 Ted Kremenek <kremenek@apple.com> Enhance understanding of VarRegions referenced by a block whose declarations are outside the current stack frame. Fixes <rdar://problem/7462324>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91107 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
emRegion.cpp
egionStore.cpp
tore.cpp
2b87ae45e129b941d0a4d221c9d4842385a119bd 11-Dec-2009 Ted Kremenek <kremenek@apple.com> Enhance understanding of VarRegions referenced by a block whose declarations are outside the current stack frame. Fixes <rdar://problem/7462324>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91107 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
emRegion.cpp
egionStore.cpp
tore.cpp
3dd9bde687b8fcbaadeb5aff2a3b328a28291bb3 11-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Completely evaluate malloc/free in MallocChecker.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91100 91177308-0d34-0410-b5e6-96231b3b80d8
allocChecker.cpp
a49c6b7da5684e061612de70b62fe892b67f35c4 11-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Completely evaluate malloc/free in MallocChecker.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91100 91177308-0d34-0410-b5e6-96231b3b80d8
allocChecker.cpp
be929e74726822dad9b6b89e8e08e762bcc262dc 11-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Use 'class' instead of 'struct'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91085 91177308-0d34-0410-b5e6-96231b3b80d8
allocChecker.cpp
7fb1464c99c6e2f44ce9f41fd5de9edd15c1e45d 11-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Use 'class' instead of 'struct'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91085 91177308-0d34-0410-b5e6-96231b3b80d8
allocChecker.cpp
56328737fb421ef5a295ba98027c033d17b3d879 10-Dec-2009 Ted Kremenek <kremenek@apple.com> Fix null dereference in OSAtomicChecker and special case SymbolicRegions. We still aren't handling them correctly; I've added to failing test cases to test/Analysis/NSString-failed-cases.m that should pass and then be merged in to test/Analysis/NSString.m.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90993 91177308-0d34-0410-b5e6-96231b3b80d8
SAtomicChecker.cpp
6bcd5a04db4eb9d51e7f92a4edc418737a5aeefd 10-Dec-2009 Ted Kremenek <kremenek@apple.com> Fix null dereference in OSAtomicChecker and special case SymbolicRegions. We still aren't handling them correctly; I've added to failing test cases to test/Analysis/NSString-failed-cases.m that should pass and then be merged in to test/Analysis/NSString.m.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90993 91177308-0d34-0410-b5e6-96231b3b80d8
SAtomicChecker.cpp
b921fd382783460ee0514c914175a7a20458acda 09-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Refactor OSAtomic evaluation logic into OSAtomicChecker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90968 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
RExprEngine.cpp
RExprEngineInternalChecks.h
SAtomicChecker.cpp
1ec4e976113ac56c0b3d96f484613d1dc62c3f85 09-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Refactor OSAtomic evaluation logic into OSAtomicChecker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90968 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
RExprEngine.cpp
RExprEngineInternalChecks.h
SAtomicChecker.cpp
3fc72b190e4333455ec1959faca776e962181cc7 09-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Use a temporary destination set such that we can clear fake auto transitions.
Otherwise, even when real evaluation occurs, the previous fake auto
transitions would still be in the destination set, causing fake state
bifurcation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90967 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
78c98fad2cf17629b8659fe680ad92a548d1a5ea 09-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Use a temporary destination set such that we can clear fake auto transitions.
Otherwise, even when real evaluation occurs, the previous fake auto
transitions would still be in the destination set, causing fake state
bifurcation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90967 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
1ccb66b8336fafc5945ee4fb440655f8831cf41a 09-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> OSAtomic simulation: use the original region as the location to load from,
instead of the ElementRegion obtained from casts.

Test cast: the leak cannot occur bacause the true branch cannot be taken.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90964 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
tore.cpp
2f4a6b25a7409f6f05e8a5e6864de21a337c8958 09-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> OSAtomic simulation: use the original region as the location to load from,
instead of the ElementRegion obtained from casts.

Test cast: the leak cannot occur bacause the true branch cannot be taken.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90964 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
tore.cpp
a2c3f86e60aa1d65d61481c60553a23958ebc105 09-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90953 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
a92bd303a6aed5cf12de5f76938c112b00cc06e6 09-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90953 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
4bdb5865d167293e8fc333de190239ee1a1624ea 09-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Insert instead of assign to the dest node set, since we use the dest node set
repeatedly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90952 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
9f68ea2a150b3e7a9c97aa4a79ce559550945cae 09-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Insert instead of assign to the dest node set, since we use the dest node set
repeatedly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90952 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
8e35441ec36211c98a6e79d4ca701677fffa6cdd 09-Dec-2009 Ted Kremenek <kremenek@apple.com> Fix a horrid bug in GRExprEngine::CheckerVisit() that was identified
by the test case in PR 5627. Essentially we shouldn't clear the
ExplodedNodeSet where we deposit newly constructed nodes if that set
is the 'Dst' set passed in. It is not okay to clear that set because
it may already contain nodes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90931 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
17f4da8f150f6b9dfb571cebd6299b06948e5385 09-Dec-2009 Ted Kremenek <kremenek@apple.com> Fix a horrid bug in GRExprEngine::CheckerVisit() that was identified
by the test case in PR 5627. Essentially we shouldn't clear the
ExplodedNodeSet where we deposit newly constructed nodes if that set
is the 'Dst' set passed in. It is not okay to clear that set because
it may already contain nodes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90931 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
52d6820d09b266681d0b010ffe44e11dadcf0ae6 08-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Refactor builtin function evaluation into a checker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90847 91177308-0d34-0410-b5e6-96231b3b80d8
uiltinFunctionChecker.cpp
MakeLists.txt
RExprEngine.cpp
RExprEngineInternalChecks.h
7c9624ba29bc700c3aa6c65c5363174a890c534e 08-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Refactor builtin function evaluation into a checker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90847 91177308-0d34-0410-b5e6-96231b3b80d8
uiltinFunctionChecker.cpp
MakeLists.txt
RExprEngine.cpp
RExprEngineInternalChecks.h
a8de3531caf928a9b1fd5561884b0e2a39ac64e6 07-Dec-2009 Ted Kremenek <kremenek@apple.com> Add analysis support for blocks. This includes a few key changes:

- Refactor the MemRegion hierarchy to distinguish between different StackSpaceRegions for locals and parameters.
- VarRegions for "captured" variables now have the BlockDataRegion as their super region (except those passed by reference)
- Add transfer function support to GRExprEngine for BlockDeclRefExprs.

This change also supports analyzing blocks as an analysis entry point
(top-of-the-stack), which required pushing more context-sensitivity
around in the MemRegion hierarchy via the use of LocationContext
objects. Functionally almost everything is the same, except we track
LocationContexts in a few more areas and StackSpaceRegions now refer
to a StackFrameContext object. In the future we will need to modify
MemRegionManager to allow multiple StackSpaceRegions in flight at once
(for the analysis of multiple stack frames).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90809 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
asicStore.cpp
FRefCount.cpp
RExprEngine.cpp
emRegion.cpp
egionStore.cpp
tore.cpp
alueManager.cpp
67d1287035767f4f6c8ca0c2bb755990012a44ca 07-Dec-2009 Ted Kremenek <kremenek@apple.com> Add analysis support for blocks. This includes a few key changes:

- Refactor the MemRegion hierarchy to distinguish between different StackSpaceRegions for locals and parameters.
- VarRegions for "captured" variables now have the BlockDataRegion as their super region (except those passed by reference)
- Add transfer function support to GRExprEngine for BlockDeclRefExprs.

This change also supports analyzing blocks as an analysis entry point
(top-of-the-stack), which required pushing more context-sensitivity
around in the MemRegion hierarchy via the use of LocationContext
objects. Functionally almost everything is the same, except we track
LocationContexts in a few more areas and StackSpaceRegions now refer
to a StackFrameContext object. In the future we will need to modify
MemRegionManager to allow multiple StackSpaceRegions in flight at once
(for the analysis of multiple stack frames).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90809 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
asicStore.cpp
FRefCount.cpp
RExprEngine.cpp
emRegion.cpp
egionStore.cpp
tore.cpp
alueManager.cpp
aec57a159a6191047eaf49d9ab79e6e6328ca76a 07-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Add EvalCallExpr interface to checker, and migrate the no-return function
handler to this interface.
GRExprEngine::CheckerEvalCall() will return true if one of the checkers has
processed the node. In the future this might return void when we have some
default checker.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90755 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
RExprEngine.cpp
RExprEngineInternalChecks.h
oReturnFunctionChecker.cpp
935ef90f4b065c7c865ee5b2a99c5f9b1a115d72 07-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Add EvalCallExpr interface to checker, and migrate the no-return function
handler to this interface.
GRExprEngine::CheckerEvalCall() will return true if one of the checkers has
processed the node. In the future this might return void when we have some
default checker.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90755 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
RExprEngine.cpp
RExprEngineInternalChecks.h
oReturnFunctionChecker.cpp
f79b5db438a6618afe7cfb57a1b1c63d92fedbd8 04-Dec-2009 Ted Kremenek <kremenek@apple.com> Teach AnalysisContext::getBody() about BlockDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90585 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
30a45344c827a8346f6ecfda56b7811d1e031767 04-Dec-2009 Ted Kremenek <kremenek@apple.com> Teach AnalysisContext::getBody() about BlockDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90585 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
8c28cc9dddc43a185eba21883c2970e6eaa8ea7d 04-Dec-2009 Ted Kremenek <kremenek@apple.com> Teach 'ExecutionContinues' (part of BugReporter's diagnostic generation) about BlockDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90584 91177308-0d34-0410-b5e6-96231b3b80d8
ugReporter.cpp
4f1db537722e8d46146cd95f5962a6dcf6e44e54 04-Dec-2009 Ted Kremenek <kremenek@apple.com> Teach 'ExecutionContinues' (part of BugReporter's diagnostic generation) about BlockDecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90584 91177308-0d34-0410-b5e6-96231b3b80d8
ugReporter.cpp
a83dd9ed416916d004d30a2e1e9ecbc34f81c3ac 04-Dec-2009 Ted Kremenek <kremenek@apple.com> Include BlockDeclRefExprs in constructed CFGs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90583 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
224451bf4ec994e51cdfd994eda3ed1b6a0dae3e 04-Dec-2009 Ted Kremenek <kremenek@apple.com> Include BlockDeclRefExprs in constructed CFGs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90583 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
38ded47e4b3634cf0a45fa06ee66c2aef77bc08e 04-Dec-2009 Ted Kremenek <kremenek@apple.com> Replace SymbolReaper::isLive(VarDecl) with SymbolReaper::isLive(VarRegion).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90582 91177308-0d34-0410-b5e6-96231b3b80d8
asicStore.cpp
egionStore.cpp
ymbolManager.cpp
edeb5b6b50e773b243e0ee0d84589cd1f7dea9b0 04-Dec-2009 Ted Kremenek <kremenek@apple.com> Replace SymbolReaper::isLive(VarDecl) with SymbolReaper::isLive(VarRegion).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90582 91177308-0d34-0410-b5e6-96231b3b80d8
asicStore.cpp
egionStore.cpp
ymbolManager.cpp
1e701d6da32716d9dba79bc092366925e216dc29 04-Dec-2009 Ted Kremenek <kremenek@apple.com> Rename instance variable to avoid name conflict with parameters, and modify addTransition() to compare the correct state values.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90552 91177308-0d34-0410-b5e6-96231b3b80d8
hecker.cpp
bfb4fc9ebc64ec3db597441d4b79adcd0f69cf58 04-Dec-2009 Ted Kremenek <kremenek@apple.com> Rename instance variable to avoid name conflict with parameters, and modify addTransition() to compare the correct state values.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90552 91177308-0d34-0410-b5e6-96231b3b80d8
hecker.cpp
7969eed168f037095da9e0ded43eaa0728e1a846 04-Dec-2009 Ted Kremenek <kremenek@apple.com> Allow BlockInvocationContext to wrap either a BlockDecl* or a BlockDataRegion*, giving us choice in our degree of context-sensitivity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90516 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
d02e83a548359df978f40cc1a52ffd78b7ef371b 04-Dec-2009 Ted Kremenek <kremenek@apple.com> Allow BlockInvocationContext to wrap either a BlockDecl* or a BlockDataRegion*, giving us choice in our degree of context-sensitivity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90516 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
e58ebf3b717db406dc9e434b41a771c856e0af05 04-Dec-2009 Ted Kremenek <kremenek@apple.com> Refactor LocationContext creation logic into a single member template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90509 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
0ee4124012950d7bb853438629b8e7652febf183 04-Dec-2009 Ted Kremenek <kremenek@apple.com> Refactor LocationContext creation logic into a single member template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90509 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
7db88c68869b191692ce35df151fcbc555221980 04-Dec-2009 Ted Kremenek <kremenek@apple.com> Refactor FoldingSet profiling code for LocationContexts, and add a new BlockInvocationContext to represent the invocation of a block.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90506 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
dc0d909f0f6684159c8475db1a15967e5613cb27 04-Dec-2009 Ted Kremenek <kremenek@apple.com> Refactor FoldingSet profiling code for LocationContexts, and add a new BlockInvocationContext to represent the invocation of a block.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90506 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisContext.cpp
361a02d9d9de6cb533fca1254d574494b2bce55c 04-Dec-2009 Ted Kremenek <kremenek@apple.com> constify MemRegion* returned by MemRegionManager::getXXXRegion() methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90503 91177308-0d34-0410-b5e6-96231b3b80d8
emRegion.cpp
egionStore.cpp
alueManager.cpp
b48ad64a0e9e8d6488adebe597b6af32c1eb84f4 04-Dec-2009 Ted Kremenek <kremenek@apple.com> constify MemRegion* returned by MemRegionManager::getXXXRegion() methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90503 91177308-0d34-0410-b5e6-96231b3b80d8
emRegion.cpp
egionStore.cpp
alueManager.cpp
94eeea38304ad9771cf2cff3326f9121a92246d7 04-Dec-2009 Ted Kremenek <kremenek@apple.com> More template-logic for MemRegion construction out of MemRegion.h and into MemRegion.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90499 91177308-0d34-0410-b5e6-96231b3b80d8
emRegion.cpp
bcd7f9f8cb2f1b78e8ad991677a4364044e1deb7 04-Dec-2009 Ted Kremenek <kremenek@apple.com> More template-logic for MemRegion construction out of MemRegion.h and into MemRegion.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90499 91177308-0d34-0410-b5e6-96231b3b80d8
emRegion.cpp
54f13d4068dd54a710fb1b75a515b41b27ca7f65 03-Dec-2009 Ted Kremenek <kremenek@apple.com> Tweak handling of BlockDataRegions in RegionStoreManager::RemoveDeadBindings(): only the VarRegions for variables marked with the '__block' annotation should have their lifetime extended by a BlockDataRegion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90462 91177308-0d34-0410-b5e6-96231b3b80d8
egionStore.cpp
a7a8dfd702274fd19ef8b237682b75d814ecfc91 03-Dec-2009 Ted Kremenek <kremenek@apple.com> Tweak handling of BlockDataRegions in RegionStoreManager::RemoveDeadBindings(): only the VarRegions for variables marked with the '__block' annotation should have their lifetime extended by a BlockDataRegion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90462 91177308-0d34-0410-b5e6-96231b3b80d8
egionStore.cpp
3978d87496ac48c009b29e32261ac0973c151b3c 03-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Add security syntactic checker for mktemp.
Patch by Lei Zhang!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90444 91177308-0d34-0410-b5e6-96231b3b80d8
heckSecuritySyntaxOnly.cpp
1bf405666c5499e5a3f7962b6ca5ddcef12cca89 03-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Add security syntactic checker for mktemp.
Patch by Lei Zhang!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90444 91177308-0d34-0410-b5e6-96231b3b80d8
heckSecuritySyntaxOnly.cpp
0df04f3991893af99e1e04121bee13ef6cdff1b7 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Update CMake for CallGraph.cpp move.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90443 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
459cc2387e682d08af63eb30874eb919b801fb42 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Update CMake for CallGraph.cpp move.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90443 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
7e7acb3b73830ba56a80642f42eb4270da357009 03-Dec-2009 Ted Kremenek <kremenek@apple.com> Add value invalidation logic for block-captured variables. Conceptually invoking a block (without specific reasoning of what the block does) can invalidate any value to it by reference when the block was created.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90431 91177308-0d34-0410-b5e6-96231b3b80d8
FRefCount.cpp
egionStore.cpp
2ffbfd96a3f1c2e55c0e950d941fbb4dbcd137b9 03-Dec-2009 Ted Kremenek <kremenek@apple.com> Add value invalidation logic for block-captured variables. Conceptually invoking a block (without specific reasoning of what the block does) can invalidate any value to it by reference when the block was created.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90431 91177308-0d34-0410-b5e6-96231b3b80d8
FRefCount.cpp
egionStore.cpp
fee543b77072594204591b3da62fa453937a1da8 03-Dec-2009 Ted Kremenek <kremenek@apple.com> Make BlockDataRegion::referenced_vars_iterator an actual class that enforces that all MemRegions iterated over are VarRegions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90430 91177308-0d34-0410-b5e6-96231b3b80d8
emRegion.cpp
81cef5889027d0f96b24afa7a0bb28d9023474ed 03-Dec-2009 Ted Kremenek <kremenek@apple.com> Make BlockDataRegion::referenced_vars_iterator an actual class that enforces that all MemRegions iterated over are VarRegions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90430 91177308-0d34-0410-b5e6-96231b3b80d8
emRegion.cpp
257ed2df3ef232b2389aabf8d5edcaa870e22169 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Fix layering violation by moving Analysis/CallGraph to Index

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90424 91177308-0d34-0410-b5e6-96231b3b80d8
allGraph.cpp
8fd57fea85ff7b4dc1895fbbdf73173feaa063b5 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Fix layering violation by moving Analysis/CallGraph to Index

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90424 91177308-0d34-0410-b5e6-96231b3b80d8
allGraph.cpp
47b8f8ef224c46bf0dfb846b4ec34b1c0ecc6e07 03-Dec-2009 Ted Kremenek <kremenek@apple.com> Add batch version of 'StoreManager::InvalidateRegion()' for invalidating multiple regions as once. After adopting this in the CFRefCount::EvalCall(), we see a reduction in analysis time of 1.5% when analyzing all of SQLite3.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90405 91177308-0d34-0410-b5e6-96231b3b80d8
FRefCount.cpp
egionStore.cpp
tore.cpp
81a958366873c8bb49a2ed7324f004047ec18e48 03-Dec-2009 Ted Kremenek <kremenek@apple.com> Add batch version of 'StoreManager::InvalidateRegion()' for invalidating multiple regions as once. After adopting this in the CFRefCount::EvalCall(), we see a reduction in analysis time of 1.5% when analyzing all of SQLite3.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90405 91177308-0d34-0410-b5e6-96231b3b80d8
FRefCount.cpp
egionStore.cpp
tore.cpp
b62881b6f4f04ce3ce057ccb17199509da5119e5 03-Dec-2009 Ted Kremenek <kremenek@apple.com> Add a heuristic to the dead stores checker to prune dead stores for variables annotated with '__block'. This is overly conservative, but now the analyzer doesn't report dead stores for variables that can be updated by a block call.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90364 91177308-0d34-0410-b5e6-96231b3b80d8
heckDeadStores.cpp
74635d8cd3c367890735dc4af2c2825a7e4b434c 03-Dec-2009 Ted Kremenek <kremenek@apple.com> Add a heuristic to the dead stores checker to prune dead stores for variables annotated with '__block'. This is overly conservative, but now the analyzer doesn't report dead stores for variables that can be updated by a block call.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90364 91177308-0d34-0410-b5e6-96231b3b80d8
heckDeadStores.cpp
876e1c59230d11409d1e8b54eff28a68a2074b98 02-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Hard bifurcate the state into nil receiver and non-nil receiver, so that
we don't need to use the DoneEvaluation hack when check for
ObjCMessageExpr.

PreVisitObjCMessageExpr() only checks for undefined receiver or arguments.

Add checker interface EvalNilReceiver(). This is a 'once-and-done' interface.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90296 91177308-0d34-0410-b5e6-96231b3b80d8
FRefCount.cpp
allAndMessageChecker.cpp
RExprEngine.cpp
a46e4d91d8f3eb341f2387768db66dcfe8dd0afa 02-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Hard bifurcate the state into nil receiver and non-nil receiver, so that
we don't need to use the DoneEvaluation hack when check for
ObjCMessageExpr.

PreVisitObjCMessageExpr() only checks for undefined receiver or arguments.

Add checker interface EvalNilReceiver(). This is a 'once-and-done' interface.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90296 91177308-0d34-0410-b5e6-96231b3b80d8
FRefCount.cpp
allAndMessageChecker.cpp
RExprEngine.cpp
3ec68d71e9b7079a104d500a206d5a737f196556 01-Dec-2009 Ted Kremenek <kremenek@apple.com> Provide the correct vector size for referenced variables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90267 91177308-0d34-0410-b5e6-96231b3b80d8
emRegion.cpp
02b1df62ff6fa9526619ee0db78e2af4186e490d 01-Dec-2009 Ted Kremenek <kremenek@apple.com> Provide the correct vector size for referenced variables.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90267 91177308-0d34-0410-b5e6-96231b3b80d8
emRegion.cpp
c4056c0af48caa188c38051bcdb2a2cdaefbd85f 01-Dec-2009 Ted Kremenek <kremenek@apple.com> Fix early-return logic in scanReachableSymbols() to match the rest of the recursive logic in the methods of ScanReachableSymbols.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90245 91177308-0d34-0410-b5e6-96231b3b80d8
RState.cpp
43f19f779e690f0f2c07b4cee7307d7df69dc9d5 01-Dec-2009 Ted Kremenek <kremenek@apple.com> Fix early-return logic in scanReachableSymbols() to match the rest of the recursive logic in the methods of ScanReachableSymbols.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90245 91177308-0d34-0410-b5e6-96231b3b80d8
RState.cpp
0f35634940fc62e108a0a854ba09483d9e2cc1d1 30-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate another VISIBILITY_HIDDEN

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90139 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
47491f8b7adf9d42a404d44c073e8a5308fa6cfc 30-Nov-2009 Douglas Gregor <dgregor@apple.com> Eliminate another VISIBILITY_HIDDEN

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90139 91177308-0d34-0410-b5e6-96231b3b80d8
RExprEngine.cpp
3081d565319e1abdfca8257cac1bd031c72a4d41 30-Nov-2009 Tobias Grosser <grosser@fim.uni-passau.de> Adapt to the DOTGraphTraits changes in LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90137 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
allGraph.cpp
RExprEngine.cpp
006b0eb3e11162d8c06372db813ac9f71a7a16e8 30-Nov-2009 Tobias Grosser <grosser@fim.uni-passau.de> Adapt to the DOTGraphTraits changes in LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90137 91177308-0d34-0410-b5e6-96231b3b80d8
FG.cpp
allGraph.cpp
RExprEngine.cpp
83fdb795f734f8cb262ddd61cf6befef4403934f 29-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Port BugReporter and BugType to StringRef.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90086 91177308-0d34-0410-b5e6-96231b3b80d8
ugReporter.cpp
FRefCount.cpp
heckDeadStores.cpp
heckObjCDealloc.cpp
heckObjCInstMethSignature.cpp
heckObjCUnusedIVars.cpp
heckSecuritySyntaxOnly.cpp
SErrorChecker.cpp
f0171732efb4647772ad2a45c0f31978b0e34f71 29-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Port BugReporter and BugType to StringRef.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90086 91177308-0d34-0410-b5e6-96231b3b80d8
ugReporter.cpp
FRefCount.cpp
heckDeadStores.cpp
heckObjCDealloc.cpp
heckObjCInstMethSignature.cpp
heckObjCUnusedIVars.cpp
heckSecuritySyntaxOnly.cpp
SErrorChecker.cpp
a538b45361172ff6b4f3c48fc1128fe1aca2cb64 29-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Kill some unnecessary calls to c_str().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90084 91177308-0d34-0410-b5e6-96231b3b80d8
asicObjCFoundationChecks.cpp
SErrorChecker.cpp
ndefResultChecker.cpp
4988a9a278c50fddf46d38331e4a136a91487b7d 29-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Kill some unnecessary calls to c_str().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90084 91177308-0d34-0410-b5e6-96231b3b80d8
asicObjCFoundationChecks.cpp
SErrorChecker.cpp
ndefResultChecker.cpp
c77179a0101347770eac456640c110efb1e13583 29-Nov-2009 Ted Kremenek <kremenek@apple.com> Fix null dereference in UndefResultChecker identified by running the analyzer over Postgresql.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90060 91177308-0d34-0410-b5e6-96231b3b80d8
ndefResultChecker.cpp
d4daa7cbd40807cf72ca83900e2c00ab3e1d7d6f 29-Nov-2009 Ted Kremenek <kremenek@apple.com> Fix null dereference in UndefResultChecker identified by running the analyzer over Postgresql.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90060 91177308-0d34-0410-b5e6-96231b3b80d8
ndefResultChecker.cpp
5e2f6ed50bf8c96fa371297ecc8412b34e5911f3 28-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Cleanup includes and forward decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90034 91177308-0d34-0410-b5e6-96231b3b80d8
heckObjCUnusedIVars.cpp
eturnStackAddressChecker.cpp
58652887b08da3207226ec6d8bdb59ec0e96edfe 28-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Cleanup includes and forward decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90034 91177308-0d34-0410-b5e6-96231b3b80d8
heckObjCUnusedIVars.cpp
eturnStackAddressChecker.cpp
c839e862edeeb468e9cc2606d4dceea777bdfef4 28-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Remove unneeded includes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90032 91177308-0d34-0410-b5e6-96231b3b80d8
asicObjCFoundationChecks.h
0c5db87c03213ed638a3850bf52fdb72cb93d300 28-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Remove unneeded includes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90032 91177308-0d34-0410-b5e6-96231b3b80d8
asicObjCFoundationChecks.h
16e658669752f90dd0a3d60373df9dea48456892 28-Nov-2009 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> lib/Analysis: Remove VISIBILITY_HIDDEN from definitions in anonymous namespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90028 91177308-0d34-0410-b5e6-96231b3b80d8
rrayBoundChecker.cpp
ttrNonNullChecker.cpp
asicConstraintManager.cpp
asicObjCFoundationChecks.cpp
asicStore.cpp
ugReporter.cpp
ugReporterVisitors.cpp
FG.cpp
FRefCount.cpp
allAndMessageChecker.cpp
allInliner.cpp
astToStructChecker.cpp
heckDeadStores.cpp
heckSecuritySyntaxOnly.cpp
heckSizeofPointer.cpp
ereferenceChecker.cpp
ivZeroChecker.cpp
nvironment.cpp
ixedAddressChecker.cpp
RCoreEngine.cpp
RExprEngine.cpp
RState.cpp
iveVariables.cpp
allocChecker.cpp
SAutoreleasePoolChecker.cpp
SErrorChecker.cpp
ointerArithChecker.cpp
ointerSubChecker.cpp
threadLockChecker.cpp
angeConstraintManager.cpp
egionStore.cpp
eturnPointerRangeChecker.cpp
eturnStackAddressChecker.cpp
eturnUndefChecker.cpp
impleSValuator.cpp
ndefBranchChecker.cpp
ndefResultChecker.cpp
ndefinedArraySubscriptChecker.cpp
ndefinedAssignmentChecker.cpp
ninitializedValues.cpp
LASizeChecker.cpp
ba5fb5a955c896815c439289fc51c03cf0635129 28-Nov-2009 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> lib/Analysis: Remove VISIBILITY_HIDDEN from definitions in anonymous namespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90028 91177308-0d34-0410-b5e6-96231b3b80d8
rrayBoundChecker.cpp
ttrNonNullChecker.cpp
asicConstraintManager.cpp
asicObjCFoundationChecks.cpp
asicStore.cpp
ugReporter.cpp
ugReporterVisitors.cpp
FG.cpp
FRefCount.cpp
allAndMessageChecker.cpp
allInliner.cpp
astToStructChecker.cpp
heckDeadStores.cpp
heckSecuritySyntaxOnly.cpp
heckSizeofPointer.cpp
ereferenceChecker.cpp
ivZeroChecker.cpp
nvironment.cpp
ixedAddressChecker.cpp
RCoreEngine.cpp
RExprEngine.cpp
RState.cpp
iveVariables.cpp
allocChecker.cpp
SAutoreleasePoolChecker.cpp
SErrorChecker.cpp
ointerArithChecker.cpp
ointerSubChecker.cpp
threadLockChecker.cpp
angeConstraintManager.cpp
egionStore.cpp
eturnPointerRangeChecker.cpp
eturnStackAddressChecker.cpp