Fariborz Jahanian
c6225532c3
Patch to comment out use of protocol qualifiers when rewriting ivars.
...
llvm-svn: 44142
2007-11-14 22:26:25 +00:00
Ted Kremenek
e25b79ff84
Implemented serialization of InitListExpr.
...
llvm-svn: 44137
2007-11-14 21:31:46 +00:00
Ted Kremenek
3db07a7016
Implemented serialization of CompoundLiteralExpr.
...
llvm-svn: 44134
2007-11-14 21:18:36 +00:00
Ted Kremenek
fab0c76a25
Added serialization of Union decls.
...
llvm-svn: 44133
2007-11-14 21:15:42 +00:00
Ted Kremenek
00e0b40599
Removed assertion inserted only for temporary debugging.
...
llvm-svn: 44131
2007-11-14 19:36:11 +00:00
Ted Kremenek
ec56081f38
Added missing break statement.
...
Reordered serialization methods for FunctionTypeProto and FunctionTypeNoProto
to be alphabetical by serialized type name.
llvm-svn: 44130
2007-11-14 19:33:01 +00:00
Steve Naroff
dde78986fb
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 */
llvm-svn: 44129
2007-11-14 19:25:57 +00:00
Ted Kremenek
26ba7973ea
Implemented serialization of EnumDecl and EnumConstantDecl.
...
llvm-svn: 44127
2007-11-14 18:12:19 +00:00
Ted Kremenek
8e93ca3de5
Implemented serialization of FieldDecls.
...
llvm-svn: 44126
2007-11-14 17:47:01 +00:00
Ted Kremenek
31ae973708
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).
llvm-svn: 44125
2007-11-14 17:46:35 +00:00
Fariborz Jahanian
794793ec1c
Removed unused variabel.
...
llvm-svn: 44123
2007-11-14 17:35:46 +00:00
Chris Lattner
e6c7a858b0
Fix a bug handling hex floats in c90 mode, pointed out by Neil.
...
llvm-svn: 44120
2007-11-14 16:14:50 +00:00
Steve Naroff
a509f04034
Fix yesterday's regression with rewriting @optional/@required.
...
llvm-svn: 44119
2007-11-14 15:03:57 +00:00
Steve Naroff
58ed6c04f2
Rewrite methods that span multiple lines.
...
llvm-svn: 44118
2007-11-14 14:34:23 +00:00
Steve Naroff
9e0887cff4
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...
llvm-svn: 44117
2007-11-14 14:15:31 +00:00
Ted Kremenek
3c9c7b84fe
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.
llvm-svn: 44106
2007-11-14 08:06:37 +00:00
Chris Lattner
07b201d9c0
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!
llvm-svn: 44100
2007-11-14 06:34:38 +00:00
Steve Naroff
c17b056427
Comment out recent regression r44096.
...
llvm-svn: 44098
2007-11-14 03:37:28 +00:00
Fariborz Jahanian
fe38ba24af
Rewrite @optional/@required directives used inside protocol definitions.
...
llvm-svn: 44096
2007-11-14 01:37:46 +00:00
Fariborz Jahanian
da6165c3dc
Rewrite of forward protocol declaration.
...
llvm-svn: 44095
2007-11-14 00:42:16 +00:00
Ted Kremenek
164faf98f3
Implemented serialization of FunctionTypeNoProto.
...
llvm-svn: 44094
2007-11-14 00:38:50 +00:00
Ted Kremenek
7068cef079
Implemented serialization of VariableArrayTypes.
...
llvm-svn: 44093
2007-11-14 00:31:36 +00:00
Ted Kremenek
eef4a6296f
Implemented serialization of TypedefType.
...
llvm-svn: 44092
2007-11-14 00:27:46 +00:00
Ted Kremenek
ea27383d68
Implemented serialization of ConstantArrayType.
...
llvm-svn: 44091
2007-11-14 00:17:21 +00:00
Ted Kremenek
f35e589847
Implemented serialization of TagTypes.
...
llvm-svn: 44090
2007-11-14 00:03:56 +00:00
Ted Kremenek
919858a428
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.
llvm-svn: 44089
2007-11-14 00:03:20 +00:00
Steve Naroff
971d2f1242
Fix regression with ObjC method definitions and -ast-print
...
llvm-svn: 44088
2007-11-13 23:48:03 +00:00
Fariborz Jahanian
bc92fd7542
Type encoding for structs.
...
llvm-svn: 44087
2007-11-13 23:21:38 +00:00
Steve Naroff
7b8fa4746a
Rewrite method definition bodies. Also renamed a method to distinguish between method declarations and definitions.
...
llvm-svn: 44080
2007-11-13 23:01:27 +00:00
Ted Kremenek
204a1d3976
Removed line with typo (declared friendship with ASTContext). Line was
...
not needed since friendship is declared elsewhere.
llvm-svn: 44079
2007-11-13 22:57:59 +00:00
Ted Kremenek
767e7507c2
Added pretty-printing of statements during serialization.
...
llvm-svn: 44078
2007-11-13 22:56:10 +00:00
Ted Kremenek
049059a7db
Implemented serialization of AsmStmt (or rather what is currently implemented
...
in AsmStmt).
llvm-svn: 44077
2007-11-13 22:55:51 +00:00
Ted Kremenek
d86dcfe8ca
Fixed bug in FunctionDecl serialization where we crashed when the
...
FunctionDecl had decls for its parameters but still had greater than 0
arguments.
llvm-svn: 44076
2007-11-13 22:51:08 +00:00
Ted Kremenek
da551c3b1e
Implemented serialization for SizeOfAlignOfTypeExpr.
...
llvm-svn: 44075
2007-11-13 22:30:29 +00:00
Ted Kremenek
b8f51d5512
Implemented serialization for MemberExpr.
...
llvm-svn: 44074
2007-11-13 22:16:23 +00:00
Nate Begeman
a0f78974a6
Give AST-walk passes a way to access DeclSpec attributes on functions and
...
variables.
llvm-svn: 44073
2007-11-13 22:14:47 +00:00
Fariborz Jahanian
989e03989b
Fixed a rewrite of metadata bug when category implementation has no matching interface.
...
llvm-svn: 44072
2007-11-13 22:09:49 +00:00
Ted Kremenek
24726c3fc9
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.
llvm-svn: 44070
2007-11-13 22:02:55 +00:00
Nate Begeman
313f8ca67b
Rename Sema method to follow class naming convention
...
llvm-svn: 44069
2007-11-13 21:49:48 +00:00
Fariborz Jahanian
5633835d17
Populate metadata with adrress of method code.
...
llvm-svn: 44066
2007-11-13 21:02:00 +00:00
Chris Lattner
47791a4051
Parse "sizeof(arr)[0]" as a sizeof of an expr if arr
...
is an expression.
llvm-svn: 44065
2007-11-13 20:50:37 +00:00
Fariborz Jahanian
c54d8462fb
Rewrite of method definitions in categories.
...
llvm-svn: 44062
2007-11-13 20:04:28 +00:00
Fariborz Jahanian
98ba6cde3d
Order of methods are OK and generated .c file can be compiled.
...
llvm-svn: 44060
2007-11-13 19:21:13 +00:00
Ted Kremenek
794d8a6cde
Updated test case to flag about comparisons against constants. We may
...
invert this case (i.e., not flag a warning) in the future.
llvm-svn: 44059
2007-11-13 19:18:22 +00:00
Ted Kremenek
b83f182b59
Modified -Wfloat-equal logic to suppress warnings where floating point values
...
are compared against builtins such as __builtin_inf.
llvm-svn: 44058
2007-11-13 19:17:00 +00:00
Fariborz Jahanian
1e5f64e2ea
First patch in rewrie of method definitions. This is work in progress.
...
llvm-svn: 44055
2007-11-13 18:44:14 +00:00
Ted Kremenek
577437de8b
Updated diagnostic for -Wfloat-equal to underline the offending expressions.
...
llvm-svn: 44054
2007-11-13 18:40:33 +00:00
Ted Kremenek
2272f72723
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.
llvm-svn: 44053
2007-11-13 18:37:02 +00:00
Chris Lattner
034b49dca0
Clean up types, removing some casts. Patch contributed by
...
Cedric Venet.
llvm-svn: 44050
2007-11-13 18:16:41 +00:00
Chris Lattner
2f72c427cf
improve handling of address of global when checking for
...
constants and initializers. Patch by Sanghyeon Seo, thanks!
llvm-svn: 44049
2007-11-13 18:05:45 +00:00
Steve Naroff
b666625493
Teach Sema::CheckCompareOperands() about "void *" (C99 6.5.9p2)
...
llvm-svn: 44047
2007-11-13 14:57:38 +00:00
Steve Naroff
e50478e0b0
Tune the lookup logic in Sema::ActOnInstanceMessage() to handle private methods (declared within the implementation).
...
llvm-svn: 44041
2007-11-13 04:10:18 +00:00
Steve Naroff
9d0d4dc7bd
Minor indenting changes and removed a level of casting in getClassInterface();
...
llvm-svn: 44039
2007-11-13 01:40:57 +00:00
Fariborz Jahanian
3a9fe93286
Patch to set context (interface, category, etc.) in which method is declared.
...
llvm-svn: 44038
2007-11-13 01:10:08 +00:00
Steve Naroff
4a158f37f9
Fix Sema::CheckAssignmentConstraints() to operate on the canonical, unqualified type.
...
llvm-svn: 44036
2007-11-13 00:31:42 +00:00
Ted Kremenek
e9b83bbd68
Renamed all serialization "Materialize" methods to "Create" to conform with
...
the new serialization API.
llvm-svn: 44035
2007-11-13 00:25:37 +00:00
Ted Kremenek
cd51750512
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.
llvm-svn: 44033
2007-11-13 00:15:39 +00:00
Fariborz Jahanian
21f54eeacf
Patch to do statically typed ivar references.
...
llvm-svn: 44028
2007-11-12 22:29:28 +00:00
Steve Naroff
fedb49771d
Add category method definitions incrementally, removing a FIXME (like we do for class implementations).
...
llvm-svn: 44027
2007-11-12 22:05:31 +00:00
Fariborz Jahanian
2d0d3ba43e
Minor twik for when there is no super class and 'super' is errornously used.
...
llvm-svn: 44026
2007-11-12 20:20:37 +00:00
Fariborz Jahanian
d98a734bd6
'super' nailed.
...
llvm-svn: 44025
2007-11-12 20:13:27 +00:00
Steve Naroff
040f696bfc
Fix regression to Sema::ObjcActOnStartOfMethodDef()...need to initialize InvalidType field to false.
...
llvm-svn: 44023
2007-11-12 19:48:27 +00:00
Steve Naroff
cd002f5a0e
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().
llvm-svn: 44022
2007-11-12 19:18:37 +00:00
Ted Kremenek
0035bf33c4
In Stmt serialization, renamed directEmit to EmitImpl and
...
directMaterialize to CreateImpl.
llvm-svn: 44020
2007-11-12 18:04:32 +00:00
Steve Naroff
b342361c0d
Now that we can refer to instance variables, make sure they are considered lvalues.
...
llvm-svn: 44017
2007-11-12 14:34:27 +00:00
Steve Naroff
e46504b278
Implement instance variable references.
...
llvm-svn: 44016
2007-11-12 14:29:37 +00:00
Steve Naroff
e3d1ab29da
- 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:-)
llvm-svn: 44015
2007-11-12 13:56:41 +00:00
Steve Naroff
8e5c112add
Forgot this file from my last commit...
...
llvm-svn: 44009
2007-11-12 05:02:46 +00:00
Steve Naroff
ff4dbff4f4
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().
llvm-svn: 44008
2007-11-12 04:59:00 +00:00
Steve Naroff
3434bebec9
Make sure @property is allowed within a category.
...
Bug submitted by Keith Bauer.
CookieJar:Desktop keith$ cat test.m
#import <WebKit/WebKit.h>
llvm-svn: 44007
2007-11-12 04:22:52 +00:00
Steve Naroff
d0bf516e70
Remove Sema::ObjcBuildMethodParameter().
...
Modify Sema::ParseParamDeclarator() to work for both ActOnStartOfFunctionDef() and ObjcActOnStartOfMethodDef().
llvm-svn: 44006
2007-11-12 03:44:46 +00:00
Steve Naroff
b313fc3203
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.
...
llvm-svn: 44000
2007-11-11 23:20:51 +00:00
Steve Naroff
bb87572d70
Replace 3 method definition functions (ObjcParseMethodDefinition, ParseObjCInstanceMethodDefinition, ParseObjCClassMethodDefinition) with 1 method definition function (ParseObjCMethodDefinition).
...
Less code/confusion.
llvm-svn: 43999
2007-11-11 19:54:21 +00:00
Steve Naroff
49effdefef
Tweak Sema::ActOnInstanceMessage() to treat the built-in "Class" type the same as "id".
...
llvm-svn: 43996
2007-11-11 17:52:25 +00:00
Steve Naroff
cac26f4f5f
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.
llvm-svn: 43995
2007-11-11 17:19:15 +00:00
Steve Naroff
5f9ae64f6e
Make sure Sema::CheckIncrementDecrementOperand() removes typedefs when doing it's analysis.
...
Thanks to Seo Sanghyeon for his excellent (first) bug fix!
llvm-svn: 43994
2007-11-11 14:15:57 +00:00
Steve Naroff
22e078e013
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...
llvm-svn: 43989
2007-11-11 00:10:47 +00:00
Fariborz Jahanian
0bd56b7727
Fixed a bug which exposed the internally built type to user code.
...
llvm-svn: 43987
2007-11-10 22:00:55 +00:00
Fariborz Jahanian
16e3123071
pretty priting for method definitions.
...
llvm-svn: 43986
2007-11-10 20:59:13 +00:00
Steve Naroff
257b4a2467
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
llvm-svn: 43985
2007-11-10 19:45:54 +00:00
Steve Naroff
68754c59bc
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).
...
llvm-svn: 43981
2007-11-10 18:06:36 +00:00
Fariborz Jahanian
6aafd4130b
Minor code clean up in method def area.
...
llvm-svn: 43980
2007-11-10 17:40:57 +00:00
Fariborz Jahanian
85e1d0d807
Represent method definitions as separate AST nodes. Pretty print will come next.
...
llvm-svn: 43979
2007-11-10 16:31:34 +00:00
Ted Kremenek
739156ab7c
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.
llvm-svn: 43975
2007-11-10 02:11:55 +00:00
Ted Kremenek
11d700bfba
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.
llvm-svn: 43974
2007-11-10 02:07:12 +00:00
Chris Lattner
ef067a2828
rename getInstantiationLoc to match the scheme of isPhysicalLoc.
...
llvm-svn: 43969
2007-11-09 23:59:17 +00:00
Chris Lattner
198b3e085d
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.
llvm-svn: 43968
2007-11-09 23:52:16 +00:00
Fariborz Jahanian
7a017215eb
Some code clean up in the form of name changes for functions which
...
process method definitions.
llvm-svn: 43967
2007-11-09 22:27:59 +00:00
Hartmut Kaiser
03f4d47254
Updated VC++ build system
...
llvm-svn: 43958
2007-11-09 19:53:21 +00:00
Fariborz Jahanian
b5605179c4
Added class context to method declarations. Provide "interface *" type
...
to 'self' method of instance methods.
llvm-svn: 43957
2007-11-09 19:52:12 +00:00
Fariborz Jahanian
19d4dbd217
Insert invisble arguments to method definition header.
...
llvm-svn: 43948
2007-11-09 17:18:29 +00:00
Steve Naroff
2011338446
Rewrite global variable initializers.
...
llvm-svn: 43947
2007-11-09 15:20:18 +00:00
Steve Naroff
8570fdec1a
Recognize ObjCStringLiteral as a constant expression.
...
llvm-svn: 43946
2007-11-09 15:00:03 +00:00
Steve Naroff
1b232132ad
- add typedef guards.
...
- tweak scanForProtocolRefs heuristic.
- disable RewriteInclude() for now.
llvm-svn: 43942
2007-11-09 12:50:28 +00:00
Ted Kremenek
908f96a2cf
Changed method call to reflect updated serialization API.
...
llvm-svn: 43917
2007-11-09 00:43:55 +00:00
Fariborz Jahanian
56ff146ec4
First patch toward rewriting of method definitions. This is work in progress.
...
llvm-svn: 43915
2007-11-08 23:49:49 +00:00
Chris Lattner
f546408406
remove some temporary code.
...
llvm-svn: 43906
2007-11-08 20:53:07 +00:00
Chris Lattner
b74f6e82e4
add a getAtOffset() member to simplify some code.
...
llvm-svn: 43905
2007-11-08 20:51:02 +00:00
Ted Kremenek
da4c6c183d
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.
llvm-svn: 43904
2007-11-08 19:52:41 +00:00
Chris Lattner
34660fb75a
add a fixme.
...
llvm-svn: 43902
2007-11-08 19:40:23 +00:00
Chris Lattner
bedd411589
significantly simplify the implementation of RewriteRope by changing the
...
implementation to be list<RopePiece> instead of vector<RopePiece*>.
llvm-svn: 43901
2007-11-08 19:39:57 +00:00
Fariborz Jahanian
8e632940fc
Refactored parsing of main function body for reuse by objective-c methods.
...
llvm-svn: 43898
2007-11-08 19:01:26 +00:00
Chris Lattner
3eb670721f
improve MakeRopeString to avoid doing a malloc for every 2-character string
...
that gets inserted. This speeds up the rewriter another 10%.
llvm-svn: 43896
2007-11-08 18:32:01 +00:00
Chris Lattner
9a00d3ec90
Simplify interface to MakeRopeString.
...
llvm-svn: 43895
2007-11-08 17:59:48 +00:00
Chris Lattner
3a21bd50e7
Fix backwards assert.
...
llvm-svn: 43894
2007-11-08 17:56:40 +00:00
Ted Kremenek
f2d68452c6
Implemented serialization of AddrLabelExpr.
...
Implemented serialization of ConditionalOperator.
Implemented serialization of StmtExpr.
Fixed bug in serialization of IndirectGoto (did not properly serialize subexpression).
llvm-svn: 43891
2007-11-08 16:32:00 +00:00
Steve Naroff
265a6b9693
Rewrite RewriteObjCStringLiteral(). This version is simpler (and unlike the previous one, works:-)
...
llvm-svn: 43890
2007-11-08 14:30:50 +00:00
Chris Lattner
e90ce8def3
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.
llvm-svn: 43884
2007-11-08 07:35:14 +00:00
Chris Lattner
7a7da75916
abstract out buffer type a bit better
...
llvm-svn: 43883
2007-11-08 05:42:25 +00:00
Chris Lattner
dc0cfc9fe3
use insert instead of replacing 0 bytes with text :)
...
llvm-svn: 43882
2007-11-08 04:41:51 +00:00
Chris Lattner
edebdb5b29
minor cleanups
...
llvm-svn: 43881
2007-11-08 04:41:04 +00:00
Chris Lattner
9fd5890e52
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.
llvm-svn: 43880
2007-11-08 04:27:23 +00:00
Chris Lattner
4573cc708a
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.
llvm-svn: 43879
2007-11-08 04:09:59 +00:00
Ted Kremenek
a34b057762
Revised serialization of CaseStmt to emit all of the owned pointers (its
...
subexpressions) all together in one block at the end.
llvm-svn: 43862
2007-11-08 00:56:26 +00:00
Ted Kremenek
c1cddef7c9
Implemented serialization of CompoundAssignOperator.
...
llvm-svn: 43860
2007-11-08 00:41:37 +00:00
Devang Patel
ec51171319
Add assert for the case that is not handled.
...
struct { char a; short b:2; };
llvm-svn: 43859
2007-11-08 00:32:12 +00:00
Ted Kremenek
2419ac8792
Implemented serialization of UnaryOperator.
...
llvm-svn: 43858
2007-11-08 00:26:24 +00:00
Devang Patel
7c7a07d949
Keep track of beginning offset for the bit field that does not start at byte boundry.
...
llvm-svn: 43857
2007-11-08 00:17:59 +00:00
Ted Kremenek
766fc8c14a
Implemented serialization of CallExpr.
...
llvm-svn: 43854
2007-11-07 23:32:20 +00:00
Ted Kremenek
2c325386b8
Implemented serialization of ArraySubscriptExpr.
...
Added "using ..." for "Serializer" and "Deserializer" to reduce amount
of typing for serialization methods.
llvm-svn: 43849
2007-11-07 22:53:01 +00:00
Ted Kremenek
e87ceeeb4a
Implemented serialization of CastExpr.
...
llvm-svn: 43848
2007-11-07 22:42:34 +00:00
Ted Kremenek
b2b5e73f89
Implemented serialization of ImplicitCastExpr.
...
llvm-svn: 43847
2007-11-07 22:39:17 +00:00
Ted Kremenek
9d2bf704de
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.
llvm-svn: 43846
2007-11-07 22:32:23 +00:00
Devang Patel
ef2d838fef
Stay within 80 columns.
...
llvm-svn: 43843
2007-11-07 21:04:59 +00:00
Hartmut Kaiser
abcbb0493a
Updated VC++ build system
...
llvm-svn: 43838
2007-11-07 19:34:40 +00:00
Ted Kremenek
d68db575f3
Implemented serialization of StringLiteral.
...
llvm-svn: 43834
2007-11-07 19:08:19 +00:00
Ted Kremenek
f9062be688
Implemented serialization of ImaginaryLiteral.
...
llvm-svn: 43833
2007-11-07 18:53:02 +00:00
Ted Kremenek
569725f827
Implemented serialization of FloatingLiteral.
...
llvm-svn: 43832
2007-11-07 18:45:55 +00:00
Steve Naroff
1601858de5
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.
llvm-svn: 43831
2007-11-07 18:43:40 +00:00
Fariborz Jahanian
1299a92327
Emit objective-c's meta-data at the end of rewriting to stdout.
...
llvm-svn: 43830
2007-11-07 18:40:28 +00:00
Steve Naroff
b7a032eb20
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.
...
llvm-svn: 43827
2007-11-07 18:07:59 +00:00
Fariborz Jahanian
8a348705a8
Fixed an array overflow bug.
...
llvm-svn: 43826
2007-11-07 17:43:16 +00:00
Fariborz Jahanian
e044087b56
Fixed typo.
...
llvm-svn: 43825
2007-11-07 17:29:15 +00:00
Ted Kremenek
c874c6a959
Implemented serialization of CharacterLiteral.
...
llvm-svn: 43824
2007-11-07 17:15:49 +00:00
Ted Kremenek
3c58662411
Implemented serialiation of PreDefinedExpr.
...
llvm-svn: 43823
2007-11-07 17:11:58 +00:00
Ted Kremenek
d47c8125a1
Implemented serialization of ContinueStmt.
...
llvm-svn: 43822
2007-11-07 17:05:07 +00:00
Ted Kremenek
3b4c08deae
Implemented serialization of IndirectGotoStmt.
...
Added "FIXME" regarding the lack of source location information for IndirectGotoStmt.
llvm-svn: 43821
2007-11-07 17:02:32 +00:00
Steve Naroff
a733c7ffe4
Implement rewrite for @throw.
...
llvm-svn: 43820
2007-11-07 15:32:26 +00:00
Ted Kremenek
5fd3040c57
Implemented serialization of GotoStmt.
...
llvm-svn: 43818
2007-11-07 08:07:46 +00:00
Ted Kremenek
35e20410aa
Implemented serialization for ForStmt.
...
llvm-svn: 43817
2007-11-07 08:02:55 +00:00
Ted Kremenek
83e96b8d5a
Implemented serialization of DoStmt.
...
llvm-svn: 43816
2007-11-07 07:53:55 +00:00
Ted Kremenek
f6d8ce1052
Implemented serialization for WhileStmt.
...
llvm-svn: 43815
2007-11-07 07:50:10 +00:00
Ted Kremenek
154c790538
Implemented serialization of IfStmt.
...
Fixed declarations of several "directEmit" methods of classes that subclass
Stmt that were missing a "virtual" keyword.
llvm-svn: 43814
2007-11-07 07:19:30 +00:00
Steve Naroff
4d7b367652
Teach ASTContext::tagTypesAreCompatible() about the built-in ObjC types (Class and id), removing a bogus warning.
...
llvm-svn: 43809
2007-11-07 06:03:51 +00:00
Ted Kremenek
acb9bcf22a
Implemented serialization of SwitchStmt, CaseStmt, BreakStmt, DefaultStmt,
...
and ParenExpr.
llvm-svn: 43806
2007-11-07 05:25:31 +00:00
Steve Naroff
bf478ece48
Rewrite ObjC @try/@catch/@finally. Some minor tweaks to the AST nodes...
...
Still need to rewrite @throw (and do more testing)...
llvm-svn: 43803
2007-11-07 04:08:17 +00:00
Fariborz Jahanian
adfbbc3330
AST for objective-c's @throw statement and its pretty-printing.
...
llvm-svn: 43802
2007-11-07 02:00:49 +00:00
Devang Patel
b1ecfc6e25
Start struct bit field laout work.
...
This is far from complete.
llvm-svn: 43801
2007-11-07 01:57:13 +00:00
Ted Kremenek
a8cdf31aa0
Implemented serialization of LabelStmts.
...
llvm-svn: 43800
2007-11-07 00:48:04 +00:00
Fariborz Jahanian
defbf9a86c
Fixed a pretty-printer bug whereby a @try statement with no @finally seg faulted.
...
llvm-svn: 43798
2007-11-07 00:46:42 +00:00
Ted Kremenek
ad1bc400d7
Added serialization/deserialization of NullStmts.
...
llvm-svn: 43797
2007-11-07 00:40:53 +00:00
Ted Kremenek
80fe8904e1
Added serialization/deserialization of DeclStmts.
...
Reordered stmt serialization method implementations to be in alphabetical order.
llvm-svn: 43796
2007-11-07 00:37:40 +00:00
Ted Kremenek
148aa5edbc
Overhauled serialization of statements. We no longer use specialized SerializeTrait<> classes,
...
but methods in Stmt (like other objects we are serializing). Full serialization of all statements
is not yet complete.
llvm-svn: 43793
2007-11-07 00:17:35 +00:00
Ted Kremenek
abcfe90802
Added static inline method "ReadVal" to QualType for more succinct
...
deserialization code of objects containing QualTypes.
llvm-svn: 43792
2007-11-07 00:13:45 +00:00
Fariborz Jahanian
e8a3016ac7
Rewrite for properties.
...
llvm-svn: 43791
2007-11-07 00:09:37 +00:00
Ted Kremenek
fa2bf434cc
Fixed typo in the name of "ReadPreamble".
...
llvm-svn: 43790
2007-11-06 23:52:19 +00:00
Fariborz Jahanian
bcce2f8d54
Fix an inverted conditional,
...
--chris
llvm-svn: 43789
2007-11-06 23:06:16 +00:00
Ted Kremenek
453ab7d126
Started work on new serialization approach within ASTContext to
...
serialize Type objects in the order they are serialized in the Types
vector. We also now rely on the methods within ASTContext to unique
Type objects and handle the actual creation of Type objects (these are
now called by the deserialization code). This approach solves some
hairy issues with ownership of objects and allows us to naturally
handle recursive types.
llvm-svn: 43787
2007-11-06 22:26:16 +00:00
Ted Kremenek
7c91ccae88
QualType deserialization now requires that the underlying pointer type
...
must be deserialized without requiring backpatching.
llvm-svn: 43786
2007-11-06 22:23:53 +00:00
Ted Kremenek
93d446f535
Bug fix: inverted test condition to see if a serialized AST-bitcode
...
file had the correct preamble.
llvm-svn: 43785
2007-11-06 22:23:03 +00:00
Fariborz Jahanian
f76f2b0c1c
Patch for objc2's property ASTs, as well as pretty-priting the ASTs.
...
llvm-svn: 43778
2007-11-06 22:01:00 +00:00
Ted Kremenek
77068e17d4
Misc. serialization changes to ASTContext and Decls. Serialization
...
for ASTContext is still rapidly evolving.
llvm-svn: 43774
2007-11-06 19:51:47 +00:00
Ted Kremenek
3a68de993a
Revampled Serialization Tester to serialize and deserialize out an entire ASTContext and top-level decls.
...
llvm-svn: 43773
2007-11-06 19:50:53 +00:00
Steve Naroff
2d8aaa7d74
Fix a "basic" bug that resulted in a bogus SourceLocation.
...
Off hand, I don't know why this change makes a difference (I thought the two constructor idioms were equivalent).
llvm-svn: 43770
2007-11-06 19:37:09 +00:00
Chris Lattner
45d561ad99
improve decl merging logic to be more correct with
...
functions. Patch contributed by Nuno Lopes, thanks!
llvm-svn: 43757
2007-11-06 06:07:26 +00:00
Chris Lattner
3209725c68
Add better validation for array types when merging decls. Patch
...
contributed by Oliver Hunt, thanks!
llvm-svn: 43750
2007-11-06 04:28:31 +00:00
Ted Kremenek
f7f7ddfd7e
Added registration to deserialization engine of IdentifierInfo* as
...
IdentifierInfos are deserialized.
llvm-svn: 43741
2007-11-05 22:42:32 +00:00
Ted Kremenek
72f073acd4
Implemented serialization of TypedefDecls.
...
Fixed infinite recursion in VarDecl::InternalRead.
llvm-svn: 43739
2007-11-05 21:49:34 +00:00
Ted Kremenek
15f50ba755
In driver code implemented serialization of ASTContext. Working on serialization of simple ASTs.
...
llvm-svn: 43738
2007-11-05 21:39:35 +00:00
Ted Kremenek
7f6e70c5c2
Added skeleton for dispatch of Decl serialization.
...
llvm-svn: 43737
2007-11-05 21:38:00 +00:00
Ted Kremenek
58473ab478
For serialization of ASTContext, added special-casing of serialization
...
of type sets when emitting complex types and pointer types that are
also considered builtins. These types are automatically created in
the ctor of ASTContext, and thus should not be serialized (was
producing an error during deserialization).
llvm-svn: 43733
2007-11-05 20:49:23 +00:00
Fariborz Jahanian
63ac80e76a
Misc. fixes. 1) Resurrect meta-data generation turned off by a previous patch.
...
2) Fixed a regression in meta-data generation caused by removal of '_interface' prefix from synthesize class name.
3) Added stubs for @try/@catch/@finally statements.
llvm-svn: 43716
2007-11-05 17:47:33 +00:00
Ted Kremenek
a6d9f3c2cf
Made methods "Emit" and "Materialize" in ASTContext (used for serialization) public.
...
llvm-svn: 43713
2007-11-05 17:41:25 +00:00
Ted Kremenek
31b789c0d8
Added TypeSerialization.cpp and DeclSerialization.cpp to the XCode project.
...
llvm-svn: 43710
2007-11-05 17:04:40 +00:00
Steve Naroff
96d20616c4
Sema::ActOnClassMessage()...if a class method isn't found, lookup an instance method. Since all classes are also instances, this is appropriate.
...
llvm-svn: 43708
2007-11-05 15:27:52 +00:00
Steve Naroff
bd72289baa
Declare objc_selector outside the prototype for objc_msgSend(), removing a silly warning.
...
llvm-svn: 43706
2007-11-05 14:55:35 +00:00
Steve Naroff
e4f9b23458
Rewrite @selector(sel).
...
llvm-svn: 43705
2007-11-05 14:50:49 +00:00
Steve Naroff
98eb8d1275
- change the synthesized typedef (for classes) to be of type "objc_object".
...
- fix a couple bugs in RewriteObjCStringLiteral.
- convert "Class" -> "id" in RewriteMessageExpr.
llvm-svn: 43704
2007-11-05 14:36:37 +00:00
Steve Naroff
3865e4d8b4
Remove HandleObjcMetaDataEmission(), I inadvertantly resurrected it.
...
llvm-svn: 43690
2007-11-05 00:25:00 +00:00
Steve Naroff
f36987c79b
Two additions...
...
- Synthesize the funky cast for objc_msgSend(). For the basic case, it looks like...
((id (*)(id, SEL))(void *)objc_msgSend)(obj, sel);
The "void *" cast is needed to workaround a GCC "bandaid" (Chris says it has something to do with the inliner). Without the extra "void *" cast, we get spurious warnings/notes that look like...
xx.m:17: warning: function called through a non-compatible type
xx.m:17: note: if this code is reached, the program will abort
- Add prototypes for the ObjC functions we call, objc_msgSend/objc_getClass for now (don't depend on them being included).
llvm-svn: 43685
2007-11-04 22:37:50 +00:00
Steve Naroff
66697aa72f
Add a method prototype slot/getter to the ObjCMessageExpr AST.
...
llvm-svn: 43666
2007-11-03 16:37:59 +00:00
Steve Naroff
a397efd915
Implement rewrite rules for ObjC string constants.
...
llvm-svn: 43665
2007-11-03 11:27:19 +00:00
Chris Lattner
376cdaf50b
Fix ownership model of ParseAST to allow the dtor of
...
ASTConsumer to process the AST before it is destroyed.
This allows elimination of HandleObjcMetaDataEmission.
llvm-svn: 43659
2007-11-03 06:24:16 +00:00
Fariborz Jahanian
9ffbd2d648
Provide both const and non-const accessor methods for @try and @finally ASTs.
...
My previous patch did the same for @catch AST.
llvm-svn: 43654
2007-11-03 00:38:38 +00:00
Fariborz Jahanian
e21451fc0d
Provide const and none-const version of methods accessing various @catch nodes
...
llvm-svn: 43653
2007-11-03 00:34:02 +00:00
Fariborz Jahanian
8815795049
pretty-print @try/@catch/@finally from AST as the validation of AST.
...
llvm-svn: 43649
2007-11-02 18:16:07 +00:00
Ted Kremenek
dda9a56975
Added most of the boilerplate code for Decl serialization. Still a few
...
key functions to implement.
llvm-svn: 43648
2007-11-02 18:05:11 +00:00
Chris Lattner
0b271eb7af
Expose InsertText, fixing an oversight.
...
llvm-svn: 43643
2007-11-02 17:26:47 +00:00
Anders Carlsson
bfd60eedd7
Generate code for member exprs.
...
llvm-svn: 43641
2007-11-02 16:59:10 +00:00
Fariborz Jahanian
f859ef293c
AST for @try statement.
...
llvm-svn: 43640
2007-11-02 15:39:31 +00:00
Hartmut Kaiser
4a7d2d65e3
Updated VC++ build system
...
llvm-svn: 43632
2007-11-02 01:44:32 +00:00
Fariborz Jahanian
71234d8a9e
AST for @finally statement.
...
llvm-svn: 43629
2007-11-02 00:18:53 +00:00
Fariborz Jahanian
9e63b98de7
AST build for @catch clause (this is work in progress).
...
llvm-svn: 43628
2007-11-01 23:59:59 +00:00
Ted Kremenek
5e2eb261af
Simplified Serialization code for SourceLocation and SourceRange, and
...
updated it to the recently updated Serialization API.
Changed clients of SourceLocation serialization to call the
appropriate new methods.
Updated Decl serialization code to put new skeleton serialization code
in place that is much better than the older trait-specialization
approach.
llvm-svn: 43625
2007-11-01 22:25:41 +00:00
Fariborz Jahanian
65590b2504
Bunch of class declarations for objective-c's @try-catch statement.
...
llvm-svn: 43623
2007-11-01 21:12:44 +00:00
Devang Patel
e11664a0ef
Rename classes and collections that maintain record layout information.
...
Now, at AST level record info is maintained by ASTRecordLayout class.
Now, at code gen level record info is maintained by CGRecordLayout class.
llvm-svn: 43619
2007-11-01 19:11:01 +00:00
Ted Kremenek
26a7f3fd56
Implemented serialization of QualTypes within ASTContext. Clarified
...
ownership model of some type pointers. Added FIXMEs to serialization.
Added comments to ASTContext indicating which variables we are intentionally
*not* serializing.
llvm-svn: 43618
2007-11-01 18:11:32 +00:00
Fariborz Jahanian
ac73ff8868
Remaining work to collect objective-c's type qualifiers and use them to encode
...
method types.
llvm-svn: 43617
2007-11-01 17:18:37 +00:00
Steve Naroff
63006473d5
- Remove _interface_ prefix for the synthesized tag names.
...
- Also removed a tab from the generated struct (minor).
llvm-svn: 43616
2007-11-01 17:12:31 +00:00
Ted Kremenek
53155f379e
Changed serialization/deserialization of BuiltinTypes to explicitly serialize
...
each type. This ensures that the order in which the types are serialized
is clear and remains persistent.
llvm-svn: 43615
2007-11-01 17:10:34 +00:00