]> granicus.if.org Git - clang/log
clang
15 years agoFixup spacing.
Mike Stump [Thu, 26 Feb 2009 08:00:25 +0000 (08:00 +0000)]
Fixup spacing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65519 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agox86_64 ABI: Qualified id types are passed as pointers.
Daniel Dunbar [Thu, 26 Feb 2009 07:21:35 +0000 (07:21 +0000)]
x86_64 ABI: Qualified id types are passed as pointers.
 - <rdar://problem/6622451> Bad x86_64 code gen for message call taking one argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65510 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd an export map for clang on Linux.
Owen Anderson [Thu, 26 Feb 2009 06:29:54 +0000 (06:29 +0000)]
Add an export map for clang on Linux.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65504 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoZap the Sema constant initializer checking code that we aren't using
Eli Friedman [Thu, 26 Feb 2009 04:47:58 +0000 (04:47 +0000)]
Zap the Sema constant initializer checking code that we aren't using
anymore.  If we want to reuse bits and pieces to add strict checking for
constant initializers, we can dig them out of SVN history; the existing
code won't be useful as-is.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65502 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix for PR3663/3669: use TryToFixInvalidVariablyModifiedType for
Eli Friedman [Thu, 26 Feb 2009 03:58:54 +0000 (03:58 +0000)]
Fix for PR3663/3669: use TryToFixInvalidVariablyModifiedType for
variable declarations where applicable.  Also, a few fixes to
TryToFixInvalidVariablyModifiedType for issues that this exposed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65500 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse RecordFirst/RecordLast range checks in DeclContext
Douglas Gregor [Thu, 26 Feb 2009 00:02:51 +0000 (00:02 +0000)]
Use RecordFirst/RecordLast range checks in DeclContext

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65489 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplementing parsing of template-ids as class-names, so that we can
Douglas Gregor [Wed, 25 Feb 2009 23:52:28 +0000 (23:52 +0000)]
Implementing parsing of template-ids as class-names, so that we can
derive from a class template specialization, e.g.,

  class B : public A<int> { };

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65488 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCodeGen support for copied BlockDeclRefExprs.
Mike Stump [Wed, 25 Feb 2009 23:33:13 +0000 (23:33 +0000)]
CodeGen support for copied BlockDeclRefExprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65487 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix subtle bug in EvalEagerlyAssume: Check if the previous node was at the same state...
Ted Kremenek [Wed, 25 Feb 2009 23:32:10 +0000 (23:32 +0000)]
Fix subtle bug in EvalEagerlyAssume: Check if the previous node was at the same statement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65486 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix recently introduced switch case fallthrough bug.
Ted Kremenek [Wed, 25 Feb 2009 23:11:49 +0000 (23:11 +0000)]
Fix recently introduced switch case fallthrough bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65485 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCope with use of the token '>>' inside a template argument list, e.g.,
Douglas Gregor [Wed, 25 Feb 2009 23:02:36 +0000 (23:02 +0000)]
Cope with use of the token '>>' inside a template argument list, e.g.,

  vector<vector<double>> Matrix;

In C++98/03, this token always means "right shift". However, if we're in
a context where we know that it can't mean "right shift", provide a
friendly reminder to put a space between the two >'s and then treat it
as two >'s as part of recovery.

In C++0x, this token is always broken into two '>' tokens.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65484 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoscan-build now looks for ccc-analyzer first in the 'bin' subdirectory and then the...
Ted Kremenek [Wed, 25 Feb 2009 22:54:02 +0000 (22:54 +0000)]
scan-build now looks for ccc-analyzer first in the 'bin' subdirectory and then the directory where scan-build lives.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65483 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd experimental logic in GRExprEngine::EvalEagerlyAssume() to handle
Ted Kremenek [Wed, 25 Feb 2009 22:32:02 +0000 (22:32 +0000)]
Add experimental logic in GRExprEngine::EvalEagerlyAssume() to handle
expressions of the form: 'short x = (y != 10);' While we handle 'int x = (y !=
10)' lazily, the cast to another integer type currently loses the symbolic
constraint. Eager evaluation of the constraint causes the paths to bifurcate and
eagerly evaluate 'y != 10' to a constant of 1 or 0. This should address
<rdar://problem/6619921> until we have a better (more lazy approach) for
handling promotions/truncations of symbolic integer values.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65480 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImprove location information on "reused" class template specialization
Douglas Gregor [Wed, 25 Feb 2009 22:18:32 +0000 (22:18 +0000)]
Improve location information on "reused" class template specialization
decls. Test and document the semantic location of class template
specialization definitions that occur within a scope enclosing the
scope of the class template.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65478 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPerform additional semantic checking of class template
Douglas Gregor [Wed, 25 Feb 2009 22:02:03 +0000 (22:02 +0000)]
Perform additional semantic checking of class template
specializations. In particular:

  - Make sure class template specializations have a "template<>"
    header, and complain if they don't.
  - Make sure class template specializations are declared/defined
    within a valid context. (e.g., you can't declare a specialization
    std::vector<MyType> in the global namespace).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65476 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDo not automatically run the 'missing -dealloc' check until we have adequate time...
Ted Kremenek [Wed, 25 Feb 2009 21:08:30 +0000 (21:08 +0000)]
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

15 years agoTemporarily disable clearing of insert point (to indicate unreachable
Daniel Dunbar [Wed, 25 Feb 2009 20:59:29 +0000 (20:59 +0000)]
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

15 years agoAllow constant initializers to reference their defining decl.
Daniel Dunbar [Wed, 25 Feb 2009 20:08:33 +0000 (20:08 +0000)]
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

15 years agoInclude the appropriate header for malloc
Douglas Gregor [Wed, 25 Feb 2009 19:48:02 +0000 (19:48 +0000)]
Include the appropriate header for malloc

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65471 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFold GeneraticStaticBlockVarDecl into callers.
Daniel Dunbar [Wed, 25 Feb 2009 19:45:19 +0000 (19:45 +0000)]
Fold GeneraticStaticBlockVarDecl into callers.
 - No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65470 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement parsing of nested-name-specifiers that involve template-ids, e.g.,
Douglas Gregor [Wed, 25 Feb 2009 19:37:18 +0000 (19:37 +0000)]
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

15 years agoPull COdeGenFunction::CreateStaticBlockVarDecl (just for creating the
Daniel Dunbar [Wed, 25 Feb 2009 19:24:29 +0000 (19:24 +0000)]
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

15 years agoadd c++ search path for GCC 4.2, PR3668, patch by Pawel Worach!
Chris Lattner [Wed, 25 Feb 2009 18:06:37 +0000 (18:06 +0000)]
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

15 years agoUse CheckAssignmentConstraints for checking the cleanup attr function. Fixes PR3656.
Anders Carlsson [Wed, 25 Feb 2009 17:19:08 +0000 (17:19 +0000)]
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

15 years agoC99 DR #316 implies that the function parameter types that are known
Douglas Gregor [Wed, 25 Feb 2009 16:33:18 +0000 (16:33 +0000)]
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

15 years agofix (hopefully) some validation errors
Gabor Greif [Wed, 25 Feb 2009 15:22:45 +0000 (15:22 +0000)]
fix (hopefully) some validation errors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65455 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agominor tweaks to readability
Gabor Greif [Wed, 25 Feb 2009 09:45:40 +0000 (09:45 +0000)]
minor tweaks to readability

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65440 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoupdate
Chris Lattner [Wed, 25 Feb 2009 05:43:33 +0000 (05:43 +0000)]
update

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65433 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoHeaders are basically done, debug info is just about done (and
Chris Lattner [Wed, 25 Feb 2009 05:39:01 +0000 (05:39 +0000)]
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

15 years agoclang seems "generally useful" for c and objc by now, though obviously bugs
Chris Lattner [Wed, 25 Feb 2009 05:35:47 +0000 (05:35 +0000)]
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

15 years agoMinor cleanup for IntToBlockPointer so it applies to all callers of
Eli Friedman [Wed, 25 Feb 2009 04:20:42 +0000 (04:20 +0000)]
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

15 years agoretain/release checker: Implement basic tracking of autorelease stack. Next thing...
Ted Kremenek [Wed, 25 Feb 2009 02:54:57 +0000 (02:54 +0000)]
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

15 years agoImplement 'Add' method for GRStatePartialTrait<ImmutableList<T>>.
Ted Kremenek [Wed, 25 Feb 2009 02:54:00 +0000 (02:54 +0000)]
Implement 'Add' method for GRStatePartialTrait<ImmutableList<T>>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65424 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix comments.
Devang Patel [Wed, 25 Feb 2009 01:36:11 +0000 (01:36 +0000)]
Fix comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65423 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEnable debug info emission for objc methods.
Devang Patel [Wed, 25 Feb 2009 01:09:46 +0000 (01:09 +0000)]
Enable debug info emission for objc methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65422 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate checker build.
Ted Kremenek [Wed, 25 Feb 2009 00:54:41 +0000 (00:54 +0000)]
Update checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65421 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove a FIXME; I was mistaken in believing gcc rejected this.
Daniel Dunbar [Wed, 25 Feb 2009 00:22:25 +0000 (00:22 +0000)]
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

15 years agoFix condition in ccc-analyzer that would cause the analyzer never to be run.
Ted Kremenek [Wed, 25 Feb 2009 00:10:37 +0000 (00:10 +0000)]
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

15 years agoMinor refactoring.
Fariborz Jahanian [Tue, 24 Feb 2009 23:38:42 +0000 (23:38 +0000)]
Minor refactoring.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65414 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agopatch for two things.
Fariborz Jahanian [Tue, 24 Feb 2009 23:34:44 +0000 (23:34 +0000)]
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

15 years agoFix broken logic from my last commit. Branches only occur at basic blocks that end...
Ted Kremenek [Tue, 24 Feb 2009 23:34:17 +0000 (23:34 +0000)]
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

15 years agoFix diagnostic regression where the leak diagnostic could appear earlier in the path...
Ted Kremenek [Tue, 24 Feb 2009 23:30:57 +0000 (23:30 +0000)]
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

15 years agoIf Loc is invalid (e.g. "self" in Objective-C) then use MainFileID's compile unit.
Devang Patel [Tue, 24 Feb 2009 23:16:03 +0000 (23:16 +0000)]
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

15 years agohandle @encode interactions with array initializers.
Chris Lattner [Tue, 24 Feb 2009 23:10:27 +0000 (23:10 +0000)]
handle @encode interactions with array initializers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65401 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorename CheckStringLiteralInit to CheckStringInit and pass in the
Chris Lattner [Tue, 24 Feb 2009 23:01:39 +0000 (23:01 +0000)]
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

15 years agomake SemaRef be a reference to sema, not a pointer.
Chris Lattner [Tue, 24 Feb 2009 22:50:46 +0000 (22:50 +0000)]
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

15 years agomove InitListChecker to be private to SemaInit.cpp
Chris Lattner [Tue, 24 Feb 2009 22:48:58 +0000 (22:48 +0000)]
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

15 years agoMake CheckSingleInitializer a static function in SemaInit.cpp
Chris Lattner [Tue, 24 Feb 2009 22:46:58 +0000 (22:46 +0000)]
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

15 years agomake CheckStringLiteralInit a static function in SemaInit.cpp
Chris Lattner [Tue, 24 Feb 2009 22:41:04 +0000 (22:41 +0000)]
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

15 years agochange IsStringLiteralInit into a static function in SemaInit.cpp
Chris Lattner [Tue, 24 Feb 2009 22:36:59 +0000 (22:36 +0000)]
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

15 years agomove some initialization checking code from SemaDecl.cpp
Chris Lattner [Tue, 24 Feb 2009 22:27:37 +0000 (22:27 +0000)]
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

15 years agofirst wave of fixes for @encode sema support. This is part of PR3648.
Chris Lattner [Tue, 24 Feb 2009 22:18:39 +0000 (22:18 +0000)]
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

15 years agoccc-analyzer: Don't analyze files with '-arch ppc' or '-arch ppc64' since Clang
Ted Kremenek [Tue, 24 Feb 2009 22:07:12 +0000 (22:07 +0000)]
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

15 years agosome minor cleanups, handle ObjCEncodeExpr in a couple places.
Chris Lattner [Tue, 24 Feb 2009 21:54:33 +0000 (21:54 +0000)]
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

15 years agoimprove comments.
Chris Lattner [Tue, 24 Feb 2009 21:52:14 +0000 (21:52 +0000)]
improve comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65388 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSet flag for -fobjc-gc in IMAGE_INFO variable.
Fariborz Jahanian [Tue, 24 Feb 2009 21:08:09 +0000 (21:08 +0000)]
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

15 years agoWhen we're declaring an object or function with linkage, teach name
Douglas Gregor [Tue, 24 Feb 2009 20:03:32 +0000 (20:03 +0000)]
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

15 years agoExtend the implicit declaration and checking against out-of-scope
Douglas Gregor [Tue, 24 Feb 2009 19:23:27 +0000 (19:23 +0000)]
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

15 years agoretain/release checker:
Ted Kremenek [Tue, 24 Feb 2009 19:15:11 +0000 (19:15 +0000)]
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

15 years agoFix IRgen of constant expressions referring to external/static
Daniel Dunbar [Tue, 24 Feb 2009 18:41:57 +0000 (18:41 +0000)]
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

15 years agoSome initial Obj-C zero cost EH support.
Daniel Dunbar [Tue, 24 Feb 2009 07:47:38 +0000 (07:47 +0000)]
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

15 years agoAdd a very primitive clang based multifile 'delta'.
Daniel Dunbar [Tue, 24 Feb 2009 07:42:32 +0000 (07:42 +0000)]
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

15 years agoAdd a note about an IRgen optimization opportunity.
Daniel Dunbar [Tue, 24 Feb 2009 06:34:04 +0000 (06:34 +0000)]
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

15 years agoFix PR3635 by handling ## magically
Chris Lattner [Tue, 24 Feb 2009 05:29:33 +0000 (05:29 +0000)]
Fix PR3635 by handling ## magically

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65374 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIn C, when we see a function declaration within a local scope, export
Douglas Gregor [Tue, 24 Feb 2009 04:26:15 +0000 (04:26 +0000)]
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

15 years agoPrevent accidental copying of CodeGenFunction and CodeGenModule.
Anders Carlsson [Tue, 24 Feb 2009 04:21:31 +0000 (04:21 +0000)]
Prevent accidental copying of CodeGenFunction and CodeGenModule.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65372 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPass the CodeGenModule object to GenerateBlockFunction, instead of *this (which will...
Anders Carlsson [Tue, 24 Feb 2009 04:19:41 +0000 (04:19 +0000)]
Pass the CodeGenModule object to GenerateBlockFunction, instead of *this (which will call the copy constructor).

Also, since we're creating a new CodeGenFunction object for each block function, we don't need to clear the BreakContinueStack.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65371 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEnsure that we can't break or continue out of a block.
Mike Stump [Tue, 24 Feb 2009 02:59:30 +0000 (02:59 +0000)]
Ensure that we can't break or continue out of a block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65370 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoscan-build: Prune off any trailing '/' characters in the output directory path.
Ted Kremenek [Tue, 24 Feb 2009 02:38:02 +0000 (02:38 +0000)]
scan-build: Prune off any trailing '/' characters in the output directory path.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65368 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix <rdar://problem/6611677>: Add basic transfer function support in the static
Ted Kremenek [Tue, 24 Feb 2009 02:23:11 +0000 (02:23 +0000)]
Fix <rdar://problem/6611677>: Add basic transfer function support in the static
analyzer for array subscript expressions involving bases that are vectors. This
solution is probably a hack: it gets the lvalue of the vector instead of an
rvalue like all other types. This should be reviewed (big FIXME in
GRExprEngine).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65366 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix two @synchronized bugs found by inspection: the expression to sychronize on shoul...
Daniel Dunbar [Tue, 24 Feb 2009 01:43:46 +0000 (01:43 +0000)]
Fix two @synchronized bugs found by inspection: the expression to sychronize on should only be evaluated once, and it is evaluated outside the cleanup scope.

Also, lift SyncEnter and SyncExit up in nervous anticipation of x86-64
zero cost EH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65362 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPTH: Cache *un-cleaned* spellings for literals instead of cleaned spellings.
Ted Kremenek [Tue, 24 Feb 2009 01:26:56 +0000 (01:26 +0000)]
PTH: Cache *un-cleaned* spellings for literals instead of cleaned spellings.
This allows the PTH file to stay 100% in fidelity with the source code and
defines away some weird cosmetic bugs for operations such as '-E' where
maintaining knowledge of the original literal representation is useful.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65361 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImprove merging of function declarations. Specifically:
Douglas Gregor [Tue, 24 Feb 2009 01:23:02 +0000 (01:23 +0000)]
Improve merging of function declarations. Specifically:

  - When we are declaring a function in local scope, we can merge with
    a visible declaration from an outer scope if that declaration
    refers to an entity with linkage. This behavior now works in C++
    and properly ignores entities without linkage.
  - Diagnose the use of "static" on a function declaration in local
    scope.
  - Diagnose the declaration of a static function after a non-static
    declaration of the same function.
  - Propagate the storage specifier to a function declaration from a
    prior declaration (PR3425)
  - Don't name-mangle "main"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65360 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPTH: When emitting tokens for literals with cached spellings, change the token
Ted Kremenek [Tue, 24 Feb 2009 00:30:21 +0000 (00:30 +0000)]
PTH: When emitting tokens for literals with cached spellings, change the token
size to that of the *cleaned* spelling. This way 'getSpelling()' for literals in
the Preprocessor just works and doesn't read beyond the bounds of the cached
spelling buffer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65354 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdated checker build.
Ted Kremenek [Mon, 23 Feb 2009 23:37:29 +0000 (23:37 +0000)]
Updated checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65350 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoccc: Don't remove result files on error when -save-temps is present.
Daniel Dunbar [Mon, 23 Feb 2009 23:37:18 +0000 (23:37 +0000)]
ccc: Don't remove result files on error when -save-temps is present.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65349 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMove PTHStatCache within the anonymous namespace.
Ted Kremenek [Mon, 23 Feb 2009 23:27:54 +0000 (23:27 +0000)]
Move PTHStatCache within the anonymous namespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65348 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTidy up 'ExecutionContinues' to distinguish between jumping to the end of a 'method...
Ted Kremenek [Mon, 23 Feb 2009 23:13:51 +0000 (23:13 +0000)]
Tidy up 'ExecutionContinues' to distinguish between jumping to the end of a 'method' or 'funciton'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65346 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFind 'clang' in 'bin' subdirectory instead of 'cbin'.
Ted Kremenek [Mon, 23 Feb 2009 23:01:06 +0000 (23:01 +0000)]
Find 'clang' in 'bin' subdirectory instead of 'cbin'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65343 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTidy up the path diagnostic generation logic in BugReporter and remove a case where...
Ted Kremenek [Mon, 23 Feb 2009 22:44:26 +0000 (22:44 +0000)]
Tidy up the path diagnostic generation logic in BugReporter and remove a case where an "Execution continues..." diagnostic could result in an empty message bubble.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65342 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix rdar://6611778, a redefinition of an interface was causing an
Chris Lattner [Mon, 23 Feb 2009 22:00:08 +0000 (22:00 +0000)]
fix rdar://6611778, a redefinition of an interface was causing an
assertion when the ivars and method list was reset into the existing
interface.  To fix this, mark decls as invalid when they are redefined,
and don't insert ivars/methods into invalid decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65340 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoGoodbye old-ccc; please use tools/ccc/ccc.
Daniel Dunbar [Mon, 23 Feb 2009 19:17:09 +0000 (19:17 +0000)]
Goodbye old-ccc; please use tools/ccc/ccc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65335 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWe should not generate __weak write barrier on indirect reference
Fariborz Jahanian [Mon, 23 Feb 2009 18:59:50 +0000 (18:59 +0000)]
We should not generate __weak write barrier on indirect reference
of a pointer to object; This patch does this odd behavior according to
gcc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65334 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago- Generate error for protocol qualifiers on 'Class'.
Steve Naroff [Mon, 23 Feb 2009 18:53:24 +0000 (18:53 +0000)]
- Generate error for protocol qualifiers on 'Class'.
- Generate error for protocol qualifiers on non-ObjC types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65333 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRevert http://llvm.org/viewvc/llvm-project?view=rev&revision=65244.
Steve Naroff [Mon, 23 Feb 2009 18:36:16 +0000 (18:36 +0000)]
Revert http://llvm.org/viewvc/llvm-project?view=rev&revision=65244.

Remove support for "Class<P>". Will be making this an error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65332 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd copy assignment operator, caught by doug.
Chris Lattner [Mon, 23 Feb 2009 18:17:44 +0000 (18:17 +0000)]
Add copy assignment operator, caught by doug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65331 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd more boilerplate logic to more accurately reason about autorelease pools.
Ted Kremenek [Mon, 23 Feb 2009 17:45:03 +0000 (17:45 +0000)]
Add more boilerplate logic to more accurately reason about autorelease pools.
This doesn't change the current functionality, but better codifies the
autorelease pool stack itself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65328 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd low level support for generating invoke instead of calls.
Daniel Dunbar [Mon, 23 Feb 2009 17:26:39 +0000 (17:26 +0000)]
Add low level support for generating invoke instead of calls.
 - No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65325 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix 80 col. violations.
Ted Kremenek [Mon, 23 Feb 2009 16:54:00 +0000 (16:54 +0000)]
Fix 80 col. violations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65322 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPer Chris L.'s suggestion, use getAsFunctionType() instead of getDesguaredType()...
Ted Kremenek [Mon, 23 Feb 2009 16:51:39 +0000 (16:51 +0000)]
Per Chris L.'s suggestion, use getAsFunctionType() instead of getDesguaredType().  Constify some pointers along the way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65321 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove isSuperExpr(), which ignores any casts on 'super'.
Steve Naroff [Mon, 23 Feb 2009 15:40:48 +0000 (15:40 +0000)]
Remove isSuperExpr(), which ignores any casts on 'super'.
I don't think casting super makes any sense (since it won't effect method lookup).
Will discuss with other offline and decide what to do.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65317 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoA few small improvements to Evaluate for stuff I noted in FIXMEs.
Eli Friedman [Mon, 23 Feb 2009 04:23:56 +0000 (04:23 +0000)]
A few small improvements to Evaluate for stuff I noted in FIXMEs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65305 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoretain/release checker: For now don't track the retain count of NSWindow objects...
Ted Kremenek [Mon, 23 Feb 2009 02:51:29 +0000 (02:51 +0000)]
retain/release checker: For now don't track the retain count of NSWindow objects (opt for false negatives).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65304 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMore retain/release naming convention tests.
Ted Kremenek [Mon, 23 Feb 2009 02:50:20 +0000 (02:50 +0000)]
More retain/release naming convention tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65303 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove typo.
Ted Kremenek [Mon, 23 Feb 2009 02:42:56 +0000 (02:42 +0000)]
Remove typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65302 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago'[NSAutoreleasePool addObject:]' has an 'autorelease' effect, not a DoNothing effect.
Ted Kremenek [Mon, 23 Feb 2009 02:31:16 +0000 (02:31 +0000)]
'[NSAutoreleasePool addObject:]' has an 'autorelease' effect, not a DoNothing effect.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65301 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSema::ActOnInstanceMessage(): Tighen up the lookup rules for handling messages to...
Steve Naroff [Mon, 23 Feb 2009 02:25:40 +0000 (02:25 +0000)]
Sema::ActOnInstanceMessage(): Tighen up the lookup rules for handling messages to 'Class'. Also improve "super" handling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65300 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd test case for PR 2599.
Ted Kremenek [Mon, 23 Feb 2009 01:29:25 +0000 (01:29 +0000)]
Add test case for PR 2599.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65299 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMinor cleanup, replace bool with qual_empty().
Steve Naroff [Sun, 22 Feb 2009 19:41:00 +0000 (19:41 +0000)]
Minor cleanup, replace bool with qual_empty().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65293 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoContains the following (related to problems found while investigting <rdar://problem...
Steve Naroff [Sun, 22 Feb 2009 19:35:57 +0000 (19:35 +0000)]
Contains the following (related to problems found while investigting <rdar://problem/6497631> Message lookup is sometimes different than gcc's).

- Implement instance/class overloading in ObjCContainerDecl (removing a FIXME). This involved hacking NamedDecl::declarationReplaces(), which took awhile to figure out (didn't realize replace was the default).
- Changed Sema::ActOnInstanceMessage() to remove redundant warnings when dealing with protocols. For now, I've omitted the "protocol" term in the diagnostic. It simplifies the code flow and wan't always 100% accurate (e.g. "Foo<Prot>" looks in the class interface, not just the protocol).
- Changed several test cases to jive with the above changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65292 91177308-0d34-0410-b5e6-96231b3b80d8