]> granicus.if.org Git - clang/log
clang
15 years agoKick out the proof-of-concept ASTOwner and replace it with ASTOwningResult
Sebastian Redl [Tue, 9 Dec 2008 20:22:58 +0000 (20:22 +0000)]
Kick out the proof-of-concept ASTOwner and replace it with ASTOwningResult

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

15 years agoAdd preliminary CFG support for @throw. We basically treat it like a return statement.
Ted Kremenek [Tue, 9 Dec 2008 20:20:09 +0000 (20:20 +0000)]
Add preliminary CFG support for @throw.  We basically treat it like a return statement.

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

15 years agoIn GRExprEngine treat @throw as an 'abort' that ends the current path. This is a...
Ted Kremenek [Tue, 9 Dec 2008 20:18:58 +0000 (20:18 +0000)]
In GRExprEngine treat @throw as an 'abort' that ends the current path.  This is a temporary solution.

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

15 years agoLay the groundwork for converting the entire parser-sema chain to smart pointers.
Sebastian Redl [Tue, 9 Dec 2008 19:36:21 +0000 (19:36 +0000)]
Lay the groundwork for converting the entire parser-sema chain to smart pointers.

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

15 years agoSema::ActOnMethodDeclaration(): Make sure we perform the default function/array conve...
Steve Naroff [Tue, 9 Dec 2008 19:36:17 +0000 (19:36 +0000)]
Sema::ActOnMethodDeclaration(): Make sure we perform the default function/array conversion for parameter types.

This fixes <rdar://problem/6424064> checker on xcode: (possible bad AST) can the type of a method parameter really have "isFunctionType() == true"?
and http://llvm.org/bugs/show_bug.cgi?id=2997.

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

15 years agoFix a serious null termination bug found by David Chisnall!
Chris Lattner [Tue, 9 Dec 2008 19:10:54 +0000 (19:10 +0000)]
Fix a serious null termination bug found by David Chisnall!

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

15 years agoFill in C++ status table for expressions.
Sebastian Redl [Tue, 9 Dec 2008 14:40:01 +0000 (14:40 +0000)]
Fill in C++ status table for expressions.

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

15 years agoConsistently use smart pointers for stmt and expr nodes in parser local variables.
Sebastian Redl [Tue, 9 Dec 2008 13:15:23 +0000 (13:15 +0000)]
Consistently use smart pointers for stmt and expr nodes in parser local variables.

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

15 years agoFix <rdar://problem/6429113> clang ObjC rewriter: crash rewriting file with Blocks...
Steve Naroff [Tue, 9 Dec 2008 12:56:34 +0000 (12:56 +0000)]
Fix <rdar://problem/6429113> clang ObjC rewriter: crash rewriting file with Blocks and properties

More fancy footwork to cope with rewriting property 'setters'.

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

15 years agoinitialize member variable.
Zhongxing Xu [Tue, 9 Dec 2008 12:26:46 +0000 (12:26 +0000)]
initialize member variable.

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

15 years agoAdd utility method. Remove an unused method.
Zhongxing Xu [Tue, 9 Dec 2008 10:51:19 +0000 (10:51 +0000)]
Add utility method. Remove an unused method.

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

15 years ago[static analyzer] Extend VLA size checking to look for undefined sizes.
Ted Kremenek [Tue, 9 Dec 2008 00:44:16 +0000 (00:44 +0000)]
[static analyzer] Extend VLA size checking to look for undefined sizes.

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

15 years agoUpdate Driver to new interface for LiveVariables.
Ted Kremenek [Tue, 9 Dec 2008 00:17:51 +0000 (00:17 +0000)]
Update Driver to new interface for LiveVariables.

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

15 years agoAdd zero-sized VLA check test case.
Ted Kremenek [Tue, 9 Dec 2008 00:14:48 +0000 (00:14 +0000)]
Add zero-sized VLA check test case.

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

15 years agoFixed LiveVariables bug where we didn't consider block-level expressions that functio...
Ted Kremenek [Tue, 9 Dec 2008 00:14:14 +0000 (00:14 +0000)]
Fixed LiveVariables bug where we didn't consider block-level expressions that functioned as the size of a VLA to be live.

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

15 years agoChange condition under which 'retain'/'copy' are directly evaluated.
Fariborz Jahanian [Mon, 8 Dec 2008 23:56:17 +0000 (23:56 +0000)]
Change condition under which 'retain'/'copy' are directly evaluated.

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

15 years agoAdd checking for zero-sized VLAs.
Ted Kremenek [Mon, 8 Dec 2008 22:47:34 +0000 (22:47 +0000)]
Add checking for zero-sized VLAs.

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

15 years agoIncorporate MissingDealloc_IBOutlet.m test case into MissingDealloc.m
Ted Kremenek [Mon, 8 Dec 2008 22:05:43 +0000 (22:05 +0000)]
Incorporate MissingDealloc_IBOutlet.m test case into MissingDealloc.m

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

15 years agoIncorporate MissingDeallc_SEL.m test case into MissingDealloc.m
Ted Kremenek [Mon, 8 Dec 2008 22:01:50 +0000 (22:01 +0000)]
Incorporate MissingDeallc_SEL.m test case into MissingDealloc.m

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

15 years agoAdd test case for <rdar://problem/6380411>.
Ted Kremenek [Mon, 8 Dec 2008 21:59:21 +0000 (21:59 +0000)]
Add test case for <rdar://problem/6380411>.

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

15 years agoFix PR3172: if we see an eof or } at the top level, reject it.
Chris Lattner [Mon, 8 Dec 2008 21:59:01 +0000 (21:59 +0000)]
Fix PR3172: if we see an eof or } at the top level, reject it.
This is important because ParseDeclarationOrFunctionDefinition
skips to, but does not consume, an } on error.

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

15 years agoimprove comment.
Chris Lattner [Mon, 8 Dec 2008 21:53:24 +0000 (21:53 +0000)]
improve comment.

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

15 years ago'self.myIvar = nil' (properties) only releases myIvar when the property has kind...
Ted Kremenek [Mon, 8 Dec 2008 21:44:15 +0000 (21:44 +0000)]
'self.myIvar = nil' (properties) only releases myIvar when the property has kind 'assign'.  This fixes <rdar://problem/6380411>.

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

15 years agoObjCInterfaceDecl::lookupInstanceMethod() needs to look through a categories protocols.
Steve Naroff [Mon, 8 Dec 2008 20:57:28 +0000 (20:57 +0000)]
ObjCInterfaceDecl::lookupInstanceMethod() needs to look through a categories protocols.

Fixes <rdar://problem/6418640> clang on prokit: error: incompatible type returning 'id', expected 'NSSize'

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

15 years agoFix a couple uninitialized variables from my previous commit.
Steve Naroff [Mon, 8 Dec 2008 20:01:41 +0000 (20:01 +0000)]
Fix a couple uninitialized variables from my previous commit.

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

15 years agoRemove the #include of ScheduleDAGSDNodes.h, which is no longer necessary.
Dan Gohman [Mon, 8 Dec 2008 19:45:33 +0000 (19:45 +0000)]
Remove the #include of ScheduleDAGSDNodes.h, which is no longer necessary.

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

15 years agoChanged 'readonly' 'retain/copy' diagnostics into
Fariborz Jahanian [Mon, 8 Dec 2008 19:28:10 +0000 (19:28 +0000)]
Changed 'readonly' 'retain/copy' diagnostics into
warning as it is allowed in gcc and will break projects.

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

15 years agoSince we do not allow a readonly property to be 'copy'retain', we
Fariborz Jahanian [Mon, 8 Dec 2008 18:47:29 +0000 (18:47 +0000)]
Since we do not allow a readonly property to be 'copy'retain', we
must allow the continuation class to extend it to a 'readwrite'
and 'copy/retain'.

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

15 years agoMove Sema::isTemplateParameterDecl to Decl::isTemplateParameter, where it belongs
Douglas Gregor [Mon, 8 Dec 2008 18:40:42 +0000 (18:40 +0000)]
Move Sema::isTemplateParameterDecl to Decl::isTemplateParameter, where it belongs

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

15 years agoFix <rdar://problem/6423452> clang ObjC rewriter: Don't use __declspec(dllimport...
Steve Naroff [Mon, 8 Dec 2008 17:30:33 +0000 (17:30 +0000)]
Fix <rdar://problem/6423452> clang ObjC rewriter: Don't use __declspec(dllimport) for Blocks functions, as they are linked statically.

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

15 years agoHandle chained/nested property 'getters' (obj.p1.p2.p3).
Steve Naroff [Mon, 8 Dec 2008 16:43:47 +0000 (16:43 +0000)]
Handle chained/nested property 'getters' (obj.p1.p2.p3).

This is a follow-up to fixing <rdar://problem/6213955> clang ObjC rewriter: rewriter doesn't appear to support @property and @synthesize.

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

15 years agoFill in some parts of cxx_status.html
Sebastian Redl [Mon, 8 Dec 2008 16:24:08 +0000 (16:24 +0000)]
Fill in some parts of cxx_status.html

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

15 years agofix 80-col violation.
Zhongxing Xu [Mon, 8 Dec 2008 07:14:51 +0000 (07:14 +0000)]
fix 80-col violation.

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

15 years agofix typo.
Zhongxing Xu [Mon, 8 Dec 2008 05:12:38 +0000 (05:12 +0000)]
fix typo.

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

15 years agoWorkaround for PR3173. The fix is correct in the sense that if the enum
Eli Friedman [Mon, 8 Dec 2008 02:21:03 +0000 (02:21 +0000)]
Workaround for PR3173.  The fix is correct in the sense that if the enum
code were working correctly, it would be a no-op, but it's not really a
proper fix.  That said, I don't really want to touch the enum code at
the moment because I don't understand it very well, and this seems to
be a relatively visible regression.

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

15 years agoFix outdated comment. Checks so much more than just typedefs in C++.
Sebastian Redl [Sun, 7 Dec 2008 20:13:57 +0000 (20:13 +0000)]
Fix outdated comment. Checks so much more than just typedefs in C++.

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

15 years agoadd missing gentoo c++ include paths
Nuno Lopes [Sun, 7 Dec 2008 12:11:37 +0000 (12:11 +0000)]
add missing gentoo c++ include paths

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

15 years agoa minor grammar fix
Chris Lattner [Sun, 7 Dec 2008 00:59:53 +0000 (00:59 +0000)]
a minor grammar fix

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

15 years agoPass the VLA size expr range to the VLA diags
Anders Carlsson [Sun, 7 Dec 2008 00:49:48 +0000 (00:49 +0000)]
Pass the VLA size expr range to the VLA diags

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

15 years agoImprove VLA diagnostics/sema checking. Fixes PR2361 and PR2352.
Anders Carlsson [Sun, 7 Dec 2008 00:20:55 +0000 (00:20 +0000)]
Improve VLA diagnostics/sema checking. Fixes PR2361 and PR2352.

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

15 years agoSetters returning a typedef of 'void' should not cause error.
Fariborz Jahanian [Sat, 6 Dec 2008 23:12:49 +0000 (23:12 +0000)]
Setters returning a typedef of 'void' should not cause error.
Bug reported by Chris L.

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

15 years agoUse of properties declared in protocols in the category
Fariborz Jahanian [Sat, 6 Dec 2008 23:03:39 +0000 (23:03 +0000)]
Use of properties declared in protocols in the category
via the category's protocol list1s, with appropriate
diagnsostics and a test case.

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

15 years agoSimplify test.
Anders Carlsson [Sat, 6 Dec 2008 22:27:22 +0000 (22:27 +0000)]
Simplify test.

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

15 years agoImprove error reporting of property and setter/getter
Fariborz Jahanian [Sat, 6 Dec 2008 21:48:16 +0000 (21:48 +0000)]
Improve error reporting of property and setter/getter
type mimatches.

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

15 years agoCheck for correct'void' return type for setter methods.
Fariborz Jahanian [Sat, 6 Dec 2008 21:11:37 +0000 (21:11 +0000)]
Check for correct'void' return type for setter methods.

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

15 years agoAdd diagnostics for bitfields.
Anders Carlsson [Sat, 6 Dec 2008 20:33:04 +0000 (20:33 +0000)]
Add diagnostics for bitfields.

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

15 years agoFix invalid bit-field.
Anders Carlsson [Sat, 6 Dec 2008 20:32:39 +0000 (20:32 +0000)]
Fix invalid bit-field.

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

15 years agoSimplify some diagnostics.
Anders Carlsson [Sat, 6 Dec 2008 20:05:35 +0000 (20:05 +0000)]
Simplify some diagnostics.

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

15 years agoChanged a 'FIXME' into new comment. Added a test case
Fariborz Jahanian [Sat, 6 Dec 2008 19:59:02 +0000 (19:59 +0000)]
Changed a 'FIXME' into new comment. Added a test case
testing declaration of properties in categories.

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

15 years agoAdd bandaid transfer function support for assignments involving ObjCKVCRefExpr.
Ted Kremenek [Sat, 6 Dec 2008 02:39:30 +0000 (02:39 +0000)]
Add bandaid transfer function support for assignments involving ObjCKVCRefExpr.

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

15 years agoPatch to diagnose a variety of misuse of property
Fariborz Jahanian [Sat, 6 Dec 2008 01:12:43 +0000 (01:12 +0000)]
Patch to diagnose a variety of misuse of property
attributes. Example would be, readonly, assign or
assign, copy, etc.

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

15 years agoAdd support for calls to dependent names within templates, e.g.,
Douglas Gregor [Sat, 6 Dec 2008 00:22:45 +0000 (00:22 +0000)]
Add support for calls to dependent names within templates, e.g.,

  template<typename T> void f(T x) {
    g(x); // g is a dependent name, so don't even bother to look it up
    g(); // error: g is not a dependent name
  }

Note that when we see "g(", we build a CXXDependentNameExpr. However,
if none of the call arguments are type-dependent, we will force the
resolution of the name "g" and replace the CXXDependentNameExpr with
its result.

GCC actually produces a nice error message when you make this
mistake, and even offers to compile your code with -fpermissive. I'll
do the former next, but I don't plan to do the latter.

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

15 years agoIntroduce basic support for dependent types, type-dependent
Douglas Gregor [Fri, 5 Dec 2008 23:32:09 +0000 (23:32 +0000)]
Introduce basic support for dependent types, type-dependent
expressions, and value-dependent expressions. This permits us to parse
some template definitions.

This is not a complete solution; we're missing type- and
value-dependent computations for most of the expression types, and
we're missing checks for dependent types and type-dependent
expressions throughout Sema.

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

15 years agoFixed a comment.
Fariborz Jahanian [Fri, 5 Dec 2008 22:36:19 +0000 (22:36 +0000)]
Fixed a comment.

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

15 years agoThis test checks for duplicate implementation of the same
Fariborz Jahanian [Fri, 5 Dec 2008 22:32:48 +0000 (22:32 +0000)]
This test checks for duplicate implementation of the same
property. It also checks for duplicate use of the same ivar
in two different iproperty implementations. It also caught
an error for a test case used in CodeGen :).

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

15 years agoFixed a test case. Added a test case showing property setter's
Fariborz Jahanian [Fri, 5 Dec 2008 18:38:31 +0000 (18:38 +0000)]
Fixed a test case. Added a test case showing property setter's
type mismatch (related to my last patch).

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

15 years ago(instance/class) Method type checking between class and its implementation.
Fariborz Jahanian [Fri, 5 Dec 2008 18:18:52 +0000 (18:18 +0000)]
(instance/class) Method type checking between class and its implementation.
(instance/class) Method type checking between category and its implementation.
And a test case for all.

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

15 years agoRepresentation of template type parameters and non-type template
Douglas Gregor [Fri, 5 Dec 2008 18:15:24 +0000 (18:15 +0000)]
Representation of template type parameters and non-type template
parameters, with some semantic analysis:
  - Template parameters are introduced into template parameter scope
  - Complain about template parameter shadowing (except in Microsoft mode)

Note that we leak template parameter declarations like crazy, a
problem we'll remedy once we actually create proper declarations for
templates.

Next up: dependent types and value-dependent/type-dependent
expressions.

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

15 years agoFixed <rdar://problem/6213808> clang ObjC rewriter: @finally is not always executed
Steve Naroff [Fri, 5 Dec 2008 17:03:39 +0000 (17:03 +0000)]
Fixed <rdar://problem/6213808> clang ObjC rewriter: @finally is not always executed

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

15 years agoUse VerifyIntegerConstantExpression instead of isIntegerConstantExpr. Fixes PR2963
Anders Carlsson [Fri, 5 Dec 2008 16:33:57 +0000 (16:33 +0000)]
Use VerifyIntegerConstantExpression instead of isIntegerConstantExpr. Fixes PR2963

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

15 years agoThis wasn't such a good idea after all as it broke some tests.
Anders Carlsson [Fri, 5 Dec 2008 05:24:13 +0000 (05:24 +0000)]
This wasn't such a good idea after all as it broke some tests.

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

15 years agoHandle __builtin___CFStringMakeConstantString in Expr::Evaluate.
Anders Carlsson [Fri, 5 Dec 2008 05:18:05 +0000 (05:18 +0000)]
Handle __builtin___CFStringMakeConstantString in Expr::Evaluate.

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

15 years agoMake Sema::CheckForConstantInitializer use Expr::Evaluate. This fixes PR3130.
Anders Carlsson [Fri, 5 Dec 2008 05:09:56 +0000 (05:09 +0000)]
Make Sema::CheckForConstantInitializer use Expr::Evaluate. This fixes PR3130.

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

15 years agoChange the implementation of symbol_iterator to not use a union and rely on any detai...
Ted Kremenek [Fri, 5 Dec 2008 02:56:39 +0000 (02:56 +0000)]
Change the implementation of symbol_iterator to not use a union and rely on any details of SymbolRef's implementation.

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

15 years agoAdd SymbolRef::print() and have SymbolicRegion::print() use this method instead of...
Ted Kremenek [Fri, 5 Dec 2008 02:45:20 +0000 (02:45 +0000)]
Add SymbolRef::print() and have SymbolicRegion::print() use this method instead of calling SymbolRef::getNumber().

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

15 years agoUse trait-based profiling of SymbolRefs, avoiding calling getNumber() (which will...
Ted Kremenek [Fri, 5 Dec 2008 02:39:38 +0000 (02:39 +0000)]
Use trait-based profiling of SymbolRefs, avoiding calling getNumber() (which will soon be removed).

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

15 years agoRemove (unused) RegionExtent and subclasses. Extents are now represented easily...
Ted Kremenek [Fri, 5 Dec 2008 02:36:00 +0000 (02:36 +0000)]
Remove (unused) RegionExtent and subclasses.  Extents are now represented easily using SVals.

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

15 years agoRename SymbolID to SymbolRef. This is a precursor to some overhauling of the represe...
Ted Kremenek [Fri, 5 Dec 2008 02:27:51 +0000 (02:27 +0000)]
Rename SymbolID to SymbolRef.  This is a precursor to some overhauling of the representation of symbolic values.

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

15 years agoRename: FindContext -> FindDeclVisibleInContext.
Zhongxing Xu [Fri, 5 Dec 2008 01:57:57 +0000 (01:57 +0000)]
Rename: FindContext -> FindDeclVisibleInContext.

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

15 years agoPatch for diagnosing type mismatch between
Fariborz Jahanian [Fri, 5 Dec 2008 01:35:25 +0000 (01:35 +0000)]
Patch for diagnosing type mismatch between
methods in class and its implementation.
This is work in progress.

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

15 years agoRemove SymbolDataContentsOf (unused).
Ted Kremenek [Fri, 5 Dec 2008 01:31:31 +0000 (01:31 +0000)]
Remove SymbolDataContentsOf (unused).

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

15 years agoStoreManager::Retrieve and StoreManager::RemoveDeadBindings now take a GRState* argum...
Ted Kremenek [Fri, 5 Dec 2008 00:47:52 +0000 (00:47 +0000)]
StoreManager::Retrieve and StoreManager::RemoveDeadBindings now take a GRState* argument instead of a Store.  This allows them to use the GDM for storing other data.

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

15 years ago-std=c99 defaults blocks to off even on darwin, but -fblocks overrides
Chris Lattner [Fri, 5 Dec 2008 00:10:44 +0000 (00:10 +0000)]
-std=c99 defaults blocks to off even on darwin, but -fblocks overrides
even it.

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

15 years agoFinish up support for <rdar://problem/6213955> clang ObjC rewriter: rewriter doesn...
Steve Naroff [Thu, 4 Dec 2008 23:50:32 +0000 (23:50 +0000)]
Finish up support for <rdar://problem/6213955> clang ObjC rewriter: rewriter doesn't appear to support @property and @synthesize.

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

15 years agochange getCurFunctionDecl to skip through Block contexts to find
Chris Lattner [Thu, 4 Dec 2008 23:50:19 +0000 (23:50 +0000)]
change getCurFunctionDecl to skip through Block contexts to find
the containing block.  Introduce a new getCurFunctionOrMethodDecl
method to check to see if we're in a function or objc method.
Minor cleanups to other related places.  This fixes rdar://6405429.

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

15 years agoinstead of forcing blocks on by default, make them default to off, but let
Chris Lattner [Thu, 4 Dec 2008 23:20:07 +0000 (23:20 +0000)]
instead of forcing blocks on by default, make them default to off, but let
specific targets default them to on.  Default blocks to on on 10.6 and later.
Add a -fblocks option that allows the user to override the target's default.
Use -fblocks in the various testcases that use blocks.

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

15 years agoOutput better diagnostics for continuation class
Fariborz Jahanian [Thu, 4 Dec 2008 22:56:16 +0000 (22:56 +0000)]
Output better diagnostics for continuation class
property attribute mis-specification.

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

15 years agoreplace useNeXTRuntimeAsDefault with a generic hook that allows targets
Chris Lattner [Thu, 4 Dec 2008 22:54:33 +0000 (22:54 +0000)]
replace useNeXTRuntimeAsDefault with a generic hook that allows targets
to specify their default language options.

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

15 years agoRemove unneeded assertion.
Ted Kremenek [Thu, 4 Dec 2008 22:47:11 +0000 (22:47 +0000)]
Remove unneeded assertion.

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

15 years agoRemove unneeded assertion. We already know that FE->getName() is an absolute path.
Ted Kremenek [Thu, 4 Dec 2008 22:36:44 +0000 (22:36 +0000)]
Remove unneeded assertion.  We already know that FE->getName() is an absolute path.

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

15 years agoCode cleanup in new handling.
Sebastian Redl [Thu, 4 Dec 2008 22:20:51 +0000 (22:20 +0000)]
Code cleanup in new handling.

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

15 years agoUse 'free' to release PerIDCache since it was allocated using calloc().
Ted Kremenek [Thu, 4 Dec 2008 22:09:37 +0000 (22:09 +0000)]
Use 'free' to release PerIDCache since it was allocated using calloc().

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

15 years agoAdd 'expected-warning' to make test case pass.
Ted Kremenek [Thu, 4 Dec 2008 19:44:23 +0000 (19:44 +0000)]
Add 'expected-warning' to make test case pass.

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

15 years agoAdd another static analyzer test case involving attribute(nonnull).
Ted Kremenek [Thu, 4 Dec 2008 19:39:12 +0000 (19:39 +0000)]
Add another static analyzer test case involving attribute(nonnull).

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

15 years agoFix bug in attribute(nonnull) processing where not all of the parameter indices in...
Ted Kremenek [Thu, 4 Dec 2008 19:38:33 +0000 (19:38 +0000)]
Fix bug in attribute(nonnull) processing where not all of the parameter indices in nonnull(...) were actually processed.

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

15 years agoFix build breakage from my previous commit.
Steve Naroff [Thu, 4 Dec 2008 19:10:03 +0000 (19:10 +0000)]
Fix build breakage from my previous commit.

Will discuss with Chris...

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

15 years agoAdd another test case for attribute(nonnull) checking.
Ted Kremenek [Thu, 4 Dec 2008 18:35:53 +0000 (18:35 +0000)]
Add another test case for attribute(nonnull) checking.

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

15 years agoFix some diagnostics and enhance test cases. Now tests member new and ambiguous overl...
Sebastian Redl [Thu, 4 Dec 2008 17:24:46 +0000 (17:24 +0000)]
Fix some diagnostics and enhance test cases. Now tests member new and ambiguous overloads.

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

15 years agoSeveral things...
Steve Naroff [Thu, 4 Dec 2008 16:24:46 +0000 (16:24 +0000)]
Several things...

- Implement RewritePropertySetter(). While the routine is simple, there were some tricky changes to RewriteFunctionBodyOrGlobalInitializer(), the main rewriter loop. It also required some additional instance data to distinguish setters from getters, as well as some changes to RewritePropertyGetter().

- Implement FIXME: for pretty printing ObjCPropertyRefExpr's.

- Changed ObjCPropertyRefExpr::getSourceRange() to point to the end of the property name (not the beginning). Also made a minor name change from "Loc"->"IdLoc" (to make it clear the Loc does not point to the ".").

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

15 years agoMention an optimization opportunity pointed out by Chris.
Daniel Dunbar [Thu, 4 Dec 2008 09:05:45 +0000 (09:05 +0000)]
Mention an optimization opportunity pointed out by Chris.

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

15 years agoRevamp RegionStoreManager::RemoveDeadBindings. This method now does a complete mark...
Ted Kremenek [Thu, 4 Dec 2008 02:08:27 +0000 (02:08 +0000)]
Revamp RegionStoreManager::RemoveDeadBindings.  This method now does a complete mark-and-sweep of the store, removing dead regions and recording the set of live and dead symbols appropriately.

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

15 years agoRevise bogus comment I just committed.
Ted Kremenek [Thu, 4 Dec 2008 02:07:20 +0000 (02:07 +0000)]
Revise bogus comment I just committed.

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

15 years agoAdd comment to test case for documentation.
Ted Kremenek [Thu, 4 Dec 2008 02:06:27 +0000 (02:06 +0000)]
Add comment to test case for documentation.

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

15 years agoUpdate comment.
Ted Kremenek [Thu, 4 Dec 2008 02:06:04 +0000 (02:06 +0000)]
Update comment.

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

15 years agoAdd comments.
Zhongxing Xu [Thu, 4 Dec 2008 01:12:41 +0000 (01:12 +0000)]
Add comments.

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

15 years agoCorrect CodeGen assumption that LongTy == Int32Ty in a few places. This makes several...
Sebastian Redl [Thu, 4 Dec 2008 00:10:55 +0000 (00:10 +0000)]
Correct CodeGen assumption that LongTy == Int32Ty in a few places. This makes several CodeGenObjC tests pass on 64-bit by fixing assertions. This doesn't mean that the result is actually what the GNU runtime expects, though.

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

15 years agoFix some type punning errors in SizeOfAlignOf and Typeid AST nodes. This should satis...
Sebastian Redl [Wed, 3 Dec 2008 23:17:54 +0000 (23:17 +0000)]
Fix some type punning errors in SizeOfAlignOf and Typeid AST nodes. This should satisfy compilers and language lawyers alike.

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

15 years agoAdded GDM query functions "contains" for the data types that support the "Contains...
Ted Kremenek [Wed, 3 Dec 2008 20:49:14 +0000 (20:49 +0000)]
Added GDM query functions "contains" for the data types that support the "Contains" method.

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

15 years agoAdded partial specialization of GRStatePartialTrait<T> with T = ImmutableSet<...>.
Ted Kremenek [Wed, 3 Dec 2008 20:48:33 +0000 (20:48 +0000)]
Added partial specialization of GRStatePartialTrait<T> with T = ImmutableSet<...>.

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

15 years agoOverload resolution for the operator new function. Member version is still untested.
Sebastian Redl [Wed, 3 Dec 2008 20:26:15 +0000 (20:26 +0000)]
Overload resolution for the operator new function. Member version is still untested.

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