Daniel Dunbar
9da559868f
Tweak inliner thresholds to match llvm-gcc, see r95321.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95379 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 07:32:37 +00:00
Anders Carlsson
f98574ba5c
Check in a mangle checker that's turned off by default.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95377 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 07:31:37 +00:00
Douglas Gregor
1df0ee91a9
Teach C++ name lookup that it's okay to look in a scope without a
...
context. This happens fairly rarely (which is why we got away with
this bug). Fixes PR6184, where we skipped over the template parameter
scope while tentatively parsing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95376 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 07:07:10 +00:00
Anders Carlsson
b054e3804c
Fix array initialization test.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95375 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 07:00:11 +00:00
Anders Carlsson
7e673c4c11
Fix a test case.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95374 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 06:58:06 +00:00
Douglas Gregor
6f7a17b718
A function declarator with a non-identifier name in an anonymous class
...
is a constructor for that class, right? Fixes PR6238.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95367 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 06:12:42 +00:00
Ted Kremenek
cada305b86
Add test case showing the analyzer invalidates '__block' variables when the block is passed as an argument to an ObjC method.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95366 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 06:10:46 +00:00
Zhongxing Xu
72119c478f
More GRState* -> Store changes.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95365 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 05:34:29 +00:00
Zhongxing Xu
461147fc8d
Remove unused parameter.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95364 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 05:24:20 +00:00
Anders Carlsson
7d94a9503c
If a global initializer has a non-trivial destructor it can't be emitted as a constant (even if it has a trivial constructor).
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95363 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 05:19:42 +00:00
Zhongxing Xu
f5416bdb75
More GRState* -> Store changes.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95362 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 05:18:47 +00:00
Douglas Gregor
dc81c880ca
When adding ADL candidates for overloaded
...
post-increment/post-decrement operators, be sure to consider both
arguments. Fixes PR6237.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95361 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 05:15:43 +00:00
Zhongxing Xu
b4a9c612f9
More GRState* -> Store changes.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95360 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 05:06:13 +00:00
Douglas Gregor
a4e8c2a65a
When determining whether a scope specifier is complete, consider a
...
dependent DeclContext to be "complete". Fixes PR6236.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95359 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 04:39:02 +00:00
Zhongxing Xu
576bb92057
More GRState* -> Store changes.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95357 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 03:01:53 +00:00
Zhongxing Xu
bfcaf8048d
Change LazyCompoundVal to a <Store, MemRegion*> pair. We really don't need to
...
spread GRState* everywhere.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95354 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 02:26:30 +00:00
Ted Kremenek
9f9e0dbc13
Now that the -cc1 options for analyzer checks have a structured naming, add back scanning for analyzer checks to scan-build.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95349 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 02:18:39 +00:00
Ted Kremenek
565e465c6d
Rename -cc1 option '-checker-cfref' to '-analyzer-check-objc-mem'.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95348 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 02:06:54 +00:00
Ted Kremenek
7909fc8833
Rename -cc1 option '-warn-objc-missing-dealloc' to '-analyzer-check-objc-missing-dealloc'.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95347 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 01:59:21 +00:00
Ted Kremenek
fa15be4cf9
Rename -cc1 option '-warn-objc-methodsigs' to '-analyzer-check-objc-methodsigs'.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95346 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 01:57:44 +00:00
Ted Kremenek
2ade536f68
Rename -cc1 option '-warn-objc-unused-ivars' to '-analyzer-check-objc-unused-ivars'.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95345 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 01:55:01 +00:00
Ted Kremenek
cd9902bfb7
Rename -cc1 option '-warn-dead-stores' to '-analyzer-check-dead-stores'.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95343 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 01:52:40 +00:00
Ted Kremenek
fb3f893bc5
Rename -cc1 option '-warn-security-syntactic' to '-analyzer-check-security-syntactic'.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95342 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 01:50:36 +00:00
Fariborz Jahanian
2b9b0b2c9a
Fix a nested ivar reference rewriting bug.
...
(Fixes radar 7607605).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95341 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 01:35:00 +00:00
John McCall
5cfa011e61
Always start tag definitions before completing them. Assert same.
...
Fixes latent and not-so-latent objc++ and blocks++ bugs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95340 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 01:33:36 +00:00
John Thompson
82287d19de
First stage of adding AltiVec support
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95335 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 00:12:22 +00:00
Douglas Gregor
6202119003
Fix a crash with ill-formed code within a method in an ill-formed
...
category implementation, which showed up during (attempted) typo
correction. Fixes <rdar://problem/7605289>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95334 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 23:42:48 +00:00
John McCall
86ff308724
Extract a common structure for holding information about the definition
...
of a C++ record. Exposed a lot of problems where various routines were
silently doing The Wrong Thing (or The Acceptable Thing in The Wrong Order)
when presented with a non-definition. Also cuts down on memory usage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95330 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 22:26:26 +00:00
Ted Kremenek
74d56a1689
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
2010-02-04 20:46:58 +00:00
Douglas Gregor
789b1f6402
Fix an obscure crash found in the Boost.MPL test suite, along with a
...
ton of potential crashes of the same kind. The fundamental problem is
that type creation was following a dangerous pattern when using its
FoldingSets:
1) Use FindNodeOrInsertPos to see if the type is available
2) If not, and we aren't looking at a canonical type, build the
canonical type
3) Build and insert the new node into the FoldingSet
The problem here is that building the canonical type can, in very rare
circumstances, force the hash table inside the FoldingSet to
reallocate. That invalidates the insertion position we computed in
step 1, and in step 3 we end up inserting the new node into the wrong
place. BOOM!
I've audited all of ASTContext, fixing this problem everywhere I found
it. The vast majority of wrong code was C++-specific (and *ahem*
written by me), so I also audited other major folding sets in the C++
code (e.g., template specializations), but found no other instances of
this problem.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95315 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 18:10:26 +00:00
Anders Carlsson
0dc7366276
When binding an lvalue to a reference, we always need to pop temporaries.
...
With this fix, and the other fixes committed today a make check-all with a clang-built LLVM now gives:
Expected Passes : 6933
Expected Failures : 46
Unsupported Tests : 40
Unexpected Failures: 27
which means that we pass 99.96% of all tests :) The resulting 27 tests are all LLVMC tests and seem to be because of differences in the clang and gcc drivers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95313 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 17:32:58 +00:00
Anders Carlsson
8ffc80fe54
Update test.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95312 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 17:29:32 +00:00
Anders Carlsson
c1b32f6968
Fix a bug where we would not mark temporaries as conditional when emitting a conditional operator as an lvalue.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95311 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 17:26:01 +00:00
Anders Carlsson
4e3014be06
Improve conditional temporaries test.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95310 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 17:23:15 +00:00
Douglas Gregor
86a7625062
When substituting the template argument for a pointer non-type
...
template parameter, perform array/function decay (if needed), take the
address of the argument (if needed), perform qualification conversions
(if needed), and remove any top-level cv-qualifiers from the resulting
expression. Fixes PR6226.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95309 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 17:21:48 +00:00
Anders Carlsson
72119a887c
Rename StartConditionalBranch/FinishConditionalBranch to BeginConditionalBranch/EndConditionalBranch.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95308 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 17:18:07 +00:00
Anders Carlsson
51591bed10
Fix another pointer-to-member function miscompile, this time when trying to call a virtual member function.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95307 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 17:08:48 +00:00
Anders Carlsson
5bb0ddd10b
Improve test.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95306 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 17:06:52 +00:00
Anders Carlsson
e8a81f7e8e
Calculate offset correctly when taking the address of a virtual member function.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95305 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 16:38:05 +00:00
Ted Kremenek
03db470ec5
Convert flags in FormatSpecifier to be bitfields instead of doing
...
direct bit manipulation. This is is less error prone, and fixes a bug
in the handling of the LeadingZeroes flag as pointed out by Cristian
Draghici.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 07:27:39 +00:00
Ted Kremenek
68ebd83120
Add assorted test cases from PR 4172.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95297 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 07:25:56 +00:00
John McCall
f82b4e85b1
Allow calling convention attributes to apply to types. Patch by Chip Davis!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95291 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 05:44:44 +00:00
Zhongxing Xu
814e6b9154
Cast evaluation no longer touch GRState.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95290 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 04:56:43 +00:00
Ted Kremenek
95a011204f
Specially handle casts to 'void' in AdjustedReturnValueChecker.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95287 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 04:18:55 +00:00
Ted Kremenek
8928d41f72
Remove stray typo.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95286 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 04:14:49 +00:00
John McCall
2f27bf854f
Mangle member expressions. Also invented.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95284 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 02:56:29 +00:00
Zhongxing Xu
c999ed7929
Now that CastRetrievedVal returns SVal, there is no need to use CastResult.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95279 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 02:39:47 +00:00
John McCall
a3218e7399
Add a cautionary note about the mangling I just invented.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95275 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 01:48:38 +00:00
John McCall
1dd7383dc4
Add mangling support for calls, sizeof/alignof, constructor calls,
...
float literals, and unresolved lookups (which required hand-wavey extensions).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95273 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 01:42:13 +00:00
Ted Kremenek
40c37e1a62
static analyzer: handle casts of a function to a function pointer with
...
a different return type. While we don't emit any errors (yet), at
least we avoid cases where we might crash because of an assertion
failure later on (when the return type differs from what is expected).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95268 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 00:47:48 +00:00