]> granicus.if.org Git - clang/log
clang
15 years agoImplement rdar://6138816 - [sema] named bitfields cannot have 0 width
Chris Lattner [Fri, 12 Dec 2008 04:56:04 +0000 (04:56 +0000)]
Implement rdar://6138816 - [sema] named bitfields cannot have 0 width

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

15 years agoIn C++, set the type of each of the enumerators in an enumeration to
Douglas Gregor [Fri, 12 Dec 2008 02:00:36 +0000 (02:00 +0000)]
In C++, set the type of each of the enumerators in an enumeration to
the type of the enumeration once the enumeration has been defined.

Fix the overloading test-case to properly create enums that promote
the way we want them to.

Implement C++0x promotions from enumeration types to long
long/unsigned long long. We're using these promotions in Carbon.h
(since long long is a common extension).

Fixes PR clang/2954: http://llvm.org/bugs/show_bug.cgi?id=2954

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

15 years agoPTH:
Ted Kremenek [Thu, 11 Dec 2008 23:36:38 +0000 (23:36 +0000)]
PTH:
- Added a side-table per each token-cached file with the preprocessor conditional stack.  This tracks what #if's are matched with what #endifs and where their respective tokens are in the PTH file.  This will allow for quick skipping of excluded conditional branches in the Preprocessor.
- Performance testing shows the addition of this information (without actually utilizing it) leads to no performance regressions.

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

15 years agoadd annotation
Chris Lattner [Thu, 11 Dec 2008 23:11:52 +0000 (23:11 +0000)]
add annotation

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

15 years agoConvert a big bunch of expression parsers to use smart pointers.
Sebastian Redl [Thu, 11 Dec 2008 22:51:44 +0000 (22:51 +0000)]
Convert a big bunch of expression parsers to use smart pointers.

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

15 years agoPTHLexer: Keep track of the location of the last '#' token and provide the means...
Ted Kremenek [Thu, 11 Dec 2008 22:41:47 +0000 (22:41 +0000)]
PTHLexer: Keep track of the location of the last '#' token and provide the means to jump ahead in the token stream.

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

15 years agoConvert some more expression parsers to use smart pointers.
Sebastian Redl [Thu, 11 Dec 2008 22:33:27 +0000 (22:33 +0000)]
Convert some more expression parsers to use smart pointers.

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

15 years agoConvert selected expression parsers to use smart pointers.
Sebastian Redl [Thu, 11 Dec 2008 21:36:32 +0000 (21:36 +0000)]
Convert selected expression parsers to use smart pointers.

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

15 years agoRename a local predicate to avoid confusion with Type::isBlockPointerType().
Steve Naroff [Thu, 11 Dec 2008 21:05:33 +0000 (21:05 +0000)]
Rename a local predicate to avoid confusion with Type::isBlockPointerType().

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

15 years agoFixup generated code for imported block decl refs.
Steve Naroff [Thu, 11 Dec 2008 20:51:38 +0000 (20:51 +0000)]
Fixup generated code for imported block decl refs.
Found while investigating <rdar://problem/6435837> clang ObjC rewriter: use Block_release instead of Block_destroy.

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

15 years agoAddress some comments on the name lookup/DeclContext patch from Chris
Douglas Gregor [Thu, 11 Dec 2008 20:41:00 +0000 (20:41 +0000)]
Address some comments on the name lookup/DeclContext patch from Chris

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

15 years agoRemove unused ivar CurTokenIdx.
Ted Kremenek [Thu, 11 Dec 2008 20:39:48 +0000 (20:39 +0000)]
Remove unused ivar CurTokenIdx.

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

15 years agoConvert the remaining statement parsers to smart pointers.
Sebastian Redl [Thu, 11 Dec 2008 20:12:42 +0000 (20:12 +0000)]
Convert the remaining statement parsers to smart pointers.

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

15 years agoConvert some more statement parsers to smart pointers.
Sebastian Redl [Thu, 11 Dec 2008 19:48:14 +0000 (19:48 +0000)]
Convert some more statement parsers to smart pointers.

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

15 years agoFix <rdar://problem/6435842> clang ObjC rewriter: #include Block.h, Block_private...
Steve Naroff [Thu, 11 Dec 2008 19:43:14 +0000 (19:43 +0000)]
Fix <rdar://problem/6435842> clang ObjC rewriter: #include Block.h, Block_private.h or come up with #define to prevent double-definition

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

15 years agoConvert a number of statement parsers to smart pointers.
Sebastian Redl [Thu, 11 Dec 2008 19:30:53 +0000 (19:30 +0000)]
Convert a number of statement parsers to smart pointers.

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

15 years agoFix <rdar://problem/6435382> clang ObjC rewriter: @property/@synthesize and blocks...
Steve Naroff [Thu, 11 Dec 2008 19:29:16 +0000 (19:29 +0000)]
Fix <rdar://problem/6435382> clang ObjC rewriter: @property/@synthesize and blocks don't work together

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

15 years agoActually distinguish between RecordDecl::field_iterator and RecordDecl::field_const_i...
Douglas Gregor [Thu, 11 Dec 2008 17:59:21 +0000 (17:59 +0000)]
Actually distinguish between RecordDecl::field_iterator and RecordDecl::field_const_iterator, propagating the constness down to the FieldDecls.

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

15 years agoUnifies the name-lookup mechanisms used in various parts of the AST
Douglas Gregor [Thu, 11 Dec 2008 16:49:14 +0000 (16:49 +0000)]
Unifies the name-lookup mechanisms used in various parts of the AST
and separates lexical name lookup from qualified name lookup. In
particular:
  * Make DeclContext the central data structure for storing and
    looking up declarations within existing declarations, e.g., members
    of structs/unions/classes, enumerators in C++0x enums, members of
    C++ namespaces, and (later) members of Objective-C
    interfaces/implementations. DeclContext uses a lazily-constructed
    data structure optimized for fast lookup (array for small contexts,
    hash table for larger contexts).

  * Implement C++ qualified name lookup in terms of lookup into
    DeclContext.

  * Implement C++ unqualified name lookup in terms of
    qualified+unqualified name lookup (since unqualified lookup is not
    purely lexical in C++!)

  * Limit the use of the chains of declarations stored in
    IdentifierInfo to those names declared lexically.

  * Eliminate CXXFieldDecl, collapsing its behavior into
    FieldDecl. (FieldDecl is now a ScopedDecl).

  * Make RecordDecl into a DeclContext and eliminates its
    Members/NumMembers fields (since one can just iterate through the
    DeclContext to get the fields).

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

15 years agoIdentify AnonPointeeRegion by the symbol that is concretized.
Zhongxing Xu [Thu, 11 Dec 2008 09:08:46 +0000 (09:08 +0000)]
Identify AnonPointeeRegion by the symbol that is concretized.

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

15 years agoAnonPointeeRegions are now identified by the MemRegion of the pointer pointing
Zhongxing Xu [Thu, 11 Dec 2008 02:27:34 +0000 (02:27 +0000)]
AnonPointeeRegions are now identified by the MemRegion of the pointer pointing
to them.

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

15 years agoUpdated checker build.
Ted Kremenek [Thu, 11 Dec 2008 00:20:13 +0000 (00:20 +0000)]
Updated checker build.

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

15 years agoAdd another complex promotion test.
Anders Carlsson [Wed, 10 Dec 2008 23:57:51 +0000 (23:57 +0000)]
Add another complex promotion test.

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

15 years agoMake sure to promote expressions of the form (floating point + complex integer) corre...
Anders Carlsson [Wed, 10 Dec 2008 23:30:05 +0000 (23:30 +0000)]
Make sure to promote expressions of the form (floating point + complex integer) correctly, to (complex floating point + complex floating point)

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

15 years agoPreprocessorLexer (and subclasses):
Ted Kremenek [Wed, 10 Dec 2008 23:20:59 +0000 (23:20 +0000)]
PreprocessorLexer (and subclasses):
- Added virtual method 'getSourceLocation()' (no arguments) that gets the location of the next "observable" location (e.g., next character, next token).
PPLexerChange.cpp:
- Implemented FIXME by using PreprocessorLexer::getSourceLocation() to get the location in the file we are returning to after lexing a #included file.  This appears to be slightly faster than having the branch (i.e., 'if(CurLexer)').  It's also not a really hot part of the Preprocessor.

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

15 years agoAdded a warning when referencing an if's condition variable in the
Douglas Gregor [Wed, 10 Dec 2008 23:01:14 +0000 (23:01 +0000)]
Added a warning when referencing an if's condition variable in the
"else" clause, e.g.,

  if (int X = foo()) {
  } else {
    if (X) { // warning: X is always zero in this context
    }
  }

Fixes rdar://6425550 and lets me think about something other than
DeclContext.

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

15 years agoThe "real" fix for <rdar://problem/6424347> clang on xcode: Assertion failed: (0...
Steve Naroff [Wed, 10 Dec 2008 22:14:21 +0000 (22:14 +0000)]
The "real" fix for <rdar://problem/6424347> clang on xcode: Assertion failed: (0 && "unexpected type"), function mergeTypes,

Commit r60845 was premature.

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

15 years agoFix PR clang/3175: CheckAddressOfOperand does not handle references to class vars
Douglas Gregor [Wed, 10 Dec 2008 21:26:49 +0000 (21:26 +0000)]
Fix PR clang/3175: CheckAddressOfOperand does not handle references to class vars

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

15 years agoSome cleanups to the dependent-types commit, as suggested by Sebastian
Douglas Gregor [Wed, 10 Dec 2008 20:57:37 +0000 (20:57 +0000)]
Some cleanups to the dependent-types commit, as suggested by Sebastian

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

15 years agoFix <rdar://problem/6424347> clang on xcode: Assertion failed: (0 && "unexpected...
Steve Naroff [Wed, 10 Dec 2008 20:07:25 +0000 (20:07 +0000)]
Fix <rdar://problem/6424347> clang on xcode: Assertion failed: (0 && "unexpected type"), function mergeTypes,

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

15 years agoDeclare PerIDCache as IdentifierInfo** instead of void*. This is just cleaner. ...
Ted Kremenek [Wed, 10 Dec 2008 19:40:23 +0000 (19:40 +0000)]
Declare PerIDCache as IdentifierInfo** instead of void*.  This is just cleaner.  No performance change.

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

15 years agoFix <rdar://problem/6418623> Bogus block type compatibility warning.
Steve Naroff [Wed, 10 Dec 2008 17:49:55 +0000 (17:49 +0000)]
Fix <rdar://problem/6418623> Bogus block type compatibility warning.

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

15 years agoFix regression caused by fixing <rdar://problem/6429113> clang ObjC rewriter: crash...
Steve Naroff [Wed, 10 Dec 2008 14:53:27 +0000 (14:53 +0000)]
Fix regression caused by fixing <rdar://problem/6429113> clang ObjC rewriter: crash rewriting file with Blocks and properties

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

15 years agoUse a scoped object to manage entry/exit from a parser scope rather than explicitly...
Douglas Gregor [Wed, 10 Dec 2008 06:34:36 +0000 (06:34 +0000)]
Use a scoped object to manage entry/exit from a parser scope rather than explicitly calling EnterScope/ExitScope

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

15 years agoAppend an extra newline to the module inline asm if it's not empty.
Anders Carlsson [Wed, 10 Dec 2008 02:21:04 +0000 (02:21 +0000)]
Append an extra newline to the module inline asm if it's not empty.

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

15 years agoUpdated checker build.
Ted Kremenek [Wed, 10 Dec 2008 00:50:24 +0000 (00:50 +0000)]
Updated checker build.

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

15 years agoPatch to allow a getter call using property dot-syntax notation.
Fariborz Jahanian [Wed, 10 Dec 2008 00:21:50 +0000 (00:21 +0000)]
Patch to allow a getter call using property dot-syntax notation.

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

15 years agoModify the move emulation according to the excellent design of Howard Hinnant. Makes...
Sebastian Redl [Wed, 10 Dec 2008 00:02:53 +0000 (00:02 +0000)]
Modify the move emulation according to the excellent design of Howard Hinnant. Makes for much nicer syntax when smart pointers are used consistently. Also, start converting internal argument passing of Parser to smart pointers.

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

15 years agoFix to BasicStoreManager::getElementLValue: If the base region is a symbol, layer...
Ted Kremenek [Tue, 9 Dec 2008 23:50:57 +0000 (23:50 +0000)]
Fix to BasicStoreManager::getElementLValue: If the base region is a symbol, layer an AnonTypedRegion on top of it.

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

15 years agoPrevent bogus warning on unimplemented setter/getter when user
Fariborz Jahanian [Tue, 9 Dec 2008 22:43:22 +0000 (22:43 +0000)]
Prevent bogus warning on unimplemented setter/getter when user
has added declaration of these methods in its @interface.

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

15 years agoHave BasicStoreManager::getLValueElement() have logic similar to BasicStoreManager...
Ted Kremenek [Tue, 9 Dec 2008 21:20:27 +0000 (21:20 +0000)]
Have BasicStoreManager::getLValueElement() have logic similar to BasicStoreManager::getLValueField() (i.e., don't just return the 'base' as the SVal)

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

15 years agoAdd testcase for commit r60781.
Steve Naroff [Tue, 9 Dec 2008 20:59:16 +0000 (20:59 +0000)]
Add testcase for commit r60781.

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

15 years agoSupport for implementation of property in the case where
Fariborz Jahanian [Tue, 9 Dec 2008 20:23:04 +0000 (20:23 +0000)]
Support for implementation of property in the case where
the synthesis is in an implementation of s subclass of
a super class where the property has been declared.

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

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