Граф коммитов

11844 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor 42af25f865 Implement the notions of the "current instantiation" and "unknown
specialization" within a C++ template, and permit name lookup into the
current instantiation. For example, given:

  template<typename T, typename U>
  struct X {
    typedef T type;

    X* x1;  // current instantiation
    X<T, U> *x2; // current instantiation
    X<U, T> *x3; // not current instantiation
    ::X<type, U> *x4; // current instantiation
    X<typename X<type, U>::type, U>: *x5; // current instantiation
  };



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71471 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 19:58:34 +00:00
Ted Kremenek 8c8b0ad960 BugReporter (extensive diagnostics): Add EdgeBuilder::cleanUpLocation for canonicalization locations and use this in both popLocation and rawAddEdge.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71470 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 19:50:47 +00:00
Ted Kremenek b1b9f680f5 Add ParentMap:getParentIgnoreParens().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71469 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 19:49:27 +00:00
Fariborz Jahanian d0f8a8d170 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71467 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 19:25:47 +00:00
Ted Kremenek 8c29e4e0c2 Update checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71463 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 19:02:11 +00:00
Daniel Dunbar 573b907e8b Darwin x86_32: Treat records with unnamed bit-fields as "empty".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71461 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 18:58:49 +00:00
Ted Kremenek ebd5a2dc1a Fix regression reported in <rdar://problem/6866843>. The analyzer should extend the lifetime of an object stored to a container.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71452 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 18:30:24 +00:00
Chris Lattner d6a9907cef More improvements for GNU runtime objc EH, patch by David Chisnall!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71451 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 18:16:28 +00:00
Douglas Gregor 67187ceb21 Move terminal-width computation over to llvm::sys. Update to LLVM
r71448 required. Fixes PR 4148 and PR 4183.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71450 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 18:06:49 +00:00
Ted Kremenek a0cc00dfb1 Add test case for <rdar://problem/6257780>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71444 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 17:45:06 +00:00
Douglas Gregor 0408678362 Add a test for canonicalization of template arguments
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71436 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 16:52:38 +00:00
Ted Kremenek 8b2bc72651 Update checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71435 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 16:31:31 +00:00
Ted Kremenek 95d3b90b57 Fix a bug found by Thomas Clement where 'return [[[NSString alloc] init] autorelease]' would emit a false 'too many overreleases' error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71432 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 15:26:06 +00:00
Zhongxing Xu 2e7c678165 TypedRegion is a too general assumption. Usually we only want to invalidate
the VarRegion as a super region of an ElementRegion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71431 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 14:28:14 +00:00
Zhongxing Xu c87d5fbfef When retrieving an ElementRegion, if its super region is a StringRegion,
retrieve the string value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71430 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 14:23:36 +00:00
Zhongxing Xu 2ee5214779 Fix a bug that leads to infinite loop. Set the correct element type to
ElementRegion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71428 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 12:48:56 +00:00
Douglas Gregor 92d5077d35 With the introduction of nullptr, a template argument that refers to a declaration can now be NULL. Use cast_or_null appropriately
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71412 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-10 23:27:08 +00:00
Douglas Gregor c4ccf01c12 The canonical declaration of a NULL declaration is NULL
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71409 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-10 22:59:12 +00:00
Douglas Gregor 7da97d0f31 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71408 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-10 22:57:19 +00:00
Sebastian Redl 0393e285fd Update minor points in C++ status table.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71406 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-10 20:06:11 +00:00
Sebastian Redl 6e8ed16ffe Implement C++0x nullptr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71405 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-10 18:38:11 +00:00
Ted Kremenek 9f2e23e708 Update checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71404 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-10 17:41:29 +00:00
Ted Kremenek 82f2be584e Add special warning about returning a retained object where a GC'ed object is expected.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71397 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-10 16:52:15 +00:00
Ted Kremenek e8720ce787 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71388 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-10 06:25:57 +00:00
Ted Kremenek 11ddafb2e3 Update checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71387 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-10 05:54:23 +00:00
Ted Kremenek eaedfeab9e analyzer:
- Improve -autorelease diagnostics.
- Improve VLA diagnostics.
- Use "short description" for bug when outputting to TextDiagnostics


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71383 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-10 05:11:21 +00:00
Ted Kremenek 6631686ddd Update checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71375 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-10 02:22:16 +00:00
Ted Kremenek fd9df0eddd 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71364 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 19:19:28 +00:00
Chris Lattner 349ab51813 force a target triple so that the right greppable output happens.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71361 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 17:36:58 +00:00
Zhongxing Xu 5bf3287765 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71360 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 15:34:29 +00:00
Zhongxing Xu 75eb5baa37 Remove the rest TypedViewRegion processing code. There should be no
TypedViewRegion usage in region store.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71359 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 15:23:42 +00:00
Zhongxing Xu c4761f5ea3 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71358 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 15:18:12 +00:00
Zhongxing Xu 8a9bf4a768 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71357 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 13:36:16 +00:00
Zhongxing Xu 5e8008e809 add comments to test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71356 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 13:27:17 +00:00
Zhongxing Xu ce7607858f 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71355 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 13:20:07 +00:00
Zhongxing Xu db3a098c23 Remove the case for casting to compatible type in
RegionStoreManager::CastRegion(). This case should be subsumed by others.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71353 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 10:03:08 +00:00
Duncan Sands 9408c45009 Correct for renaming PaddedSize -> AllocSize in
LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71350 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 07:08:47 +00:00
Ted Kremenek 11888a251b Roll back to checker build 0.195.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71348 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 07:05:44 +00:00
Zhongxing Xu d9b6ad609e Rename:
SymbolRegionRValue => SymbolRegionValue
  SymExpr::RegionRValue => SymExpr::RegionValueKind


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71322 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 04:08:27 +00:00
Zhongxing Xu a82d8aa5b3 As discussed with Ted, rename TypedRegion::getObjectType() to
TypedRegion::getValueType().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71321 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 03:57:34 +00:00
Ted Kremenek 8c6096e374 Add back test cases for ns_returns_retained and cf_returns_retained.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71312 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 03:10:32 +00:00
Ted Kremenek 91ad269f26 Add back attribute string lookup for 'ns_returns_retained' and
'cf_returns_retained'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71311 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 03:08:29 +00:00
Ted Kremenek 4dd8fb4f3d Add back analyzer support for ns_returns_retained and cf_returns_retained.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71309 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 02:58:13 +00:00
Ted Kremenek b71368d285 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71308 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 02:44:38 +00:00
Ted Kremenek 6b62ec90d4 It lives! The retain/release checker now tracks objects that are sent
'autorelease'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71307 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 01:50:57 +00:00
Ted Kremenek c1c739bd4b Fix lurking bug in one of the versions of
GRStmtNodeBuilder::generateNode() where the HasGeneratedNode flag
wouldn't properly be set.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71306 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 01:37:12 +00:00
Zhongxing Xu ff69782634 rename: MemRegion:
RValueType => ObjectType
 LValueType => LocationType

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71304 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 00:50:33 +00:00
Ted Kremenek 80c2418254 More hacking on autorelease errors. We now can emit basic errors (disabled for
now until ready).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71303 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 00:44:07 +00:00
Ted Kremenek 369de565a7 Put most of the boilerplate logic in place for reporting autorelease errors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71301 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 00:10:05 +00:00
Fariborz Jahanian 9f8f026fc1 We want to diagnose sending message to a forward class
and we also want to tell which message is actually 
being sent.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71296 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 23:45:49 +00:00