Commit Graph

12965 Commits

Author SHA1 Message Date
Ted Kremenek c14b594b14 BugReporter (extensive diagnostics): Add EdgeBuilder::cleanUpLocation for canonicalization locations and use this in both popLocation and rawAddEdge.
llvm-svn: 71470
2009-05-11 19:50:47 +00:00
Ted Kremenek d4dacb05cc Add ParentMap:getParentIgnoreParens().
llvm-svn: 71469
2009-05-11 19:49:27 +00:00
Fariborz Jahanian 5d5ed2d800 Patch to allow Nonfragile ABI to use 32-bit style legacy
message dispage API for all but a few messages. This is 
a runtime performance improvement and there is not meant
to be a functional change.

llvm-svn: 71467
2009-05-11 19:25:47 +00:00
Ted Kremenek 3a4360c728 Update checker build.
llvm-svn: 71463
2009-05-11 19:02:11 +00:00
Daniel Dunbar 2ce6b3f91c Darwin x86_32: Treat records with unnamed bit-fields as "empty".
llvm-svn: 71461
2009-05-11 18:58:49 +00:00
Ted Kremenek d0e3ab2196 Fix regression reported in <rdar://problem/6866843>. The analyzer should extend the lifetime of an object stored to a container.
llvm-svn: 71452
2009-05-11 18:30:24 +00:00
Chris Lattner 9fea944f26 More improvements for GNU runtime objc EH, patch by David Chisnall!
llvm-svn: 71451
2009-05-11 18:16:28 +00:00
Douglas Gregor ad1a1c3982 Move terminal-width computation over to llvm::sys. Update to LLVM
r71448 required. Fixes PR 4148 and PR 4183.

llvm-svn: 71450
2009-05-11 18:06:49 +00:00
Ted Kremenek 7e7ed527dd Add test case for <rdar://problem/6257780>.
llvm-svn: 71444
2009-05-11 17:45:06 +00:00
Douglas Gregor bdccf64f4a Add a test for canonicalization of template arguments
llvm-svn: 71436
2009-05-11 16:52:38 +00:00
Ted Kremenek f16992866a Update checker build.
llvm-svn: 71435
2009-05-11 16:31:31 +00:00
Ted Kremenek dc7853cd98 Fix a bug found by Thomas Clement where 'return [[[NSString alloc] init] autorelease]' would emit a false 'too many overreleases' error.
llvm-svn: 71432
2009-05-11 15:26:06 +00:00
Zhongxing Xu 52091db11f TypedRegion is a too general assumption. Usually we only want to invalidate
the VarRegion as a super region of an ElementRegion.

llvm-svn: 71431
2009-05-11 14:28:14 +00:00
Zhongxing Xu c012656266 When retrieving an ElementRegion, if its super region is a StringRegion,
retrieve the string value.

llvm-svn: 71430
2009-05-11 14:23:36 +00:00
Zhongxing Xu bf938d3160 Fix a bug that leads to infinite loop. Set the correct element type to
ElementRegion.

llvm-svn: 71428
2009-05-11 12:48:56 +00:00
Douglas Gregor 862d28e59c With the introduction of nullptr, a template argument that refers to a declaration can now be NULL. Use cast_or_null appropriately
llvm-svn: 71412
2009-05-10 23:27:08 +00:00
Douglas Gregor 5e4e50c280 The canonical declaration of a NULL declaration is NULL
llvm-svn: 71409
2009-05-10 22:59:12 +00:00
Douglas Gregor e362cea568 Implement the semantics of the injected-class-name within a class
template. The injected-class-name is either a type or a template,
depending on whether a '<' follows it. As a type, the
injected-class-name's template argument list contains its template
parameters in declaration order.

As part of this, add logic for canonicalizing declarations, and be
sure to canonicalize declarations used in template names and template
arguments. 

A TagType is dependent if the declaration it references is dependent.

I'm not happy about the rather complicated protocol needed to use
ASTContext::getTemplateSpecializationType.

llvm-svn: 71408
2009-05-10 22:57:19 +00:00
Sebastian Redl 9257b234a5 Update minor points in C++ status table.
llvm-svn: 71406
2009-05-10 20:06:11 +00:00
Sebastian Redl 576fd424df Implement C++0x nullptr.
llvm-svn: 71405
2009-05-10 18:38:11 +00:00
Ted Kremenek 9a627e60cd Update checker build.
llvm-svn: 71404
2009-05-10 17:41:29 +00:00
Ted Kremenek 1f8e4346fa Add special warning about returning a retained object where a GC'ed object is expected.
llvm-svn: 71397
2009-05-10 16:52:15 +00:00
Ted Kremenek dee56e37fc retain/release checker: Flag a warning for non-owned objects returned
where an owned one is expected.  Also add preliminary checking for
returning a positive retain count object in GC mode where an owned GC
object is expected.

llvm-svn: 71388
2009-05-10 06:25:57 +00:00
Ted Kremenek 9dc1bed4a6 Update checker build.
llvm-svn: 71387
2009-05-10 05:54:23 +00:00
Ted Kremenek 3978f7972d analyzer:
- Improve -autorelease diagnostics.
- Improve VLA diagnostics.
- Use "short description" for bug when outputting to TextDiagnostics

llvm-svn: 71383
2009-05-10 05:11:21 +00:00
Ted Kremenek 1e0d6a5957 Update checker build.
llvm-svn: 71375
2009-05-10 02:22:16 +00:00
Ted Kremenek 1f991f09df Add total hack to get scan-build working again. ccc-analyzer calls
'clang -###' to get the appropriate arguments to pass to clang-cc.
This isn't a permanent solution.

llvm-svn: 71364
2009-05-09 19:19:28 +00:00
Chris Lattner da38fda583 force a target triple so that the right greppable output happens.
llvm-svn: 71361
2009-05-09 17:36:58 +00:00
Zhongxing Xu c9c3dab491 When casting VarRegion, if the var type is aggregate type and the cast-to
pointee type is scalar type, create element region regardless with the sizes
of types.

llvm-svn: 71360
2009-05-09 15:34:29 +00:00
Zhongxing Xu 4131114d99 Remove the rest TypedViewRegion processing code. There should be no
TypedViewRegion usage in region store.

llvm-svn: 71359
2009-05-09 15:23:42 +00:00
Zhongxing Xu d6daef9165 When evaluating pointer arithmetic, if the base location is a symbolic region,
convert it to the first element region.
Also do not assume the array region is typed.

llvm-svn: 71358
2009-05-09 15:18:12 +00:00
Zhongxing Xu b18d7cab0c Do not create a TypedViewRegion when the base struct region is a symbolic
region. In the future we may set the cast-to type as the same time. But for
now, we simply leave it as it is.

llvm-svn: 71357
2009-05-09 13:36:16 +00:00
Zhongxing Xu 4bc5a4c3bd add comments to test case.
llvm-svn: 71356
2009-05-09 13:27:17 +00:00
Zhongxing Xu 7c3826484e Do not layer a TypedViewRegion when casting symbolic or alloca regions.
Modify getLValueElement accordingly. Now we don't require base region 
to be a typed region. Do not create TypedViewRegion when base region is 
symbolic or alloca region. We can do so because each element region has 
its type information.

llvm-svn: 71355
2009-05-09 13:20:07 +00:00
Zhongxing Xu e3e94bbf19 Remove the case for casting to compatible type in
RegionStoreManager::CastRegion(). This case should be subsumed by others.

llvm-svn: 71353
2009-05-09 10:03:08 +00:00
Duncan Sands c76fe8b611 Correct for renaming PaddedSize -> AllocSize in
LLVM.

llvm-svn: 71350
2009-05-09 07:08:47 +00:00
Ted Kremenek 6631d7c4be Roll back to checker build 0.195.
llvm-svn: 71348
2009-05-09 07:05:44 +00:00
Zhongxing Xu 91e2ab496f Rename:
SymbolRegionRValue => SymbolRegionValue
  SymExpr::RegionRValue => SymExpr::RegionValueKind

llvm-svn: 71322
2009-05-09 04:08:27 +00:00
Zhongxing Xu 34d04b3ca9 As discussed with Ted, rename TypedRegion::getObjectType() to
TypedRegion::getValueType().

llvm-svn: 71321
2009-05-09 03:57:34 +00:00
Ted Kremenek d73cfc734b Add back test cases for ns_returns_retained and cf_returns_retained.
llvm-svn: 71312
2009-05-09 03:10:32 +00:00
Ted Kremenek 669604cded Add back attribute string lookup for 'ns_returns_retained' and
'cf_returns_retained'.

llvm-svn: 71311
2009-05-09 03:08:29 +00:00
Ted Kremenek c2de72776c Add back analyzer support for ns_returns_retained and cf_returns_retained.
llvm-svn: 71309
2009-05-09 02:58:13 +00:00
Ted Kremenek 9ecdfaf66d Add back Parse/Sema support for attributes cf_returns_retained and
ns_returns_retained, but do not include the other ownership attributes
we previously had.

llvm-svn: 71308
2009-05-09 02:44:38 +00:00
Ted Kremenek 2d0ff62a0d It lives! The retain/release checker now tracks objects that are sent
'autorelease'.

llvm-svn: 71307
2009-05-09 01:50:57 +00:00
Ted Kremenek 8326c2fdfc Fix lurking bug in one of the versions of
GRStmtNodeBuilder::generateNode() where the HasGeneratedNode flag
wouldn't properly be set.

llvm-svn: 71306
2009-05-09 01:37:12 +00:00
Zhongxing Xu 8038f7b30f rename: MemRegion:
RValueType => ObjectType
 LValueType => LocationType

No functionality change.

llvm-svn: 71304
2009-05-09 00:50:33 +00:00
Ted Kremenek 9ec08aa3f7 More hacking on autorelease errors. We now can emit basic errors (disabled for
now until ready).

llvm-svn: 71303
2009-05-09 00:44:07 +00:00
Ted Kremenek d35272f96b Put most of the boilerplate logic in place for reporting autorelease errors.
llvm-svn: 71301
2009-05-09 00:10:05 +00:00
Fariborz Jahanian 5276014db2 We want to diagnose sending message to a forward class
and we also want to tell which message is actually 
being sent.

llvm-svn: 71296
2009-05-08 23:45:49 +00:00
Daniel Dunbar 793cc3e0c3 ABITest: Improve test driver marginally, to allow running a specific
test index.

llvm-svn: 71295
2009-05-08 23:40:45 +00:00