]> granicus.if.org Git - clang/log
clang
17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 years agoFixed a bug which exposed the internally built type to user code.
Fariborz Jahanian [Sat, 10 Nov 2007 22:00:55 +0000 (22:00 +0000)]
Fixed a bug which exposed the internally built type to user code.

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

17 years agopretty priting for method definitions.
Fariborz Jahanian [Sat, 10 Nov 2007 20:59:13 +0000 (20:59 +0000)]
pretty priting for method definitions.

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

17 years agoFix a basic bug (having to do with typedefs) in Sema::UsualArithmeticConversions().
Steve Naroff [Sat, 10 Nov 2007 19:45:54 +0000 (19:45 +0000)]
Fix a basic bug (having to do with typedefs) in Sema::UsualArithmeticConversions().

This resuled in the following crash below.

Also modified the usual-float.c test case to capture this case.

[steve-naroffs-imac:clang/test/Sema] snaroff% ../../../../Debug/bin/clang usual-float.c
Assertion failed: (0 && "Sema::UsualArithmeticConversions(): illegal float comparison"), function UsualArithmeticConversions, file SemaExpr.cpp, line 960.
0   clang                               0x001ef9b9 _ZN40_GLOBAL__N_Signals.cpp_00000000_4E6DAF8315PrintStackTraceEv + 45
1   clang                               0x001efd5f _ZN40_GLOBAL__N_Signals.cpp_00000000_4E6DAF8313SignalHandlerEi + 323
2   libSystem.B.dylib                   0x90c6297b _sigtramp + 43
3   ???                                 0xffffffff 0x0 + 4294967295
4   libSystem.B.dylib                   0x90cdb782 raise + 26
5   libSystem.B.dylib                   0x90cead3f abort + 73
6   libSystem.B.dylib                   0x90cdc923 __assert_rtn + 101
7   clang                               0x00077316 _ZN5clang4Sema26UsualArithmeticConversionsERPNS_4ExprES3_b + 1004
8   clang                               0x000803cf _ZN5clang4Sema27CheckMultiplyDivideOperandsERPNS_4ExprES3_NS_14SourceLocationEb + 181
9   clang                               0x0007a8e8 _ZN5clang4Sema10ActOnBinOpENS_14SourceLocationENS_3tok9TokenKindEPvS4_ + 472
10  clang                               0x000cf058 _ZN5clang6Parser26ParseRHSOfBinaryExpressionENS_6Action12ActionResultILj0EEEj + 1286
11  clang                               0x000cf2de _ZN5clang6Parser25ParseAssignmentExpressionEv + 86

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

17 years agoSince we are all working on Leopard, change the built-in MacOS X version number ...
Steve Naroff [Sat, 10 Nov 2007 18:06:36 +0000 (18:06 +0000)]
Since we are all working on Leopard, change the built-in MacOS X version number (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) to target Leopard. This is only a short term solution, until the clang driver implements the "-mmacosx-version-min" flag (which will compute this value based on the target).

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

17 years agoMinor code clean up in method def area.
Fariborz Jahanian [Sat, 10 Nov 2007 17:40:57 +0000 (17:40 +0000)]
Minor code clean up in method def area.

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

17 years agoRepresent method definitions as separate AST nodes. Pretty print will come next.
Fariborz Jahanian [Sat, 10 Nov 2007 16:31:34 +0000 (16:31 +0000)]
Represent method definitions as separate AST nodes. Pretty print will come next.

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

17 years agoChanged the serialization of IdentifierTable to only serialize out entries
Ted Kremenek [Sat, 10 Nov 2007 02:11:55 +0000 (02:11 +0000)]
Changed the serialization of IdentifierTable to only serialize out entries
that are referenced in the ASTs. This assumes that we serialize out the
decls/stmts first, and use the pointer-tracking logic in the Serializer to
determine if an IdentifierInfo (or its string key) is ever referenced.

This is a significant space optimization for serialized ASTs.

Consider the following program:

void foo(int x,int y) {
  return x > y ? x : y+1;
}

Here are the sizes of the files for the serialized ASTs:

        Full IdentifierTable: 23676 bytes
 Only-referenced Identifiers:   304 bytes.

For this simple program, this is a 77% reduction in the file size of the
serialized ASTs.

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

17 years agoModifed the test serialization driver to...
Ted Kremenek [Sat, 10 Nov 2007 02:07:12 +0000 (02:07 +0000)]
Modifed the test serialization driver to...

(1) serialize out top-level decls BEFORE serializing out translation unit
structures like ASTContext.

(2) deserialize out translation unit structures like ASTContext before
top-level decls by first skipping the decls in the bitstream, deserializing
ASTContext and friends, and then jumping back to the bitstream block with the
decls and then deserializing them.

Change (1) allows us to utilize the pointer-tracking system in the Serializer
to only serialize out metadata that is actually referenced by the ASTS.

Change (2) allows us to deserialize the metadata first as before, which
signficantly reduces the amount of pointer backpatching the deserializer
would have to do if the decls were deserialized first.

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

17 years agorename getInstantiationLoc to match the scheme of isPhysicalLoc.
Chris Lattner [Fri, 9 Nov 2007 23:59:17 +0000 (23:59 +0000)]
rename getInstantiationLoc to match the scheme of isPhysicalLoc.

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

17 years agochange source location to have two bits for macros, tracking
Chris Lattner [Fri, 9 Nov 2007 23:52:16 +0000 (23:52 +0000)]
change source location to have two bits for macros, tracking
whether the location is the start and/or end of an expansion.
These are currently not set or used by anything.

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

17 years agoSome code clean up in the form of name changes for functions which
Fariborz Jahanian [Fri, 9 Nov 2007 22:27:59 +0000 (22:27 +0000)]
Some code clean up in the form of name changes for functions which
process method definitions.

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

17 years agoUpdated VC++ build system
Hartmut Kaiser [Fri, 9 Nov 2007 19:53:21 +0000 (19:53 +0000)]
Updated VC++ build system

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

17 years agoAdded class context to method declarations. Provide "interface *" type
Fariborz Jahanian [Fri, 9 Nov 2007 19:52:12 +0000 (19:52 +0000)]
Added class context to method declarations. Provide "interface *" type
to 'self' method of instance methods.

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

17 years agoInsert invisble arguments to method definition header.
Fariborz Jahanian [Fri, 9 Nov 2007 17:18:29 +0000 (17:18 +0000)]
Insert invisble arguments to method definition header.

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

17 years agoRewrite global variable initializers.
Steve Naroff [Fri, 9 Nov 2007 15:20:18 +0000 (15:20 +0000)]
Rewrite global variable initializers.

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

17 years agoRecognize ObjCStringLiteral as a constant expression.
Steve Naroff [Fri, 9 Nov 2007 15:00:03 +0000 (15:00 +0000)]
Recognize ObjCStringLiteral as a constant expression.

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

17 years ago- add typedef guards.
Steve Naroff [Fri, 9 Nov 2007 12:50:28 +0000 (12:50 +0000)]
- add typedef guards.
- tweak scanForProtocolRefs heuristic.
- disable RewriteInclude() for now.

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

17 years agoChanged method call to reflect updated serialization API.
Ted Kremenek [Fri, 9 Nov 2007 00:43:55 +0000 (00:43 +0000)]
Changed method call to reflect updated serialization API.

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

17 years agoFirst patch toward rewriting of method definitions. This is work in progress.
Fariborz Jahanian [Thu, 8 Nov 2007 23:49:49 +0000 (23:49 +0000)]
First patch toward rewriting of method definitions. This is work in progress.

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

17 years agoremove some temporary code.
Chris Lattner [Thu, 8 Nov 2007 20:53:07 +0000 (20:53 +0000)]
remove some temporary code.

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

17 years agoadd a getAtOffset() member to simplify some code.
Chris Lattner [Thu, 8 Nov 2007 20:51:02 +0000 (20:51 +0000)]
add a getAtOffset() member to simplify some code.

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

17 years agoRewrote serialization of IdentifierInfo and IdentifierTable to use methods Emit
Ted Kremenek [Thu, 8 Nov 2007 19:52:41 +0000 (19:52 +0000)]
Rewrote serialization of IdentifierInfo and IdentifierTable to use methods Emit
and Materialize/Read instead of using specializations of SerializeTrait<>. The
resulting code is much cleaner. We are also setting the stage so that only the
parts of the IdentifierTable that are ever referenced within the ASTs are
serialized, and not the whole table.

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

17 years agoadd a fixme.
Chris Lattner [Thu, 8 Nov 2007 19:40:23 +0000 (19:40 +0000)]
add a fixme.

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

17 years agosignificantly simplify the implementation of RewriteRope by changing the
Chris Lattner [Thu, 8 Nov 2007 19:39:57 +0000 (19:39 +0000)]
significantly simplify the implementation of RewriteRope by changing the
implementation to be list<RopePiece> instead of vector<RopePiece*>.

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

17 years agoRefactored parsing of main function body for reuse by objective-c methods.
Fariborz Jahanian [Thu, 8 Nov 2007 19:01:26 +0000 (19:01 +0000)]
Refactored parsing of main function body for reuse by objective-c methods.

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

17 years agoimprove MakeRopeString to avoid doing a malloc for every 2-character string
Chris Lattner [Thu, 8 Nov 2007 18:32:01 +0000 (18:32 +0000)]
improve MakeRopeString to avoid doing a malloc for every 2-character string
that gets inserted.  This speeds up the rewriter another 10%.

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

17 years agoSimplify interface to MakeRopeString.
Chris Lattner [Thu, 8 Nov 2007 17:59:48 +0000 (17:59 +0000)]
Simplify interface to MakeRopeString.

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

17 years agoFix backwards assert.
Chris Lattner [Thu, 8 Nov 2007 17:56:40 +0000 (17:56 +0000)]
Fix backwards assert.

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

17 years agoImplemented serialization of AddrLabelExpr.
Ted Kremenek [Thu, 8 Nov 2007 16:32:00 +0000 (16:32 +0000)]
Implemented serialization of AddrLabelExpr.
Implemented serialization of ConditionalOperator.
Implemented serialization of StmtExpr.
Fixed bug in serialization of IndirectGoto (did not properly serialize subexpression).

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

17 years agoRewrite RewriteObjCStringLiteral(). This version is simpler (and unlike the previous...
Steve Naroff [Thu, 8 Nov 2007 14:30:50 +0000 (14:30 +0000)]
Rewrite RewriteObjCStringLiteral(). This version is simpler (and unlike the previous one, works:-)

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

17 years agoAdd a new RewriteRope data structure which is a smarter way to represent the text
Chris Lattner [Thu, 8 Nov 2007 07:35:14 +0000 (07:35 +0000)]
Add a new RewriteRope data structure which is a smarter way to represent the text
backing a rewrite buffer than using an std::vector<char>.  This class was hacked
together very quickly and needs to be cleaned up, but it seems to work.  It speeds
up rewriting a a 7M file from 6.43s to 0.24s on my machine.  The impl could also
be made to be a lot more algorithmically sound.

This produces identical output to using vector on this testcase, if it causes a
problems or bugs are encountered, it can be disabled by changing the
RewriteBuffer::Buffer typedef back.

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

17 years agoabstract out buffer type a bit better
Chris Lattner [Thu, 8 Nov 2007 05:42:25 +0000 (05:42 +0000)]
abstract out buffer type a bit better

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

17 years agouse insert instead of replacing 0 bytes with text :)
Chris Lattner [Thu, 8 Nov 2007 04:41:51 +0000 (04:41 +0000)]
use insert instead of replacing 0 bytes with text :)

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

17 years agominor cleanups
Chris Lattner [Thu, 8 Nov 2007 04:41:04 +0000 (04:41 +0000)]
minor cleanups

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

17 years agouse std::copy instead of memcpy for abstraction.
Chris Lattner [Thu, 8 Nov 2007 04:27:23 +0000 (04:27 +0000)]
use std::copy instead of memcpy for abstraction.
Disable rewrite-tabs.  This speeds up processing of the commentified huge
crazy testcase steve gave me from 20s to 6.6s in a release build.

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

17 years agoFix a rewriter bug that fariborz hit, when an @interface was the very very very
Chris Lattner [Thu, 8 Nov 2007 04:09:59 +0000 (04:09 +0000)]
Fix a rewriter bug that fariborz hit, when an @interface was the very very very
first thing in the file.

The trick is that text replacement should go after the insert point,
not before it, because it will be replacing text after the point, not before
it.

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

17 years agoRevised serialization of CaseStmt to emit all of the owned pointers (its
Ted Kremenek [Thu, 8 Nov 2007 00:56:26 +0000 (00:56 +0000)]
Revised serialization of CaseStmt to emit all of the owned pointers (its
subexpressions) all together in one block at the end.

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

17 years agoImplemented serialization of CompoundAssignOperator.
Ted Kremenek [Thu, 8 Nov 2007 00:41:37 +0000 (00:41 +0000)]
Implemented serialization of CompoundAssignOperator.

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

17 years agoAdd assert for the case that is not handled.
Devang Patel [Thu, 8 Nov 2007 00:32:12 +0000 (00:32 +0000)]
Add assert for the case that is not handled.
struct { char a; short b:2; };

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

17 years agoImplemented serialization of UnaryOperator.
Ted Kremenek [Thu, 8 Nov 2007 00:26:24 +0000 (00:26 +0000)]
Implemented serialization of UnaryOperator.

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

17 years agoKeep track of beginning offset for the bit field that does not start at byte boundry.
Devang Patel [Thu, 8 Nov 2007 00:17:59 +0000 (00:17 +0000)]
Keep track of beginning offset for the bit field that does not start at byte boundry.

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

17 years agoImplemented serialization of CallExpr.
Ted Kremenek [Wed, 7 Nov 2007 23:32:20 +0000 (23:32 +0000)]
Implemented serialization of CallExpr.

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

17 years agoImplemented serialization of ArraySubscriptExpr.
Ted Kremenek [Wed, 7 Nov 2007 22:53:01 +0000 (22:53 +0000)]
Implemented serialization of ArraySubscriptExpr.
Added "using ..." for "Serializer" and "Deserializer" to reduce amount
of typing for serialization methods.

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

17 years agoImplemented serialization of CastExpr.
Ted Kremenek [Wed, 7 Nov 2007 22:42:34 +0000 (22:42 +0000)]
Implemented serialization of CastExpr.

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

17 years agoImplemented serialization of ImplicitCastExpr.
Ted Kremenek [Wed, 7 Nov 2007 22:39:17 +0000 (22:39 +0000)]
Implemented serialization of ImplicitCastExpr.

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

17 years agoModified serialization of BinaryOperator and CaseStmt to use the new
Ted Kremenek [Wed, 7 Nov 2007 22:32:23 +0000 (22:32 +0000)]
Modified serialization of BinaryOperator and CaseStmt to use the new
BatchEmitOwnedPtrs() and BatchReadOwnedPtrs() methods.

Modified serialization of all Stmts to start their own record in the bitstream.

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

17 years agoStay within 80 columns.
Devang Patel [Wed, 7 Nov 2007 21:04:59 +0000 (21:04 +0000)]
Stay within 80 columns.

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

17 years agoUpdated VC++ build system
Hartmut Kaiser [Wed, 7 Nov 2007 19:34:40 +0000 (19:34 +0000)]
Updated VC++ build system

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

17 years agoImplemented serialization of StringLiteral.
Ted Kremenek [Wed, 7 Nov 2007 19:08:19 +0000 (19:08 +0000)]
Implemented serialization of StringLiteral.

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

17 years agoImplemented serialization of ImaginaryLiteral.
Ted Kremenek [Wed, 7 Nov 2007 18:53:02 +0000 (18:53 +0000)]
Implemented serialization of ImaginaryLiteral.

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

17 years agoImplemented serialization of FloatingLiteral.
Ted Kremenek [Wed, 7 Nov 2007 18:45:55 +0000 (18:45 +0000)]
Implemented serialization of FloatingLiteral.

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

17 years agoFinishing touches on code generation for @try and friends.
Steve Naroff [Wed, 7 Nov 2007 18:43:40 +0000 (18:43 +0000)]
Finishing touches on code generation for @try and friends.

- declare functions we use.
- cast arguments to objc_exception_match().
- don't take the & of _stack.buf.

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

17 years agoEmit objective-c's meta-data at the end of rewriting to stdout.
Fariborz Jahanian [Wed, 7 Nov 2007 18:40:28 +0000 (18:40 +0000)]
Emit objective-c's meta-data at the end of rewriting to stdout.

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

17 years agoRemove old asserts from ASTContext::isObjcIdType() and isObjcClassType(). Instead...
Steve Naroff [Wed, 7 Nov 2007 18:07:59 +0000 (18:07 +0000)]
Remove old asserts from ASTContext::isObjcIdType() and isObjcClassType(). Instead, return false if the declarations aren't in scope. This was a hold over from when 'id' and 'Class' were initialized lazily.

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

17 years agoFixed an array overflow bug.
Fariborz Jahanian [Wed, 7 Nov 2007 17:43:16 +0000 (17:43 +0000)]
Fixed an array overflow bug.

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

17 years agoFixed typo.
Fariborz Jahanian [Wed, 7 Nov 2007 17:29:15 +0000 (17:29 +0000)]
Fixed typo.

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

17 years agoImplemented serialization of CharacterLiteral.
Ted Kremenek [Wed, 7 Nov 2007 17:15:49 +0000 (17:15 +0000)]
Implemented serialization of CharacterLiteral.

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

17 years agoImplemented serialiation of PreDefinedExpr.
Ted Kremenek [Wed, 7 Nov 2007 17:11:58 +0000 (17:11 +0000)]
Implemented serialiation of PreDefinedExpr.

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

17 years agoImplemented serialization of ContinueStmt.
Ted Kremenek [Wed, 7 Nov 2007 17:05:07 +0000 (17:05 +0000)]
Implemented serialization of ContinueStmt.

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

17 years agoImplemented serialization of IndirectGotoStmt.
Ted Kremenek [Wed, 7 Nov 2007 17:02:32 +0000 (17:02 +0000)]
Implemented serialization of IndirectGotoStmt.
Added "FIXME" regarding the lack of source location information for IndirectGotoStmt.

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

17 years agoImplement rewrite for @throw.
Steve Naroff [Wed, 7 Nov 2007 15:32:26 +0000 (15:32 +0000)]
Implement rewrite for @throw.

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

17 years agoImplemented serialization of GotoStmt.
Ted Kremenek [Wed, 7 Nov 2007 08:07:46 +0000 (08:07 +0000)]
Implemented serialization of GotoStmt.

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

17 years agoImplemented serialization for ForStmt.
Ted Kremenek [Wed, 7 Nov 2007 08:02:55 +0000 (08:02 +0000)]
Implemented serialization for ForStmt.

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

17 years agoImplemented serialization of DoStmt.
Ted Kremenek [Wed, 7 Nov 2007 07:53:55 +0000 (07:53 +0000)]
Implemented serialization of DoStmt.

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

17 years agoImplemented serialization for WhileStmt.
Ted Kremenek [Wed, 7 Nov 2007 07:50:10 +0000 (07:50 +0000)]
Implemented serialization for WhileStmt.

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