]> granicus.if.org Git - clang/log
clang
16 years agosome minor cleanups to ParseObjCTypeName:
Chris Lattner [Wed, 22 Oct 2008 03:52:06 +0000 (03:52 +0000)]
some minor cleanups to ParseObjCTypeName:

1. Remove a bogus assertion, clients other than sema can return a
   null pointer from actions that result in ParseTypeName returning null.
2. Remove dead RParenLoc variable.
3. Simplify control flow handling error conditions.
4. On a major failure, we should skip until ')' not until '}'.

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

16 years agoUpdate to use raw_ostream for PrintModulePass.
Daniel Dunbar [Wed, 22 Oct 2008 03:28:13 +0000 (03:28 +0000)]
Update to use raw_ostream for PrintModulePass.
 - Stop playing fast and loose with the std stream.

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

16 years agoFix a thinko in the qualification-conversion check when the qualificaitons are disjoi...
Douglas Gregor [Wed, 22 Oct 2008 00:38:21 +0000 (00:38 +0000)]
Fix a thinko in the qualification-conversion check when the qualificaitons are disjoint, and add some overloading-based tests of qualification conversions

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

16 years agoFunctions can be lvalues in C++, but not modifiable lvalues
Douglas Gregor [Wed, 22 Oct 2008 00:03:08 +0000 (00:03 +0000)]
Functions can be lvalues in C++, but not modifiable lvalues

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

16 years agoCommito, didn't mean to remove this header.
Daniel Dunbar [Tue, 21 Oct 2008 23:54:00 +0000 (23:54 +0000)]
Commito, didn't mean to remove this header.

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

16 years ago[LLVM up] Add basic -S option to clang.
Daniel Dunbar [Tue, 21 Oct 2008 23:49:24 +0000 (23:49 +0000)]
[LLVM up] Add basic -S option to clang.
 - Split backend related consumer out into Backend.cpp, replaces
   LLVMCodeGenWriter.
 - Structure follows llvm-gcc to some extent.
 - Still need to implement all the options which impact code
   generation and the optimization passes which llvm-gcc uses at
   various levels.

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

16 years agoInitial step toward supporting qualification conversions (C++ 4.4).
Douglas Gregor [Tue, 21 Oct 2008 23:43:52 +0000 (23:43 +0000)]
Initial step toward supporting qualification conversions (C++ 4.4).

Changes:
  - Sema::IsQualificationConversion determines whether we have a qualification
    conversion.
  - Sema::CheckSingleAssignment constraints now follows the C++ rules in C++,
    performing an implicit conversion from the right-hand side to the type of
    the left-hand side rather than checking based on the C notion of
    "compatibility". We now rely on the implicit-conversion code to
    determine whether the conversion can happen or
    not. Sema::TryCopyInitialization has an ugly reference-related
    hack to cope with the initialization of references, for now.
  - When building DeclRefExprs, strip away the reference type, since
    there are no expressions whose type is a reference. We'll need to
    do this throughout Sema.
  - Expr::isLvalue now permits functions to be lvalues in C++ (but not
  in C).

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

16 years agoUpdated checker build.
Ted Kremenek [Tue, 21 Oct 2008 21:56:56 +0000 (21:56 +0000)]
Updated checker build.

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

16 years agoAdd coverage of part of getPrimaryDecl that was failing prior to
Daniel Dunbar [Tue, 21 Oct 2008 21:32:38 +0000 (21:32 +0000)]
Add coverage of part of getPrimaryDecl that was failing prior to
previous commit.

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

16 years agoFix use of dyn_cast.
Daniel Dunbar [Tue, 21 Oct 2008 21:22:32 +0000 (21:22 +0000)]
Fix use of dyn_cast.

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

16 years agoAdd GetModule accessor to ModuleBuilder
Daniel Dunbar [Tue, 21 Oct 2008 19:55:09 +0000 (19:55 +0000)]
Add GetModule accessor to ModuleBuilder

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

16 years agoWhen conjuring symbols for compound assignments, use the promoted type to determine...
Ted Kremenek [Tue, 21 Oct 2008 19:49:01 +0000 (19:49 +0000)]
When conjuring symbols for compound assignments, use the promoted type to determine if the symbolic value as a "loc::" or "nonloc::" value.

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

16 years agoFix <rdar://problem/6257645> clang static analyzer crashes when encountering blocks...
Steve Naroff [Tue, 21 Oct 2008 18:24:04 +0000 (18:24 +0000)]
Fix <rdar://problem/6257645> clang static analyzer crashes when encountering blocks as objects

ASTContext::isObjCObjectPointerType() needs to consider blocks as objects.

Note: My previous commit was done in the test directory...as a result, this commit was necessary.

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

16 years agoFix <rdar://problem/6257645> clang static analyzer crashes when encountering blocks...
Steve Naroff [Tue, 21 Oct 2008 18:21:45 +0000 (18:21 +0000)]
Fix <rdar://problem/6257645> clang static analyzer crashes when encountering blocks as objects

ASTContext::isObjCObjectPointerType() needs to consider blocks as objects.

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

16 years agoCosmetic patch from João Paulo Rechi Vita
Douglas Gregor [Tue, 21 Oct 2008 16:14:35 +0000 (16:14 +0000)]
Cosmetic patch from João Paulo Rechi Vita

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

16 years agoPreliminary support for function overloading
Douglas Gregor [Tue, 21 Oct 2008 16:13:35 +0000 (16:13 +0000)]
Preliminary support for function overloading

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

16 years agoHandle [NSAutoreleasePool addObject:] (an alternative way to add objects to the curre...
Ted Kremenek [Tue, 21 Oct 2008 15:53:15 +0000 (15:53 +0000)]
Handle [NSAutoreleasePool addObject:] (an alternative way to add objects to the current autorelease pool).

Added initial code for tracking stack of autorelease pools.

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

16 years agoUpdate Xcode project.
Ted Kremenek [Tue, 21 Oct 2008 15:34:53 +0000 (15:34 +0000)]
Update Xcode project.

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

16 years agoFix a crasher during error recovery in Parser::ParseObjCTypeName().
Steve Naroff [Tue, 21 Oct 2008 14:15:04 +0000 (14:15 +0000)]
Fix a crasher during error recovery in Parser::ParseObjCTypeName().
Found this while fixing another unrelated radar.

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

16 years agoFix <rdar://problem/6297052> confused in some way by embedded /* */ comments.
Steve Naroff [Tue, 21 Oct 2008 13:37:27 +0000 (13:37 +0000)]
Fix <rdar://problem/6297052> confused in some way by embedded /* */ comments.

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

16 years agoUpdate VC++ project files.
Steve Naroff [Tue, 21 Oct 2008 13:04:43 +0000 (13:04 +0000)]
Update VC++ project files.

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

16 years agoTweak an expected-error to match the output. IMHO it is better to diagnose 'int ...
Gabor Greif [Tue, 21 Oct 2008 11:46:36 +0000 (11:46 +0000)]
Tweak an expected-error to match the output. IMHO it is better to diagnose 'int (void)' because it has the same meaning in C and C++.

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

16 years agoFix typo.
Steve Naroff [Tue, 21 Oct 2008 10:50:19 +0000 (10:50 +0000)]
Fix typo.

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

16 years agoFix <rdar://problem/6261178> clang-on-xcode: [sema] multiple method warning is over...
Steve Naroff [Tue, 21 Oct 2008 10:37:50 +0000 (10:37 +0000)]
Fix <rdar://problem/6261178> clang-on-xcode: [sema] multiple method warning is over enthusiastic.
Fix <rdar://problem/6265257> warnings for ambiguous message send swamp other warnings.

Reworked Sema::MatchTwoMethodDeclarations() to optionally match based on method size and alignment (the default in GCC). Changed Sema::LookupInstanceMethodInGlobalPool() to use this feature.

Added -Wno-struct-selector-match to driver, however didn't hook it up yet. Added a FIXME that says this.

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

16 years agoLocalize the special processing of array variable inside
Zhongxing Xu [Tue, 21 Oct 2008 06:54:23 +0000 (06:54 +0000)]
Localize the special processing of array variable inside
GRExprEngine::VisitCast() so that other parts of the analyzer can be ignorant.
When we cast "array of type T" to "pointer to T", we get the loc::MemRegionVal
corresponding to the array variable. This is sufficient for BasicStore, but not
for RegionStore. RegionStore should get the element region for the first array
element in the cast. So next comes to the revamping of transfer functions for
different store model.

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

16 years agoModify Store interface: GetSVal/SetSVal => Retrieve/Bind.
Zhongxing Xu [Tue, 21 Oct 2008 06:27:32 +0000 (06:27 +0000)]
Modify Store interface: GetSVal/SetSVal => Retrieve/Bind.

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

16 years agoAdd partial specialization of ImmutableList for GRStatePartialTrait.
Ted Kremenek [Tue, 21 Oct 2008 06:00:04 +0000 (06:00 +0000)]
Add partial specialization of ImmutableList for GRStatePartialTrait.

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

16 years agoRename:
Zhongxing Xu [Tue, 21 Oct 2008 05:41:03 +0000 (05:41 +0000)]
Rename:
  RValues.h/cpp => SVals.h/cpp

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

16 years agoProcess decls in RegionStore. Individual elements of fixed size arrays are
Zhongxing Xu [Tue, 21 Oct 2008 05:29:26 +0000 (05:29 +0000)]
Process decls in RegionStore. Individual elements of fixed size arrays are
initialized to UndefinedVal.

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

16 years agoAdd ElementRegion to represent memory chunks for array elements.
Zhongxing Xu [Tue, 21 Oct 2008 05:27:10 +0000 (05:27 +0000)]
Add ElementRegion to represent memory chunks for array elements.

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

16 years agoUpdated checker build
Ted Kremenek [Tue, 21 Oct 2008 04:32:44 +0000 (04:32 +0000)]
Updated checker build

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

16 years agoAdd fileid_iterator to SourceManager.
Ted Kremenek [Tue, 21 Oct 2008 03:32:32 +0000 (03:32 +0000)]
Add fileid_iterator to SourceManager.

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

16 years agoAdded method to access the raw flags of Token.
Ted Kremenek [Tue, 21 Oct 2008 03:32:15 +0000 (03:32 +0000)]
Added method to access the raw flags of Token.

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

16 years agoChange signature for CheckDivideZero.
Ted Kremenek [Tue, 21 Oct 2008 03:31:53 +0000 (03:31 +0000)]
Change signature for CheckDivideZero.

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

16 years agoAdded the start of a prototype implementation of PCH based on token caching.
Ted Kremenek [Tue, 21 Oct 2008 00:54:44 +0000 (00:54 +0000)]
Added the start of a prototype implementation of PCH based on token caching.

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

16 years agoFurther improve path-sensitivity with divide-by-zero checking by assuming that a...
Ted Kremenek [Mon, 20 Oct 2008 23:40:25 +0000 (23:40 +0000)]
Further improve path-sensitivity with divide-by-zero checking by assuming that a denominator cannot be zero even when the result of an '/' or '%' expression is unknown.

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

16 years agoAdded test case inspired by <rdar://6268365>: recover path-sensitivity after compound...
Ted Kremenek [Mon, 20 Oct 2008 23:14:31 +0000 (23:14 +0000)]
Added test case inspired by <rdar://6268365>: recover path-sensitivity after compound assignment when the result of the assignment is not known.

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

16 years agoUsed conjured symbols to recover path-sensitivity when the result of a compound assig...
Ted Kremenek [Mon, 20 Oct 2008 23:13:25 +0000 (23:13 +0000)]
Used conjured symbols to recover path-sensitivity when the result of a compound assignment is UnknownVal().

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

16 years agoFix <rdar://problem/6268365> Parser rejects property (dot notation) access on id...
Steve Naroff [Mon, 20 Oct 2008 22:53:06 +0000 (22:53 +0000)]
Fix <rdar://problem/6268365> Parser rejects property (dot notation) access on id<protocol>.

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

16 years agoSema::CheckCompareOperands() and ASTContext::mergeTypes(): Change handling of ObjC...
Steve Naroff [Mon, 20 Oct 2008 18:19:10 +0000 (18:19 +0000)]
Sema::CheckCompareOperands() and ASTContext::mergeTypes(): Change handling of ObjC qualified id types to be consistent with gcc. This changes a handful of test case errors into warnings (diff will tell you which cases have changed).

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

16 years agoAdd newline at the end of file, to silence compiler warning.
Matthijs Kooijman [Mon, 20 Oct 2008 08:12:48 +0000 (08:12 +0000)]
Add newline at the end of file, to silence compiler warning.

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

16 years agoeliminate ObjCPropertyAttrs an corresponding enums, just use
Chris Lattner [Mon, 20 Oct 2008 07:43:01 +0000 (07:43 +0000)]
eliminate ObjCPropertyAttrs an corresponding enums, just use
strcmp when needed.

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

16 years agorearrange some code.
Chris Lattner [Mon, 20 Oct 2008 07:39:53 +0000 (07:39 +0000)]
rearrange some code.

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

16 years agomore simplifications to error recovery in ParseObjCPropertyAttribute
Chris Lattner [Mon, 20 Oct 2008 07:37:22 +0000 (07:37 +0000)]
more simplifications to error recovery in ParseObjCPropertyAttribute

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

16 years agoremove extraneous braces
Chris Lattner [Mon, 20 Oct 2008 07:36:58 +0000 (07:36 +0000)]
remove extraneous braces

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

16 years agomove some code around to make it fall through more, no functionality change.
Chris Lattner [Mon, 20 Oct 2008 07:24:39 +0000 (07:24 +0000)]
move some code around to make it fall through more, no functionality change.

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

16 years agoreject properties completely in objc1 instead of emitting
Chris Lattner [Mon, 20 Oct 2008 07:22:18 +0000 (07:22 +0000)]
reject properties completely in objc1 instead of emitting
weird errors about property attributes being unknown.

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

16 years agoMore property attribute recovery improvements. Instead of this:
Chris Lattner [Mon, 20 Oct 2008 07:15:22 +0000 (07:15 +0000)]
More property attribute recovery improvements.  Instead of this:

crash.m:8:12: error: type name requires a specifier or qualifier
@property (readonlyx, getter=isAwesome) int _awesome;
           ^
crash.m:8:29: error: expected ';' at end of declaration list
@property (readonlyx, getter=isAwesome) int _awesome;
                            ^
crash.m:8:39: error: expected identifier or '('
@property (readonlyx, getter=isAwesome) int _awesome;
                                      ^

we now get:

crash.m:8:12: error: unknown property attribute 'readonlyx'
@property (readonlyx, getter=isAwesome) int _awesome;
           ^

Also, we can eliminate isObjCPropertyAttribute now.

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

16 years agoadd testcase for the recovery improvements in my last patch.
Chris Lattner [Mon, 20 Oct 2008 07:03:51 +0000 (07:03 +0000)]
add testcase for the recovery improvements in my last patch.

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

16 years agosignificantly simplify and clean up error recovery in
Chris Lattner [Mon, 20 Oct 2008 07:00:43 +0000 (07:00 +0000)]
significantly simplify and clean up error recovery in
ParseObjCPropertyAttribute.  Before, on this code (where
a comma was forgotten):

@property (readonly getter=isAwesome) int _awesome;

we emitted:

crash.m:9:11: error: expected ')'
@property (readonly getter=isAwesome) int _awesome;
          ^
crash.m:9:37: error: type name requires a specifier or qualifier
@property (readonly getter=isAwesome) int _awesome;
                                    ^
crash.m:9:37: error: expected identifier or '('
crash.m:9:37: error: expected ';' at end of declaration list
crash.m:9:1: error: @property requires fields to be named
@property (readonly getter=isAwesome) int _awesome;
^

now we emit:

crash.m:9:21: error: expected ')'
@property (readonly getter=isAwesome) int _awesome;
                    ^
crash.m:9:11: error: to match this '('
@property (readonly getter=isAwesome) int _awesome;
          ^

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

16 years agoUpdated checker build
Ted Kremenek [Mon, 20 Oct 2008 06:58:23 +0000 (06:58 +0000)]
Updated checker build

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

16 years agosimplify some other code for __extension__ processing.
Chris Lattner [Mon, 20 Oct 2008 06:51:33 +0000 (06:51 +0000)]
simplify some other code for __extension__ processing.

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

16 years agoimplement a couple fixme's by implementing __extension__ properly.
Chris Lattner [Mon, 20 Oct 2008 06:45:43 +0000 (06:45 +0000)]
implement a couple fixme's by implementing __extension__ properly.

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

16 years agofix a crash on unnamed properties like:
Chris Lattner [Mon, 20 Oct 2008 06:33:53 +0000 (06:33 +0000)]
fix a crash on unnamed properties like:
@property (readonly) int : 4;

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

16 years agosimplify some code by using ExpectAndConsume. When an error
Chris Lattner [Mon, 20 Oct 2008 06:15:13 +0000 (06:15 +0000)]
simplify some code by using ExpectAndConsume.  When an error
occurs, skip to an @ or ; instead of to a } or ;.  Properties
don't necessarily live in {}'s.

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

16 years agorefactor a bunch of code:
Chris Lattner [Mon, 20 Oct 2008 06:10:06 +0000 (06:10 +0000)]
refactor a bunch of code:
Check for @end in ParseObjCInterfaceDeclList instead of in each caller
Handle @required and @optional with the same code

Add some fixmes about some apparently objc2 code that is being accepted
in objc1.

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

16 years agofix some minor error recovery bugs in ParseObjCInterfaceDeclList
Chris Lattner [Mon, 20 Oct 2008 05:57:40 +0000 (05:57 +0000)]
fix some minor error recovery bugs in ParseObjCInterfaceDeclList
where it would reject @required in non-protocols, but then go
ahead and tag methods with required anyway.  Instead, if we see
this in something other than a protocol, just ignore the request.

Also, improve error recovery a bit when we see something bogus
inside an interface.

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

16 years agorestructure the body of the ParseObjCInterfaceDeclList loop
Chris Lattner [Mon, 20 Oct 2008 05:46:22 +0000 (05:46 +0000)]
restructure the body of the ParseObjCInterfaceDeclList loop
to make it easier to understand.  No functionality change.

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

16 years agoFix rdar://6257721 by tightening up the block "snapshot" check, and
Chris Lattner [Mon, 20 Oct 2008 05:16:36 +0000 (05:16 +0000)]
Fix rdar://6257721 by tightening up the block "snapshot" check, and
move it to its own predicate to make it more clear.

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

16 years agoSupport attributes in *yet another* place. Is there any place you
Chris Lattner [Mon, 20 Oct 2008 04:57:38 +0000 (04:57 +0000)]
Support attributes in *yet another* place.  Is there any place you
can't stick an attributes?

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

16 years agoFix a parser bug where we let attributes interfere with our disambiguation
Chris Lattner [Mon, 20 Oct 2008 02:05:46 +0000 (02:05 +0000)]
Fix a parser bug where we let attributes interfere with our disambiguation
of whether a '(' was a grouping paren or the start of a function declarator.
This is PR2796.

Now we eat the attribute before deciding whether the paren is grouping or
not, then apply it to the resultant decl or to the first argument as needed.

One somewhat surprising aspect of this is that attributes interact with
implicit int in cases like this:

void a(x, y) // k&r style function
void b(__attribute__(()) x, y); // function with two implicit int arguments
void c(x, __attribute__(()) y); // error, can't have attr in identifier list.

Fun stuff.

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

16 years agofix indentation
Chris Lattner [Mon, 20 Oct 2008 02:01:50 +0000 (02:01 +0000)]
fix indentation

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

16 years agofix indentation
Chris Lattner [Mon, 20 Oct 2008 02:01:34 +0000 (02:01 +0000)]
fix indentation

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

16 years agoRemove an implemented fixme, only treat < as a type specifier
Chris Lattner [Mon, 20 Oct 2008 00:25:30 +0000 (00:25 +0000)]
Remove an implemented fixme, only treat < as a type specifier
when ObjC is turned on.

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

16 years agoChange a couple of cast<> to reinterpret_cast<>.
Argyrios Kyrtzidis [Sun, 19 Oct 2008 12:05:48 +0000 (12:05 +0000)]
Change a couple of cast<> to reinterpret_cast<>.
The casts<> require that "Decl.h" is included before "Type.h", use reinterpret_cast<> to remove that kind of dependency.

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

16 years agoAdd "argument key" processing similar to ccc.
Ted Kremenek [Sun, 19 Oct 2008 06:42:38 +0000 (06:42 +0000)]
Add "argument key" processing similar to ccc.

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

16 years agoccc: Pass '-g' through to clang. Handle -weak_framework.
Daniel Dunbar [Sun, 19 Oct 2008 02:41:16 +0000 (02:41 +0000)]
ccc: Pass '-g' through to clang. Handle -weak_framework.

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

16 years agoImprove attribute parsing & tests.
Daniel Dunbar [Sun, 19 Oct 2008 02:04:16 +0000 (02:04 +0000)]
Improve attribute parsing & tests.
 - Support noreturn on function-typed variables.

 - Extend isFunctionOrMethod to return true for K&R functions and
   provide hasFunctionProto to check if a decl has information about
   its arguments. This code needs some serious cleaning, but works.

 - Add/improve test cases for noreturn and unused.

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

16 years agoAdd support in GRExprEngine for UnaryOperator::AlignOf. This fixes one crash report...
Ted Kremenek [Sat, 18 Oct 2008 22:20:20 +0000 (22:20 +0000)]
Add support in GRExprEngine for UnaryOperator::AlignOf.  This fixes one crash report in PR 2796.

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

16 years agoUpdated checker build
Ted Kremenek [Sat, 18 Oct 2008 21:03:40 +0000 (21:03 +0000)]
Updated checker build

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

16 years agoFix incorrect release of Decl* array referenced by DeclGroup.
Ted Kremenek [Sat, 18 Oct 2008 19:20:54 +0000 (19:20 +0000)]
Fix incorrect release of Decl* array referenced by DeclGroup.

Patch by Timo Sirainen!

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

16 years agoDebug info bug fix, function start wasn't getting generated correctly
Daniel Dunbar [Sat, 18 Oct 2008 18:22:23 +0000 (18:22 +0000)]
Debug info bug fix, function start wasn't getting generated correctly
for Obj-C methods.

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

16 years agoUpdated checker build.
Ted Kremenek [Sat, 18 Oct 2008 05:12:17 +0000 (05:12 +0000)]
Updated checker build.

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

16 years agoGeneralize VisitLValue: not only can CallExprs and ObjCMessageExprs return aggregate...
Ted Kremenek [Sat, 18 Oct 2008 04:15:35 +0000 (04:15 +0000)]
Generalize VisitLValue: not only can CallExprs and ObjCMessageExprs return aggregate temporaries, so can many other expressions.

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

16 years agoFunction calls and ObjC message expressions can be used in a lvalue context if they...
Ted Kremenek [Sat, 18 Oct 2008 04:08:49 +0000 (04:08 +0000)]
Function calls and ObjC message expressions can be used in a lvalue context if they return a structure.  E.g  foo().x == 1.  We don't really support, however, such temporaries yet in the environment or the store.

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

16 years agoretain/release checker: Check if a tracked value escapes if we also try binding it...
Ted Kremenek [Sat, 18 Oct 2008 03:49:51 +0000 (03:49 +0000)]
retain/release checker: Check if a tracked value escapes if we also try binding it to the store and the store doesn't support that binding (i.e., it cannot track it).  This has the nice feature that the checker will automatically get more powerful if we use a more powerful store model.

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

16 years agoUse "VisitLValue" when processing the base for "x.f" field accesses, and "Visit"...
Ted Kremenek [Sat, 18 Oct 2008 03:28:48 +0000 (03:28 +0000)]
Use "VisitLValue" when processing the base for "x.f" field accesses, and "Visit" when processing the base for "x->f" field accesses.

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

16 years agoMake llvm memory barrier available as an intrinsic
Mon P Wang [Sat, 18 Oct 2008 02:49:28 +0000 (02:49 +0000)]
Make llvm memory barrier available as an intrinsic

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

16 years agoAdded vec_set intrinsics
Mon P Wang [Sat, 18 Oct 2008 02:43:25 +0000 (02:43 +0000)]
Added vec_set intrinsics

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

16 years agoJust do a diagIfAmbiguous -> warnIfAmbiguous rename.
Argyrios Kyrtzidis [Fri, 17 Oct 2008 23:23:35 +0000 (23:23 +0000)]
Just do a diagIfAmbiguous -> warnIfAmbiguous rename.
No functionality change.

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

16 years agoEmit more descriptive unsupported error message on dot-syntax use of super.
Daniel Dunbar [Fri, 17 Oct 2008 23:05:02 +0000 (23:05 +0000)]
Emit more descriptive unsupported error message on dot-syntax use of super.

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

16 years agoAdd some uses of PredefinedExpr to language coverage includes.
Daniel Dunbar [Fri, 17 Oct 2008 23:04:32 +0000 (23:04 +0000)]
Add some uses of PredefinedExpr to language coverage includes.

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

16 years agoAdd FIXME about potential problem in how property ref lvalues are handled.
Daniel Dunbar [Fri, 17 Oct 2008 23:02:24 +0000 (23:02 +0000)]
Add FIXME about potential problem in how property ref lvalues are handled.

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

16 years agoThis test now passes again.
Ted Kremenek [Fri, 17 Oct 2008 22:53:09 +0000 (22:53 +0000)]
This test now passes again.

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

16 years agoHack: have BasicStore::getLValueElement return the "Base" lvalue. This restores...
Ted Kremenek [Fri, 17 Oct 2008 22:52:40 +0000 (22:52 +0000)]
Hack: have BasicStore::getLValueElement return the "Base" lvalue.  This restores null dereference checking with array accesses.

BasicStore::RemoveDeadBindings: handle regions besides VarRegions (we now have FieldRegions).

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

16 years agoWhen conjuring symbols to recover path-sensitivity, don't conjure symbols that repres...
Ted Kremenek [Fri, 17 Oct 2008 22:23:12 +0000 (22:23 +0000)]
When conjuring symbols to recover path-sensitivity, don't conjure symbols that represent an entire struct.  We need to implement struct temporaries as an actual "region", and then bind symbols to the FieldRegion of those temporaries.

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

16 years agoLift CodeGenFunction::EmitPredefinedFunctioName out of EmitPredefinedLValue.
Daniel Dunbar [Fri, 17 Oct 2008 21:58:32 +0000 (21:58 +0000)]
Lift CodeGenFunction::EmitPredefinedFunctioName out of EmitPredefinedLValue.
 - Shouldn't assume predefined expr is a function printing one.
 - Uses CGM functionality to cache function names per module.

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

16 years agoAdd option argument to GetAddrOfConstantString to use for name of
Daniel Dunbar [Fri, 17 Oct 2008 21:56:50 +0000 (21:56 +0000)]
Add option argument to GetAddrOfConstantString to use for name of
(first) global holding the string.
 - No functionality change.

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

16 years agofix rdar://6288301: custom warnings don't respect -Werror.
Chris Lattner [Fri, 17 Oct 2008 21:24:47 +0000 (21:24 +0000)]
fix rdar://6288301: custom warnings don't respect -Werror.

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

16 years agoEnhance "Assumption" logic in BasicConstraintManager when reasoning about regions...
Ted Kremenek [Fri, 17 Oct 2008 21:22:20 +0000 (21:22 +0000)]
Enhance "Assumption" logic in BasicConstraintManager when reasoning about regions and symbolic regions.  When assuming whether or not a location is non-null, walk up the region hierarchy until we hit a symbolic region (and test it for null).  This may not be the end all solution, as the notion of what a "symbolic region" is really belongs in the specific subclass of StoreManager.

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

16 years agoAdd pretty-printing support for FieldRegions.
Ted Kremenek [Fri, 17 Oct 2008 21:05:44 +0000 (21:05 +0000)]
Add pretty-printing support for FieldRegions.

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

16 years agoEmit error unsupported when asm string conversion fails instead of
Daniel Dunbar [Fri, 17 Oct 2008 20:58:01 +0000 (20:58 +0000)]
Emit error unsupported when asm string conversion fails instead of
assert.

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

16 years agoFixed an elusive caching bug in ExplodedGraph construction when a PostStmtKind was...
Ted Kremenek [Fri, 17 Oct 2008 20:49:23 +0000 (20:49 +0000)]
Fixed an elusive caching bug in ExplodedGraph construction when a PostStmtKind was used instead of a PostStoreKind.

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

16 years agoTest now passes.
Ted Kremenek [Fri, 17 Oct 2008 20:29:05 +0000 (20:29 +0000)]
Test now passes.

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

16 years ago- constify some uses of MemRegion* (MemRegion should be immutable).
Ted Kremenek [Fri, 17 Oct 2008 20:28:54 +0000 (20:28 +0000)]
- constify some uses of MemRegion* (MemRegion should be immutable).
- Added new region "SymbolicRegion", which maps symbol values to the region domain.
- Enhanced BasicStore::getFieldLValue() to return a FieldRegion (using SymbolicRegion)
- Added some utility methods to GRState for fetch svals from the store.
- Fixed regression in CheckNSError (we weren't getting the value bound to the parameter)

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

16 years agoRemove unneeded EncodingRecordTypes argument to getObjCEncodingForType.
Daniel Dunbar [Fri, 17 Oct 2008 20:21:44 +0000 (20:21 +0000)]
Remove unneeded EncodingRecordTypes argument to getObjCEncodingForType.

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

16 years agoFixed vec_set_v2di signature
Mon P Wang [Fri, 17 Oct 2008 17:39:34 +0000 (17:39 +0000)]
Fixed vec_set_v2di signature

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

16 years ago"Implement" GRExprEngine::VisitLValue for ObjCPropertyRefExpr. This is only a bandid...
Ted Kremenek [Fri, 17 Oct 2008 17:24:14 +0000 (17:24 +0000)]
"Implement" GRExprEngine::VisitLValue for ObjCPropertyRefExpr.  This is only a bandid; we need to properly handle properties by using locv/nonloc objects and specially handling property assignments in the transfer function for BinaryOperator.

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

16 years agoMore Obj-C type encoding improvements.
Daniel Dunbar [Fri, 17 Oct 2008 16:17:37 +0000 (16:17 +0000)]
More Obj-C type encoding improvements.
 - Encode unions and bit-fields correctly.
 - Accept option to name record fields (used for NeXT runtime).

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

16 years agoChange CGDebugInfo::setLocation to just ignore invalid locations. This
Daniel Dunbar [Fri, 17 Oct 2008 16:15:48 +0000 (16:15 +0000)]
Change CGDebugInfo::setLocation to just ignore invalid locations. This
simplifies clients.

Also, add assert that RegionStack is empty when the CGDebugInfo is
destroyed.

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