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

8904 Коммитов

Автор SHA1 Сообщение Дата
Ted Kremenek d76c6a38b8 Do not automatically run the 'missing -dealloc' check until we have adequate time to make it much smarter (too much noise).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65474 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 21:08:30 +00:00
Daniel Dunbar 0334a4ec63 Temporarily disable clearing of insert point (to indicate unreachable
code) when calling noreturn functions; general expression emission
isn't ready to do the right thing in all cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65473 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 20:59:29 +00:00
Daniel Dunbar e5731f8149 Allow constant initializers to reference their defining decl.
- PR3662.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65472 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 20:08:33 +00:00
Douglas Gregor ac1afdc58e Include the appropriate header for malloc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65471 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 19:48:02 +00:00
Daniel Dunbar a985b31fc3 Fold GeneraticStaticBlockVarDecl into callers.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65470 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 19:45:19 +00:00
Douglas Gregor 39a8de10c1 Implement parsing of nested-name-specifiers that involve template-ids, e.g.,
std::vector<int>::allocator_type

When we parse a template-id that names a type, it will become either a
template-id annotation (which is a parsed representation of a
template-id that has not yet been through semantic analysis) or a
typename annotation (where semantic analysis has resolved the
template-id to an actual type), depending on the context. We only
produce a type in contexts where we know that we only need type
information, e.g., in a type specifier. Otherwise, we create a
template-id annotation that can later be "upgraded" by transforming it
into a typename annotation when the parser needs a type. This occurs,
for example, when we've parsed "std::vector<int>" above and then see
the '::' after it. However, it means that when writing something like
this:

  template<> class Outer::Inner<int> { ... };

We have two tokens to represent Outer::Inner<int>: one token for the
nested name specifier Outer::, and one template-id annotation token
for Inner<int>, which will be passed to semantic analysis to define
the class template specialization.

Most of the churn in the template tests in this patch come from an
improvement in our error recovery from ill-formed template-ids.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65467 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 19:37:18 +00:00
Daniel Dunbar 0096acf421 Pull COdeGenFunction::CreateStaticBlockVarDecl (just for creating the
global variable) out of GenerateStaticBlockVarDecl. 
 - No intended functionality change.
 - Prep for some mild cleanups and PR3662.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65466 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 19:24:29 +00:00
Chris Lattner 01e4b5c3bf add c++ search path for GCC 4.2, PR3668, patch by Pawel Worach!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65462 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 18:06:37 +00:00
Anders Carlsson b90052a8cc Use CheckAssignmentConstraints for checking the cleanup attr function. Fixes PR3656.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65461 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 17:19:08 +00:00
Douglas Gregor 2224f84658 C99 DR #316 implies that the function parameter types that are known
only from a function definition (that does not have a prototype) are
only used to determine the compatible with other declarations of that
same function. In particular, when referencing the function we pretend
as if it does not have a prototype. Implement this behavior, which
fixes PR3626.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65460 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 16:33:18 +00:00
Gabor Greif 70f2a0485d fix (hopefully) some validation errors
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65455 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 15:22:45 +00:00
Gabor Greif 6cd81e82fc minor tweaks to readability
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65440 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 09:45:40 +00:00
Chris Lattner ddb85a7ae6 update
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65433 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 05:43:33 +00:00
Chris Lattner 12f708d896 Headers are basically done, debug info is just about done (and
will improve a lot this week hopefully), and a libgcc replacement
is ready once I wrangle lawyers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65432 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 05:39:01 +00:00
Chris Lattner d825883a1a clang seems "generally useful" for c and objc by now, though obviously bugs
still remain.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65431 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 05:35:47 +00:00
Eli Friedman d8f4f43300 Minor cleanup for IntToBlockPointer so it applies to all callers of
Sema::CheckAssignmentConstraints; not really visible, but the right 
thing to do.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65428 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 04:20:42 +00:00
Ted Kremenek 6c4becbab5 retain/release checker: Implement basic tracking of autorelease stack. Next thing is to wire up pools with their contents.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65425 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 02:54:57 +00:00
Ted Kremenek 2201791105 Implement 'Add' method for GRStatePartialTrait<ImmutableList<T>>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65424 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 02:54:00 +00:00
Devang Patel 65e99f219a Fix comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65423 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 01:36:11 +00:00
Devang Patel 1d6a451cee Enable debug info emission for objc methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65422 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 01:09:46 +00:00
Ted Kremenek f4f5fa09b0 Update checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65421 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 00:54:41 +00:00
Daniel Dunbar 5ec41c2423 Remove a FIXME; I was mistaken in believing gcc rejected this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65420 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 00:22:25 +00:00
Ted Kremenek 0e0eb8b051 Fix condition in ccc-analyzer that would cause the analyzer never to be run.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65417 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 00:10:37 +00:00
Fariborz Jahanian 84d013393c Minor refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65414 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 23:38:42 +00:00
Fariborz Jahanian 66a5c2c0da patch for two things.
make sure objc2's nonfragile abi is enacted for Leopard too.
add -fobjc-gc-only flag to the image_info symbol.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65413 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 23:34:44 +00:00
Ted Kremenek 6431a26956 Fix broken logic from my last commit. Branches only occur at basic blocks that end with terminators.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65410 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 23:34:17 +00:00
Ted Kremenek 4094b34a60 Fix diagnostic regression where the leak diagnostic could appear earlier in the path than the branches taken.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65407 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 23:30:57 +00:00
Devang Patel 7782022c0c If Loc is invalid (e.g. "self" in Objective-C) then use MainFileID's compile unit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65403 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 23:16:03 +00:00
Chris Lattner 79e079d3ca handle @encode interactions with array initializers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65401 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 23:10:27 +00:00
Chris Lattner 19da8cdfb3 rename CheckStringLiteralInit to CheckStringInit and pass in the
string size as an argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65400 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 23:01:39 +00:00
Chris Lattner 0820254f97 make SemaRef be a reference to sema, not a pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65399 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 22:50:46 +00:00
Chris Lattner 8b419b9b5f move InitListChecker to be private to SemaInit.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65398 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 22:48:58 +00:00
Chris Lattner 95e8d658fb Make CheckSingleInitializer a static function in SemaInit.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65397 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 22:46:58 +00:00
Chris Lattner f71ae8d802 make CheckStringLiteralInit a static function in SemaInit.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65396 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 22:41:04 +00:00
Chris Lattner 6c291a88bc change IsStringLiteralInit into a static function in SemaInit.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65395 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 22:36:59 +00:00
Chris Lattner dd8e006520 move some initialization checking code from SemaDecl.cpp
to SemaInit.cpp, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65394 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 22:27:37 +00:00
Chris Lattner eaf2bb89eb first wave of fixes for @encode sema support. This is part of PR3648.
The big difference here is that (like string literal) @encode has 
array type, not pointer type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65391 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 22:18:39 +00:00
Ted Kremenek 8459132b03 ccc-analyzer: Don't analyze files with '-arch ppc' or '-arch ppc64' since Clang
doesn't support Altivec intrisics nor is it likely that we're currently
generating all the right #defines, etc., for those architectures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65390 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 22:07:12 +00:00
Chris Lattner 111c2ee5fe some minor cleanups, handle ObjCEncodeExpr in a couple places.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65389 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 21:54:33 +00:00
Chris Lattner c4a09c1899 improve comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65388 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 21:52:14 +00:00
Fariborz Jahanian 067986e534 Set flag for -fobjc-gc in IMAGE_INFO variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65387 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 21:08:09 +00:00
Douglas Gregor d6f7e9dccd When we're declaring an object or function with linkage, teach name
lookup to skip over names without linkage. This finishes
<rdar://problem/6127293>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65386 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 20:03:32 +00:00
Douglas Gregor 8f30105fda Extend the implicit declaration and checking against out-of-scope
external declarations to also support external variable
declarations. Unified the code for these two cases into two new
subroutines.

Note that we fail to diagnose cases like the one Neil pointed
out, where a visible non-external declaration hides an external
declaration by the same name. That will require some reshuffling of
name lookup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65385 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 19:23:27 +00:00
Ted Kremenek 4d3957da69 retain/release checker:
- For autorelease pool tracking, keep information about the stack of pools
  separate from their contents. Also, keep track of the number of times an
  autorelease pool will send the "release" message to an object when the pool is
  destroyed.
- Update CFRefCount::Update to return a new state instead of a reference count
  binding. This will allow us to implement more complicated semantics with
  autorelease pools.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65384 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 19:15:11 +00:00
Daniel Dunbar d01b669f26 Fix IRgen of constant expressions referring to external/static
variables.
 - PR3657.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65381 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 18:41:57 +00:00
Daniel Dunbar 8ecbaf25c1 Some initial Obj-C zero cost EH support.
- Only handles cases with @try with no @catch blocks, and there are a
   number of problems with the implementation. Nevertheless, this is
   good enough to handled @synchronized correctly, and some other
   basic uses.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65378 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 07:47:38 +00:00
Daniel Dunbar ae66cf3153 Add a very primitive clang based multifile 'delta'.
- Interface is more or less like multidelta.

 - Keep in mind it won't work very well; delta is O(N^2) frequently in
   practice. multidelta manages to work because it folds lines to keep
   N small, but this is just working on raw tokens. However, I have a
   fancy pants DAG based delta algorithm which will be the bees knees
   once I get it wired to clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65377 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 07:42:32 +00:00
Daniel Dunbar 6eba1438ae Add a note about an IRgen optimization opportunity.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65376 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 06:34:04 +00:00
Chris Lattner f0b26b1d9d Fix PR3635 by handling ## magically
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65374 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 05:29:33 +00:00
Douglas Gregor 25d944af5d In C, when we see a function declaration within a local scope, export
that declaration to global scope so that it can be found from other
scopes. This allows us to diagnose redeclaration errors for external
declarations across scopes. We also warn when name lookup finds such
an out-of-scope declaration. This is part of <rdar://problem/6127293>;
we'll also need to do the same thing for variables.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65373 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 04:26:15 +00:00