]> granicus.if.org Git - clang/log
clang
16 years agoTighten up address-of checking, implementing test/Sema/expr-address-of.c.
Chris Lattner [Fri, 16 Nov 2007 17:46:48 +0000 (17:46 +0000)]
Tighten up address-of checking, implementing test/Sema/expr-address-of.c.
This fixes a bug reported by Seo Sanghyeon.

This was meant to be committed yesterday, but the commit failed.  doh.

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

16 years agoFix transient failure on Lex/c90.c due to an uninit variable.
Chris Lattner [Thu, 15 Nov 2007 19:22:40 +0000 (19:22 +0000)]
Fix transient failure on Lex/c90.c due to an uninit variable.

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

16 years agoadd header file I forgot to check in
Chris Lattner [Thu, 15 Nov 2007 19:22:18 +0000 (19:22 +0000)]
add header file I forgot to check in

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

16 years agofix a bug Steve noticed, where a #import of the main file itself would fail.
Chris Lattner [Thu, 15 Nov 2007 19:07:47 +0000 (19:07 +0000)]
fix a bug Steve noticed, where a #import of the main file itself would fail.

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

16 years agoAdded hack when serializing DeclRefExprs. This should probably be fixed.
Ted Kremenek [Thu, 15 Nov 2007 18:26:39 +0000 (18:26 +0000)]
Added hack when serializing DeclRefExprs.  This should probably be fixed.

Some FunctionDecls do not appear at the top-level or are owned by a DeclStmt.
In calls to implicitly defined functions, a FunctionDecl is created, but only
the DeclRefExprs reference them. Since an implicitly defined function may be
called multiple times, there is no clear ownership model for such objects.

Temporary solution: when serializing out DeclRefExprs, emit an ownership bit
for the Decl. This bit is determined by querying the serializer to see if the
Decl has already been serialized. If it hasn't, emit the Decl as an owned
pointer.

I repeat: this is a hack.  This should be fixed.

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

16 years agoStarted separate section for method definitions for ObjC serialization.
Ted Kremenek [Thu, 15 Nov 2007 18:10:29 +0000 (18:10 +0000)]
Started separate section for method definitions for ObjC serialization.
Added missing deserialization case in Stmt::Create() switch statement.

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

16 years agoNo need to forward declare definition of objc_super...
Steve Naroff [Thu, 15 Nov 2007 17:06:21 +0000 (17:06 +0000)]
No need to forward declare definition of objc_super...

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

16 years agoFinish up variadic methods/messages.
Steve Naroff [Thu, 15 Nov 2007 13:05:42 +0000 (13:05 +0000)]
Finish up variadic methods/messages.

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

16 years agoImplement support for variadic methods (work in progress).
Steve Naroff [Thu, 15 Nov 2007 12:35:21 +0000 (12:35 +0000)]
Implement support for variadic methods (work in progress).

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

16 years agoExtend RewriteTest::RewriteObjCIvarRefExpr() to cope with static typing (when using...
Steve Naroff [Thu, 15 Nov 2007 11:33:00 +0000 (11:33 +0000)]
Extend RewriteTest::RewriteObjCIvarRefExpr() to cope with static typing (when using -> on a type which corresponds to the implementation type).

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

16 years agoTweak funky cast to accommodate messaging 'super'. This removes any spurious warnings.
Steve Naroff [Thu, 15 Nov 2007 10:43:57 +0000 (10:43 +0000)]
Tweak funky cast to accommodate messaging 'super'. This removes any spurious warnings.

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

16 years agoRewrite for messaging 'super'.
Steve Naroff [Thu, 15 Nov 2007 10:28:18 +0000 (10:28 +0000)]
Rewrite for messaging 'super'.

The code gen. results in some spurious warnings...a cast is forthcoming.

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

16 years agoBreak out bool/true/false support into a LangOption
Nate Begeman [Thu, 15 Nov 2007 07:30:50 +0000 (07:30 +0000)]
Break out bool/true/false support into a LangOption

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

16 years agoImplement codegen of CXX Bool
Nate Begeman [Thu, 15 Nov 2007 05:40:03 +0000 (05:40 +0000)]
Implement codegen of CXX Bool

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

16 years agoHandle "bool" in all places that touch _Bool.
Chris Lattner [Thu, 15 Nov 2007 05:25:19 +0000 (05:25 +0000)]
Handle "bool" in all places that touch _Bool.
This fixes code like "if((bool)x) {}" for example.

Patch by Nate Begeman.

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

16 years ago- Implement ivar rewrite (patch by Fariborz).
Steve Naroff [Thu, 15 Nov 2007 02:58:25 +0000 (02:58 +0000)]
- Implement ivar rewrite (patch by Fariborz).
- RewriteMessageExpr()...make implicit casts explicit with synthesizing call (removing warnings when calling objc_msgSend()).

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

16 years agoRefinement to previous commit. Always cast the first argument to "id"...no need to...
Steve Naroff [Thu, 15 Nov 2007 00:00:21 +0000 (00:00 +0000)]
Refinement to previous commit. Always cast the first argument to "id"...no need to special case self.

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

16 years agoCast implicit "self" argument to "id". This removes all warnings associated with...
Steve Naroff [Wed, 14 Nov 2007 23:54:14 +0000 (23:54 +0000)]
Cast implicit "self" argument to "id". This removes all warnings associated with implicit references to self. It doesn't yet deal withexplicit references to self...

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

16 years agoFixed bug in serialization of EnumConstantDecl where we improperly
Ted Kremenek [Wed, 14 Nov 2007 23:38:09 +0000 (23:38 +0000)]
Fixed bug in serialization of EnumConstantDecl where we improperly
"default constructed" an APSInt.  Fixed another bug in the same method
where we did not allow the NextDeclarator to be NULL.

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

16 years agoFixed bug when serializing QualTypes where we were serializing in the
Ted Kremenek [Wed, 14 Nov 2007 23:35:01 +0000 (23:35 +0000)]
Fixed bug when serializing QualTypes where we were serializing in the
qualifiers as part of the pointer address.

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

16 years agoAlways generate a typedef for @class. The typedef removal logic that I'm removing...
Steve Naroff [Wed, 14 Nov 2007 23:02:56 +0000 (23:02 +0000)]
Always generate a typedef for @class. The typedef removal logic that I'm removing only made sense when we were operating on preprocess files without typedef guards. Now that we have guards, it is incorrect to ever remove one (since it may increase the likelihood that the rewritten header can't be included stand alone).

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

16 years agoFix a rewriter bug that steve noticed. Don't skip arbitrary things
Chris Lattner [Wed, 14 Nov 2007 22:57:51 +0000 (22:57 +0000)]
Fix a rewriter bug that steve noticed.   Don't skip arbitrary things
between an @ and a p, just skip whitespace.

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

16 years agoAdded QualType::ReadBackpatch to allow QualType initialization with
Ted Kremenek [Wed, 14 Nov 2007 22:51:02 +0000 (22:51 +0000)]
Added QualType::ReadBackpatch to allow QualType initialization with
backpatching. This original was available, but then we removed it. It is back
again to help with deserialization of FieldDecls. Because FieldDecls are
currently owned by RecordDecls, which are owned by a TagType, the type of the
FieldDecl may not be deserialized prior to deserializing the FieldDecl. Thus
backpatching solves the problem of constructing a FieldDecl that references a
type that has not yet been deserialized.

Simplified serialization of TagType to not require passing in the
SerializedPtrID. Registration of the materialized type object is done after
the CreateImpl method returns (as with other types).

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

16 years agoPatch to comment out use of protocol qualifiers when rewriting ivars.
Fariborz Jahanian [Wed, 14 Nov 2007 22:26:25 +0000 (22:26 +0000)]
Patch to comment out use of protocol qualifiers when rewriting ivars.

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

16 years agoImplemented serialization of InitListExpr.
Ted Kremenek [Wed, 14 Nov 2007 21:31:46 +0000 (21:31 +0000)]
Implemented serialization of InitListExpr.

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

16 years agoImplemented serialization of CompoundLiteralExpr.
Ted Kremenek [Wed, 14 Nov 2007 21:18:36 +0000 (21:18 +0000)]
Implemented serialization of CompoundLiteralExpr.

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

16 years agoAdded serialization of Union decls.
Ted Kremenek [Wed, 14 Nov 2007 21:15:42 +0000 (21:15 +0000)]
Added serialization of Union decls.

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

16 years agoRemoved assertion inserted only for temporary debugging.
Ted Kremenek [Wed, 14 Nov 2007 19:36:11 +0000 (19:36 +0000)]
Removed assertion inserted only for temporary debugging.

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

16 years agoAdded missing break statement.
Ted Kremenek [Wed, 14 Nov 2007 19:33:01 +0000 (19:33 +0000)]
Added missing break statement.

Reordered serialization methods for FunctionTypeProto and FunctionTypeNoProto
to be alphabetical by serialized type name.

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

16 years agoFairly major surgery to RewriteTest::SynthesizeObjcInternalStruct().
Steve Naroff [Wed, 14 Nov 2007 19:25:57 +0000 (19:25 +0000)]
Fairly major surgery to RewriteTest::SynthesizeObjcInternalStruct().

This allows us to handle funky stuff like...

#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
@interface NSLayoutManager : NSObject <NSCoding, NSGlyphStorage> {
#else /* MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 */
@interface NSLayoutManager : NSObject <NSCoding> {
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 */

...which now rewrites to...

#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
#ifndef _REWRITER_typedef_NSLayoutManager
#define _REWRITER_typedef_NSLayoutManager
typedef struct objc_object NSLayoutManager;
#endif

struct NSLayoutManager {
    struct NSObject _NSObject;

#else /* MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 */
// @interface NSLayoutManager : NSObject <NSCoding> {
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 */

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

16 years agoImplemented serialization of EnumDecl and EnumConstantDecl.
Ted Kremenek [Wed, 14 Nov 2007 18:12:19 +0000 (18:12 +0000)]
Implemented serialization of EnumDecl and EnumConstantDecl.

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

16 years agoImplemented serialization of FieldDecls.
Ted Kremenek [Wed, 14 Nov 2007 17:47:01 +0000 (17:47 +0000)]
Implemented serialization of FieldDecls.

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

16 years agoSourceManager, IdentifierTable, Selectors are now serialized in their own
Ted Kremenek [Wed, 14 Nov 2007 17:46:35 +0000 (17:46 +0000)]
SourceManager, IdentifierTable, Selectors are now serialized in their own
block separate from ASTContext. This block is serialized out AFTER writing out
ASTContext, but deserialized BEFORE reading in ASTContext. This permits the
optimization of the serialization of the IdentifierTable where we only write
out identifiers that are used.

This was needed because TagDecls are owned by Types, and TagDecls contain
identifiers. Thus types need to be written out first to register with the
serializer any identifiers they refer to (and hence need to be serialized out
with IdentifierTable).

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

16 years agoRemoved unused variabel.
Fariborz Jahanian [Wed, 14 Nov 2007 17:35:46 +0000 (17:35 +0000)]
Removed unused variabel.

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

16 years agoFix a bug handling hex floats in c90 mode, pointed out by Neil.
Chris Lattner [Wed, 14 Nov 2007 16:14:50 +0000 (16:14 +0000)]
Fix a bug handling hex floats in c90 mode, pointed out by Neil.

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

16 years agoFix yesterday's regression with rewriting @optional/@required.
Steve Naroff [Wed, 14 Nov 2007 15:03:57 +0000 (15:03 +0000)]
Fix yesterday's regression with rewriting @optional/@required.

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

16 years agoRewrite methods that span multiple lines.
Steve Naroff [Wed, 14 Nov 2007 14:34:23 +0000 (14:34 +0000)]
Rewrite methods that span multiple lines.

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

16 years agoAllow properties within a protocol. The case below was asserting...now it works fine.
Steve Naroff [Wed, 14 Nov 2007 14:15:31 +0000 (14:15 +0000)]
Allow properties within a protocol. The case below was asserting...now it works fine.

@protocol CAMediaTiming

@property int beginTime;

@end

Comments in the code tell the rest of the story...

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

16 years agoImplemented serialization of RecordDecls. Changed serialization of TagType to
Ted Kremenek [Wed, 14 Nov 2007 08:06:37 +0000 (08:06 +0000)]
Implemented serialization of RecordDecls. Changed serialization of TagType to
have an owning pointer to the referred TagDecl. This should hopefully fix a
bug where TagDecls (including decls from structs, etc.) were not serialized.

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

16 years agoimplement test/Sema/typedef-prototype.c, allowing code
Chris Lattner [Wed, 14 Nov 2007 06:34:38 +0000 (06:34 +0000)]
implement test/Sema/typedef-prototype.c, allowing code
to declare a function with a typedef:

typedef int unary_int_func(int arg);
unary_int_func add_one;

This patch contributed by Seo Sanghyeon!

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

16 years agoComment out recent regression r44096.
Steve Naroff [Wed, 14 Nov 2007 03:37:28 +0000 (03:37 +0000)]
Comment out recent regression r44096.

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

16 years agoRewrite @optional/@required directives used inside protocol definitions.
Fariborz Jahanian [Wed, 14 Nov 2007 01:37:46 +0000 (01:37 +0000)]
Rewrite @optional/@required directives used inside protocol definitions.

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

16 years agoRewrite of forward protocol declaration.
Fariborz Jahanian [Wed, 14 Nov 2007 00:42:16 +0000 (00:42 +0000)]
Rewrite of forward protocol declaration.

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

16 years agoImplemented serialization of FunctionTypeNoProto.
Ted Kremenek [Wed, 14 Nov 2007 00:38:50 +0000 (00:38 +0000)]
Implemented serialization of FunctionTypeNoProto.

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

16 years agoImplemented serialization of VariableArrayTypes.
Ted Kremenek [Wed, 14 Nov 2007 00:31:36 +0000 (00:31 +0000)]
Implemented serialization of VariableArrayTypes.

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

16 years agoImplemented serialization of TypedefType.
Ted Kremenek [Wed, 14 Nov 2007 00:27:46 +0000 (00:27 +0000)]
Implemented serialization of TypedefType.

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

16 years agoImplemented serialization of ConstantArrayType.
Ted Kremenek [Wed, 14 Nov 2007 00:17:21 +0000 (00:17 +0000)]
Implemented serialization of ConstantArrayType.

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

16 years agoImplemented serialization of TagTypes.
Ted Kremenek [Wed, 14 Nov 2007 00:03:56 +0000 (00:03 +0000)]
Implemented serialization of TagTypes.

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

16 years agoModified ASTContext::getTagDeclType() to accept a NULL pointer for the passed
Ted Kremenek [Wed, 14 Nov 2007 00:03:20 +0000 (00:03 +0000)]
Modified ASTContext::getTagDeclType() to accept a NULL pointer for the passed
in TagDecl*. This allows the deserializer to use ASTContext to create the
TagTypes. Deserialize TagTypes then rely on pointer-backpatching to resolve
the decls.

This may not be the interface that we want, but as the implementation of
TagTypes will potentially change significantly in the future, I'm leaving this
for now. An appropriate FIXME is in place.

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

16 years agoFix regression with ObjC method definitions and -ast-print
Steve Naroff [Tue, 13 Nov 2007 23:48:03 +0000 (23:48 +0000)]
Fix regression with ObjC method definitions and -ast-print

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

16 years agoType encoding for structs.
Fariborz Jahanian [Tue, 13 Nov 2007 23:21:38 +0000 (23:21 +0000)]
Type encoding for structs.

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

16 years agoRewrite method definition bodies. Also renamed a method to distinguish between method...
Steve Naroff [Tue, 13 Nov 2007 23:01:27 +0000 (23:01 +0000)]
Rewrite method definition bodies. Also renamed a method to distinguish between method declarations and definitions.

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

16 years agoRemoved line with typo (declared friendship with ASTContext). Line was
Ted Kremenek [Tue, 13 Nov 2007 22:57:59 +0000 (22:57 +0000)]
Removed line with typo (declared friendship with ASTContext).  Line was
not needed since friendship is declared elsewhere.

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

16 years agoAdded pretty-printing of statements during serialization.
Ted Kremenek [Tue, 13 Nov 2007 22:56:10 +0000 (22:56 +0000)]
Added pretty-printing of statements during serialization.

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

16 years agoImplemented serialization of AsmStmt (or rather what is currently implemented
Ted Kremenek [Tue, 13 Nov 2007 22:55:51 +0000 (22:55 +0000)]
Implemented serialization of AsmStmt (or rather what is currently implemented
in AsmStmt).

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

16 years agoFixed bug in FunctionDecl serialization where we crashed when the
Ted Kremenek [Tue, 13 Nov 2007 22:51:08 +0000 (22:51 +0000)]
Fixed bug in FunctionDecl serialization where we crashed when the
FunctionDecl had decls for its parameters but still had greater than 0
arguments.

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

16 years agoImplemented serialization for SizeOfAlignOfTypeExpr.
Ted Kremenek [Tue, 13 Nov 2007 22:30:29 +0000 (22:30 +0000)]
Implemented serialization for SizeOfAlignOfTypeExpr.

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

16 years agoImplemented serialization for MemberExpr.
Ted Kremenek [Tue, 13 Nov 2007 22:16:23 +0000 (22:16 +0000)]
Implemented serialization for MemberExpr.

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

16 years agoGive AST-walk passes a way to access DeclSpec attributes on functions and
Nate Begeman [Tue, 13 Nov 2007 22:14:47 +0000 (22:14 +0000)]
Give AST-walk passes a way to access DeclSpec attributes on functions and
  variables.

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

16 years agoFixed a rewrite of metadata bug when category implementation has no matching interface.
Fariborz Jahanian [Tue, 13 Nov 2007 22:09:49 +0000 (22:09 +0000)]
Fixed a rewrite of metadata bug when category implementation has no matching interface.

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

16 years agoRewrote type serialization to used the same methodology as we do for Decls.
Ted Kremenek [Tue, 13 Nov 2007 22:02:55 +0000 (22:02 +0000)]
Rewrote type serialization to used the same methodology as we do for Decls.
Removed tons of dead code in ASTContext concerning how types use to be
serialized.
Removed serialization methods from QualType that are no longer used.

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

16 years agoRename Sema method to follow class naming convention
Nate Begeman [Tue, 13 Nov 2007 21:49:48 +0000 (21:49 +0000)]
Rename Sema method to follow class naming convention

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

16 years agoPopulate metadata with adrress of method code.
Fariborz Jahanian [Tue, 13 Nov 2007 21:02:00 +0000 (21:02 +0000)]
Populate metadata with adrress of method code.

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

16 years agoParse "sizeof(arr)[0]" as a sizeof of an expr if arr
Chris Lattner [Tue, 13 Nov 2007 20:50:37 +0000 (20:50 +0000)]
Parse "sizeof(arr)[0]" as a sizeof of an expr if arr
is an expression.

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

16 years agoRewrite of method definitions in categories.
Fariborz Jahanian [Tue, 13 Nov 2007 20:04:28 +0000 (20:04 +0000)]
Rewrite of method definitions in categories.

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

16 years agoOrder of methods are OK and generated .c file can be compiled.
Fariborz Jahanian [Tue, 13 Nov 2007 19:21:13 +0000 (19:21 +0000)]
Order of methods are OK and generated .c file can be compiled.

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

16 years agoUpdated test case to flag about comparisons against constants. We may
Ted Kremenek [Tue, 13 Nov 2007 19:18:22 +0000 (19:18 +0000)]
Updated test case to flag about comparisons against constants.  We may
invert this case (i.e., not flag a warning) in the future.

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

16 years agoModified -Wfloat-equal logic to suppress warnings where floating point values
Ted Kremenek [Tue, 13 Nov 2007 19:17:00 +0000 (19:17 +0000)]
Modified -Wfloat-equal logic to suppress warnings where floating point values
are compared against builtins such as __builtin_inf.

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

16 years agoFirst patch in rewrie of method definitions. This is work in progress.
Fariborz Jahanian [Tue, 13 Nov 2007 18:44:14 +0000 (18:44 +0000)]
First patch in rewrie of method definitions. This is work in progress.

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

16 years agoUpdated diagnostic for -Wfloat-equal to underline the offending expressions.
Ted Kremenek [Tue, 13 Nov 2007 18:40:33 +0000 (18:40 +0000)]
Updated diagnostic for -Wfloat-equal to underline the offending expressions.

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

16 years agoAdded -Wfloat-equal option to the driver. This makes warnings about
Ted Kremenek [Tue, 13 Nov 2007 18:37:02 +0000 (18:37 +0000)]
Added -Wfloat-equal option to the driver.  This makes warnings about
floating point comparisons using == or != an opt-in rather than a default
warning.

Updated test case to use -Wfloat-equal.

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

16 years agoClean up types, removing some casts. Patch contributed by
Chris Lattner [Tue, 13 Nov 2007 18:16:41 +0000 (18:16 +0000)]
Clean up types, removing some casts.  Patch contributed by
Cedric Venet.

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

16 years agoimprove handling of address of global when checking for
Chris Lattner [Tue, 13 Nov 2007 18:05:45 +0000 (18:05 +0000)]
improve handling of address of global when checking for
constants and initializers.  Patch by Sanghyeon Seo, thanks!

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

16 years agoTeach Sema::CheckCompareOperands() about "void *" (C99 6.5.9p2)
Steve Naroff [Tue, 13 Nov 2007 14:57:38 +0000 (14:57 +0000)]
Teach Sema::CheckCompareOperands() about "void *" (C99 6.5.9p2)

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

16 years agoTune the lookup logic in Sema::ActOnInstanceMessage() to handle private methods ...
Steve Naroff [Tue, 13 Nov 2007 04:10:18 +0000 (04:10 +0000)]
Tune the lookup logic in Sema::ActOnInstanceMessage() to handle private methods (declared within the implementation).

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

16 years agoMinor indenting changes and removed a level of casting in getClassInterface();
Steve Naroff [Tue, 13 Nov 2007 01:40:57 +0000 (01:40 +0000)]
Minor indenting changes and removed a level of casting in getClassInterface();

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

16 years agoPatch to set context (interface, category, etc.) in which method is declared.
Fariborz Jahanian [Tue, 13 Nov 2007 01:10:08 +0000 (01:10 +0000)]
Patch to set context (interface, category, etc.) in which method is declared.

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

16 years agoFix Sema::CheckAssignmentConstraints() to operate on the canonical, unqualified type.
Steve Naroff [Tue, 13 Nov 2007 00:31:42 +0000 (00:31 +0000)]
Fix Sema::CheckAssignmentConstraints() to operate on the canonical, unqualified type.

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

16 years agoRenamed all serialization "Materialize" methods to "Create" to conform with
Ted Kremenek [Tue, 13 Nov 2007 00:25:37 +0000 (00:25 +0000)]
Renamed all serialization "Materialize" methods to "Create" to conform with
the new serialization API.

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

16 years agoRestructured serialization code for decls to make it cleaner, easier to
Ted Kremenek [Tue, 13 Nov 2007 00:15:39 +0000 (00:15 +0000)]
Restructured serialization code for decls to make it cleaner, easier to
understand, and batched the emission owned subobjects (using
BatchEmitOwnedPtr) to get a smaller output bitcode size.

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

16 years agoPatch to do statically typed ivar references.
Fariborz Jahanian [Mon, 12 Nov 2007 22:29:28 +0000 (22:29 +0000)]
Patch to do statically typed ivar references.

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

16 years agoAdd category method definitions incrementally, removing a FIXME (like we do for class...
Steve Naroff [Mon, 12 Nov 2007 22:05:31 +0000 (22:05 +0000)]
Add category method definitions incrementally, removing a FIXME (like we do for class implementations).

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

16 years agoMinor twik for when there is no super class and 'super' is errornously used.
Fariborz Jahanian [Mon, 12 Nov 2007 20:20:37 +0000 (20:20 +0000)]
Minor twik for when there is no super class and 'super' is errornously used.

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

16 years ago'super' nailed.
Fariborz Jahanian [Mon, 12 Nov 2007 20:13:27 +0000 (20:13 +0000)]
'super' nailed.

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

16 years agoFix regression to Sema::ObjcActOnStartOfMethodDef()...need to initialize InvalidType...
Steve Naroff [Mon, 12 Nov 2007 19:48:27 +0000 (19:48 +0000)]
Fix regression to Sema::ObjcActOnStartOfMethodDef()...need to initialize InvalidType field to false.

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

16 years agoAdd an error diagnostic to Parse::ParseObjCMessageExpression().
Steve Naroff [Mon, 12 Nov 2007 19:18:37 +0000 (19:18 +0000)]
Add an error diagnostic to Parse::ParseObjCMessageExpression().

This now exposes the following bug...

******************** TEST 'Sema/message.m' FAILED! ********************
Command:
 clang -fsyntax-only -verify Sema/message.m
Output:
Errors seen but not expected:
  Line 9: invalid receiver to message expression
******************** TEST 'Sema/message.m' FAILED! ********************

As far as I can tell, all messages to method agruments fail.

The method arguments are built by Sema::ObjcActOnStartOfMethodDef().

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

16 years agoIn Stmt serialization, renamed directEmit to EmitImpl and
Ted Kremenek [Mon, 12 Nov 2007 18:04:32 +0000 (18:04 +0000)]
In Stmt serialization, renamed directEmit to EmitImpl and
directMaterialize to CreateImpl.

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

16 years agoNow that we can refer to instance variables, make sure they are considered lvalues.
Steve Naroff [Mon, 12 Nov 2007 14:34:27 +0000 (14:34 +0000)]
Now that we can refer to instance variables, make sure they are considered lvalues.

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

16 years agoImplement instance variable references.
Steve Naroff [Mon, 12 Nov 2007 14:29:37 +0000 (14:29 +0000)]
Implement instance variable references.

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

16 years ago- Minor cleanup to yesterday's changes to Sema::ObjcActOnStartOfMethodDef();
Steve Naroff [Mon, 12 Nov 2007 13:56:41 +0000 (13:56 +0000)]
- Minor cleanup to yesterday's changes to Sema::ObjcActOnStartOfMethodDef();
- Add Sema::CurMethodDecl, in preparation for adding ObjcIvarRefExpr.
- Add ObjcInterfaceDecl::lookupInstanceVariable(), in prep for adding ivars.
- A couple renames in ObjcInterfaceDecl, while I was in the vicinity:-)

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

16 years agoForgot this file from my last commit...
Steve Naroff [Mon, 12 Nov 2007 05:02:46 +0000 (05:02 +0000)]
Forgot this file from my last commit...

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

16 years agoRemove Action::ObjcActOnMethodDefinition(). Rationale:
Steve Naroff [Mon, 12 Nov 2007 04:59:00 +0000 (04:59 +0000)]
Remove Action::ObjcActOnMethodDefinition(). Rationale:

- It is not an "action" - it is never called by the parser.
- It was only used by one method, Sema::ObjcActOnStartOfMethodDef().

As a result, the logic it embodied is now directly implemented in Sema::ObjcActOnStartOfMethodDef().

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

16 years agoMake sure @property is allowed within a category.
Steve Naroff [Mon, 12 Nov 2007 04:22:52 +0000 (04:22 +0000)]
Make sure @property is allowed within a category.

Bug submitted by Keith Bauer.

CookieJar:Desktop keith$ cat test.m
#import <WebKit/WebKit.h>

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

16 years agoRemove Sema::ObjcBuildMethodParameter().
Steve Naroff [Mon, 12 Nov 2007 03:44:46 +0000 (03:44 +0000)]
Remove Sema::ObjcBuildMethodParameter().
Modify Sema::ParseParamDeclarator() to work for both ActOnStartOfFunctionDef() and ObjcActOnStartOfMethodDef().

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

16 years agoReplace 2 method definition actions (ActOnFunctionDefBody, ActOnMethodDefBody) with...
Steve Naroff [Sun, 11 Nov 2007 23:20:51 +0000 (23:20 +0000)]
Replace 2 method definition actions (ActOnFunctionDefBody, ActOnMethodDefBody) with 1 method definition action (ActOnFinishFunctionBody). I can't think of any reason that we would need two action hooks.

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

16 years agoReplace 3 method definition functions (ObjcParseMethodDefinition, ParseObjCInstanceMe...
Steve Naroff [Sun, 11 Nov 2007 19:54:21 +0000 (19:54 +0000)]
Replace 3 method definition functions (ObjcParseMethodDefinition, ParseObjCInstanceMethodDefinition, ParseObjCClassMethodDefinition) with 1 method definition function (ParseObjCMethodDefinition).

Less code/confusion.

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

16 years agoTweak Sema::ActOnInstanceMessage() to treat the built-in "Class" type the same as...
Steve Naroff [Sun, 11 Nov 2007 17:52:25 +0000 (17:52 +0000)]
Tweak Sema::ActOnInstanceMessage() to treat the built-in "Class" type the same as "id".

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

16 years agoThis is the last 5% of the solution to teaching Sema::ActOnInstanceMessage() about...
Steve Naroff [Sun, 11 Nov 2007 17:19:15 +0000 (17:19 +0000)]
This is the last 5% of the solution to teaching Sema::ActOnInstanceMessage() about private methods (r43989).

While the diff is large, the idea is very simple. When we parse method definitions (in an @implementation), we need to add them incrementally (rather than wait until the @end).

Other details...

- Renamed Sema::ActOnAddMethodsToObjcDecl() to Sema::ActOnAtEnd(). The methods are now optional arguments.
- Removed Parser::AllImplMethods (a nice cleanup).
- Added location info to ObjcImplementationDecl (since we will need it very soon:-)
- Modified message.m test to no longer allow the bogus diagnostic.

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

16 years agoMake sure Sema::CheckIncrementDecrementOperand() removes typedefs when doing it's...
Steve Naroff [Sun, 11 Nov 2007 14:15:57 +0000 (14:15 +0000)]
Make sure Sema::CheckIncrementDecrementOperand() removes typedefs when doing it's analysis.

Thanks to Seo Sanghyeon for his excellent (first) bug fix!

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

16 years agoTeach Sema::ActOnInstanceMessage() about private methods. That is, methods declared...
Steve Naroff [Sun, 11 Nov 2007 00:10:47 +0000 (00:10 +0000)]
Teach Sema::ActOnInstanceMessage() about private methods. That is, methods declared in an implementation (but not listed in the interface).

This commit is only 95% of the bug fix. The last piece to this puzzle is to add the method decls to the implementation incrementally (as we encounter them). At the moment, the methods aren't added until we see an @end (which is too late).

I will complete this later...

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