]>
granicus.if.org Git - clang/log
Devang Patel [Fri, 26 Oct 2007 17:44:44 +0000 (17:44 +0000)]
Codegen array initializers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43385
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Fri, 26 Oct 2007 16:31:40 +0000 (16:31 +0000)]
Codegen global array initializers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43383
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 26 Oct 2007 16:29:12 +0000 (16:29 +0000)]
Pretty printing for ivar list of an interface block.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43382
91177308 -0d34-0410-b5e6-
96231b3b80d8
Hartmut Kaiser [Thu, 25 Oct 2007 22:59:17 +0000 (22:59 +0000)]
Disambiguated variable name to comply with VC++'s archaic variable scoping rules.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43371
91177308 -0d34-0410-b5e6-
96231b3b80d8
Hartmut Kaiser [Thu, 25 Oct 2007 22:58:31 +0000 (22:58 +0000)]
Updated VC++ build system
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43370
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 25 Oct 2007 22:24:19 +0000 (22:24 +0000)]
Modified StmtIterator to now include visiting the initialization expression for EnumConstantDecls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43366
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Thu, 25 Oct 2007 22:19:13 +0000 (22:19 +0000)]
Fix "strbuf += stufflen;" crash.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43365
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Thu, 25 Oct 2007 21:40:12 +0000 (21:40 +0000)]
Document ConvertNewType() method and make it a private method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43363
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 25 Oct 2007 21:39:10 +0000 (21:39 +0000)]
Added DeclSerialization.cpp to XCode project.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43362
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 25 Oct 2007 21:37:16 +0000 (21:37 +0000)]
Added skeleton for Decl serialization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43361
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Thu, 25 Oct 2007 20:55:25 +0000 (20:55 +0000)]
Refactored several meta data for reusability.
Changed the entire rewrite of metadata to write to std::string
object instead of stdout.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43360
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Thu, 25 Oct 2007 18:32:36 +0000 (18:32 +0000)]
Cache llvm::Type through PATypeHolder.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43355
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 25 Oct 2007 18:27:10 +0000 (18:27 +0000)]
changed #include of Serialization.h to SerializationFwd.h to reduce
compilation time.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43354
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 25 Oct 2007 17:27:01 +0000 (17:27 +0000)]
Fix a recovery bug Fariborz and I noticed yesterday. We were producing:
method.c:4:3: error: use of undeclared identifier 'BADIDENT'
&BADIDENT, 0
^
method.c:5:2: error: expected '}'
};
^
method.c:3:14: error: to match this '{'
struct S A = {
^
now we only produce:
method.c:4:3: error: use of undeclared identifier 'BADIDENT'
&BADIDENT, 0
^
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43349
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 25 Oct 2007 17:18:59 +0000 (17:18 +0000)]
simplify change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43348
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 25 Oct 2007 17:17:34 +0000 (17:17 +0000)]
Fix a bug steve noticed when handling nested rewrites. We now turn this:
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
into:
NSAutoreleasePool * pool = objc_msgSend(objc_msgSend(objc_getClass("NSAutoreleasePool"), sel_getUid("alloc")), sel_getUid("init"));
instead of:
NSAutoreleasePool * pool = objc_msgSend(objc_msgSend(objc_getClass("NSAutoreleasePool"), sel_getUid("alloc")), sel_getUid("init"))utoreleasePool"), sel_getUid("alloc")) init];
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43347
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 25 Oct 2007 17:07:24 +0000 (17:07 +0000)]
Convert one type of metadata to use std::string instead of
printf as an example.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43346
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 25 Oct 2007 16:03:53 +0000 (16:03 +0000)]
Added SourceLocation.cpp to XCode project.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43344
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 25 Oct 2007 16:02:43 +0000 (16:02 +0000)]
Implemented serialization of SourceLocation and SourceRange objects.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43343
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 25 Oct 2007 15:39:09 +0000 (15:39 +0000)]
Added constness to accessors in CompoundStmt.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43342
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 25 Oct 2007 00:29:32 +0000 (00:29 +0000)]
Add a new ChooseExpr::isConditionTrue method to unify
some code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43322
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Thu, 25 Oct 2007 00:14:44 +0000 (00:14 +0000)]
Refactored RewriteObjcMethodsMetaData to better rewrite
instance/class methods metadata.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43320
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 25 Oct 2007 00:08:50 +0000 (00:08 +0000)]
Added accessors to CompoundStmt to retrieve the source locations for the
left and right bracket. This is useful for serialization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43318
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Wed, 24 Oct 2007 23:42:18 +0000 (23:42 +0000)]
Remove unused #includes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43317
91177308 -0d34-0410-b5e6-
96231b3b80d8
Steve Naroff [Wed, 24 Oct 2007 22:48:43 +0000 (22:48 +0000)]
More work on translating message expressions.
Still to do:
- Chris will fix a bug in the rewriting engine for nested stmts. For example, the following:
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
tranlates to:
NSAutoreleasePool * pool = objc_msgSend(objc_msgSend(objc_getClass("NSAutoreleasePool"), sel_getUid("alloc")), sel_getUid("init"))utoreleasePool"), sel_getUid("alloc")) init];
...which is correct, except there is garbage after sel_getUid("init"). This is because the rewriter isn't updating the extent of the containing message expression.
- Do the crazy cast thang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43316
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Wed, 24 Oct 2007 22:26:28 +0000 (22:26 +0000)]
Handle
foo()->a = 42;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43315
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 24 Oct 2007 21:25:12 +0000 (21:25 +0000)]
Remove explicit use of size of known structs in metadata generation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43313
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 24 Oct 2007 20:54:23 +0000 (20:54 +0000)]
Couple of minor changes. 1) Metaclass metadata also has a reference to
protocol meta-data (unlike what documentation says). 2) Include objc.h so,
we can compile the generated metadata with both gcc and clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43311
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Wed, 24 Oct 2007 20:38:06 +0000 (20:38 +0000)]
Move RecordOrganizer into CodeGenTypes.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43310
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 24 Oct 2007 19:23:36 +0000 (19:23 +0000)]
Refactord instance and class metadata emission. Refactored protocols metadata emission.
Implemented emission of category metadata,
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43308
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 24 Oct 2007 19:06:02 +0000 (19:06 +0000)]
Modified current clients of Bitcode-Object serialization to use the
new split-header file configuration (Serialize.h and Deserialize.h)
now in place in the core LLVM repository.
Removed unneeded SerializeTrait specializations for enums in
TokenKinds.h
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43306
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Wed, 24 Oct 2007 18:05:48 +0000 (18:05 +0000)]
Handle non-constant initializers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43301
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Wed, 24 Oct 2007 17:18:43 +0000 (17:18 +0000)]
Visit CompoundLiteralExpr and InitListExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43300
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 24 Oct 2007 17:06:59 +0000 (17:06 +0000)]
Fix some long lines, move code around into logical groups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43299
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 24 Oct 2007 16:57:36 +0000 (16:57 +0000)]
Use Ted's new mutable child iterators to update the tree as we rewrite it.
This will make nested subexprs work.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43296
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 24 Oct 2007 16:52:34 +0000 (16:52 +0000)]
Modified operator* for StmtIterator to return Stmt*& instead of Stmt*.
This permits in-place replacement of the original AST statements.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43295
91177308 -0d34-0410-b5e6-
96231b3b80d8
Steve Naroff [Wed, 24 Oct 2007 01:09:48 +0000 (01:09 +0000)]
Incorporate some feedback from Chris...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43285
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Wed, 24 Oct 2007 00:56:23 +0000 (00:56 +0000)]
Constify methods and reuse RecordOrganizer object.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43284
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Wed, 24 Oct 2007 00:54:17 +0000 (00:54 +0000)]
check base type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43283
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Wed, 24 Oct 2007 00:32:16 +0000 (00:32 +0000)]
Add notes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43282
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Wed, 24 Oct 2007 00:28:49 +0000 (00:28 +0000)]
Use isUnionType() predicate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43281
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Wed, 24 Oct 2007 00:26:24 +0000 (00:26 +0000)]
untabify
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43280
91177308 -0d34-0410-b5e6-
96231b3b80d8
Hartmut Kaiser [Wed, 24 Oct 2007 00:07:36 +0000 (00:07 +0000)]
Fixed a strange construct, please review.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43278
91177308 -0d34-0410-b5e6-
96231b3b80d8
Hartmut Kaiser [Wed, 24 Oct 2007 00:06:59 +0000 (00:06 +0000)]
Silenced a VC++ warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43277
91177308 -0d34-0410-b5e6-
96231b3b80d8
Steve Naroff [Tue, 23 Oct 2007 23:50:29 +0000 (23:50 +0000)]
Add some plumbing to rewrite message expressions (still under construction).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43274
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Tue, 23 Oct 2007 23:29:51 +0000 (23:29 +0000)]
Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43269
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Tue, 23 Oct 2007 23:26:46 +0000 (23:26 +0000)]
Handle nested structs.
typdef struct A { int i; struct A *next; } A
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43268
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 23 Oct 2007 22:18:37 +0000 (22:18 +0000)]
Implemented serialization for IdentifierInfo and IdentifierTable.
Updated serialization test code in the driver to test serialization of
these types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43266
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Tue, 23 Oct 2007 20:28:39 +0000 (20:28 +0000)]
Handle simple struct member expr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43258
91177308 -0d34-0410-b5e6-
96231b3b80d8
Steve Naroff [Tue, 23 Oct 2007 20:20:08 +0000 (20:20 +0000)]
- Add rewrite rule for @class.
- Add setter/getter to ObjcClassDecl.
- Predefined key runtime functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43257
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 23 Oct 2007 18:53:48 +0000 (18:53 +0000)]
Patch to complete metadata generation for each implemented class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43255
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Tue, 23 Oct 2007 02:10:49 +0000 (02:10 +0000)]
Begin struct layout work.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43236
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 23 Oct 2007 00:02:02 +0000 (00:02 +0000)]
Patch for initialization of class's Meta-class metadata.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43235
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 22 Oct 2007 21:41:37 +0000 (21:41 +0000)]
This patch generates protocol metadata and all its sub-metadata.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43233
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 19 Oct 2007 20:10:30 +0000 (20:10 +0000)]
Fix a crash on test/Sema/invalid-decl.c
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43188
91177308 -0d34-0410-b5e6-
96231b3b80d8
Hartmut Kaiser [Fri, 19 Oct 2007 15:50:35 +0000 (15:50 +0000)]
Silenced a VC++ warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43179
91177308 -0d34-0410-b5e6-
96231b3b80d8
Gabor Greif [Fri, 19 Oct 2007 15:38:32 +0000 (15:38 +0000)]
add NL at end of file
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43178
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 19 Oct 2007 00:36:46 +0000 (00:36 +0000)]
rewrite of metadata for implemented instance methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43159
91177308 -0d34-0410-b5e6-
96231b3b80d8
Steve Naroff [Fri, 19 Oct 2007 00:05:15 +0000 (00:05 +0000)]
Include a simple test case for the previous commit...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43158
91177308 -0d34-0410-b5e6-
96231b3b80d8
Steve Naroff [Thu, 18 Oct 2007 23:53:51 +0000 (23:53 +0000)]
Fix the previous (short lived:-) FIXME.
I didn't realize that GCC considers this a hard error (I thought it was built-in).
Since it's not, we should simply emit an error.
[dylan:~/llvm/tools/clang] admin% cc -c trivial.m
trivial.m:6: error: cannot find interface declaration for 'NSConstantString'
[administrators-powerbook59:~/llvm/tools/clang] admin% ../../Debug/bin/clang trivial.m
trivial.m:6:16: error: cannot find interface declaration for 'NSConstantString'
NSString *s = @"123";
^
1 diagnostic generated.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43157
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 18 Oct 2007 23:28:49 +0000 (23:28 +0000)]
Fixed DeclStmt::child_begin() to actually create an iterator that
visits its decls, rather than just creating an "end()" iterator.
Fixed child_end() for statements and expressions to use
child_iterator() to create the end() iterator, rather than just
returning NULL.
Fixed bug in StmtIterator where we did not correctly detect if we had
marched off the end of the ScopedDecls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43156
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Thu, 18 Oct 2007 22:59:23 +0000 (22:59 +0000)]
Check for Nullness of value built in GetObjcProtoType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43155
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 18 Oct 2007 22:50:52 +0000 (22:50 +0000)]
Minor grammar fix.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43154
91177308 -0d34-0410-b5e6-
96231b3b80d8
Steve Naroff [Thu, 18 Oct 2007 22:17:45 +0000 (22:17 +0000)]
Add a FIXME to an assert.
Change a dyn_cast_or_null back to cast (which is more efficient).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43152
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Thu, 18 Oct 2007 22:09:03 +0000 (22:09 +0000)]
Patch to rewrite ivar tables metadata for classes defined.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43151
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 18 Oct 2007 21:23:00 +0000 (21:23 +0000)]
remove dead #include
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43149
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Thu, 18 Oct 2007 19:23:00 +0000 (19:23 +0000)]
First patch toward rewriting of objective-c's meta data.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43143
91177308 -0d34-0410-b5e6-
96231b3b80d8
Steve Naroff [Thu, 18 Oct 2007 18:55:53 +0000 (18:55 +0000)]
Tweak a recent fix to UsualArithmeticConversions (made by Chris - r43113). The benefit of this tweak is it guarantees the entire routine operates on unqualified types (which I believe is a bit clearer).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43142
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 18 Oct 2007 18:22:01 +0000 (18:22 +0000)]
Added StmtIterator.cpp and StmtIterator.h to the XCode project.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43139
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 18 Oct 2007 18:19:31 +0000 (18:19 +0000)]
Refactored StmtIterator into classes StmtIteratorBase (non-templated)
and StmtIteratorImpl (templated), which StmtIterator and
ConstStmtIterator now succintly subclass.
Implemented iteration over the initializers in DeclStmts. This is not
thoroughly tested, so there may be bugs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43138
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 18 Oct 2007 18:17:43 +0000 (18:17 +0000)]
Replaced virtual method call to child_begin() in child_end() by
directly inlining its logic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43137
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 18 Oct 2007 16:25:40 +0000 (16:25 +0000)]
Fixed broken build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43132
91177308 -0d34-0410-b5e6-
96231b3b80d8
Hartmut Kaiser [Thu, 18 Oct 2007 12:47:01 +0000 (12:47 +0000)]
Silenced a couple of VC++ warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43125
91177308 -0d34-0410-b5e6-
96231b3b80d8
Hartmut Kaiser [Thu, 18 Oct 2007 12:32:10 +0000 (12:32 +0000)]
Updated VC++ build system
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43124
91177308 -0d34-0410-b5e6-
96231b3b80d8
Steve Naroff [Thu, 18 Oct 2007 05:13:08 +0000 (05:13 +0000)]
Fix a bug in Sema::CheckConditionalOperands(). When mixing pointers and null pointer constants, we need to promote the null pointer constant (which is an integer) to the pointer type. Test case is self explanatory.
This surfaced yesterday, when compiling test/Sema/cocoa.m on Leopard. Since this has nothing to do with ObjC, it's kind of bizarre this hasn't shown up before. I imagine Cocoa.h on Leopard may have changed recently?
Thanks to Ted for localizing the bug and giving me a useful AST dump...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43114
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 18 Oct 2007 03:50:33 +0000 (03:50 +0000)]
UsualArithmeticConversions is crashing with an assert
when comparing "float" and "const float". This "fixes" the
issue, but may not be the right fix. Steve, please review.
Testcase here: test/Sema/usual-float.c
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43113
91177308 -0d34-0410-b5e6-
96231b3b80d8
Steve Naroff [Thu, 18 Oct 2007 03:27:23 +0000 (03:27 +0000)]
Fix the following bug...
unsigned char asso_values[] = { 34 };
int legal2() {
return asso_values[0];
}
The code that creates the new constant array type was operating on the original type.
As a result, the constant type being generated was "unsigned char [1][]" (which is wrong).
The fix is to operate on the element type - in this case, the correct type is "unsigned char [1]"
I added this case to array-init.c, which clearly didn't catch this bogosity...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43112
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 18 Oct 2007 00:39:29 +0000 (00:39 +0000)]
remove extraneous space in @selector()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43110
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 18 Oct 2007 00:38:23 +0000 (00:38 +0000)]
remove typedef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43109
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 18 Oct 2007 00:24:38 +0000 (00:24 +0000)]
Implemented 90% functionality of new child_iterator for Stmt objects
that will (soon) allow iteration over the initializers in
declarations. This new iterator mechanism is implemented by the
classes StmtIterator and ConstStmtIterator.
Patched a few files to use "operator++" instead of "operator+" on
child_iterators.
Friendship added in VarDecl to StmtIterator to allow returning a
reference to the initializer within the VarDecl. We may not wish this
as a permanent solution.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43105
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 18 Oct 2007 00:20:32 +0000 (00:20 +0000)]
Make control flow in Expr::isConstantExpr more simple and
local, making the code easier to read.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43104
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Oct 2007 22:35:30 +0000 (22:35 +0000)]
Add new API to rewrite one stmt/expr with another.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43101
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Oct 2007 21:28:00 +0000 (21:28 +0000)]
Add rewriter support for @encode expressions. For example,
we currently turn:
c = @encode(char *)[2] + 4;
into:
c = "foo"[2] + 4;
Right now the foo string is hard coded, but you can imagine a world
where it wouldn't be :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43093
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Oct 2007 21:23:07 +0000 (21:23 +0000)]
The size returned by Rewriter::getRangeSize should include
the size of the last token.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43092
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Oct 2007 21:22:38 +0000 (21:22 +0000)]
Fix assertion for raw lexer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43091
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Oct 2007 21:18:47 +0000 (21:18 +0000)]
Move token length calculation out of the diagnostics machinery into
the lexer, where it can be shared.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43090
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Oct 2007 20:53:57 +0000 (20:53 +0000)]
wean the diagnostics machinery off the preprocessor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43085
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Oct 2007 20:41:00 +0000 (20:41 +0000)]
Add a new type of lexer: a raw lexer, which does not require a preprocessor
object in order to do its thing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43084
91177308 -0d34-0410-b5e6-
96231b3b80d8
Steve Naroff [Wed, 17 Oct 2007 18:39:04 +0000 (18:39 +0000)]
rename test file for builtin "id"...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43082
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 17 Oct 2007 18:36:42 +0000 (18:36 +0000)]
Fixed includes of "clang/AST/DeclObjC.h" to work on case-sensitive
filesystems (was "#include "clang/AST/DeclObjc.h", which worked fine
on a case-insensitive HFS+ volume on the Mac).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43080
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Oct 2007 18:28:59 +0000 (18:28 +0000)]
add some comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43079
91177308 -0d34-0410-b5e6-
96231b3b80d8
Steve Naroff [Wed, 17 Oct 2007 17:53:50 +0000 (17:53 +0000)]
Predefine all the ObjC goodies from <objc/objc.h>. Removed all the ObjC goodies from the respective test files. Moving forward, it will be very nice to assume these builtin!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43077
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Wed, 17 Oct 2007 16:58:11 +0000 (16:58 +0000)]
Implementation of AST for @protocol expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43075
91177308 -0d34-0410-b5e6-
96231b3b80d8
Hartmut Kaiser [Wed, 17 Oct 2007 15:00:17 +0000 (15:00 +0000)]
Updated VC++ build system.
Silenced some VC++ warnings.
Had to rephrase a partial specialization of the IntrospectionTrait struct in SerializationTest.cpp, please review.
Added a compiler specific workaround in IdentifierTable.h. Is that the way to fix this kind of issues?
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43074
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Wed, 17 Oct 2007 06:04:46 +0000 (06:04 +0000)]
fix problems with test/sema/Cocoa.m etc on non-apple machines.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43067
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Wed, 17 Oct 2007 00:52:43 +0000 (00:52 +0000)]
Generate code for static variables that don't have initializers. Also, report an error if a static initializer is not constant.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43058
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Wed, 17 Oct 2007 00:50:25 +0000 (00:50 +0000)]
Fix the build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43057
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 16 Oct 2007 23:40:12 +0000 (23:40 +0000)]
Added Driver/SerializationTest.cpp to the XCode project.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43054
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 16 Oct 2007 23:37:27 +0000 (23:37 +0000)]
Started work on clang object serialization. Experimental
serialization logic as well as driver code is now in
Driver/SerializationTest.cpp. The status of this code is that it
should be used by no clients.
Added --test-pickling option to driver to run the serialization code.
Modified IdentifierInfo and IdentifierTable to have friend classes
that permit object serialization. Such friendship may not be needed
in the final design.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43052
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 16 Oct 2007 23:21:02 +0000 (23:21 +0000)]
Fix location processing of @selector: the range should include the @ sign.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43051
91177308 -0d34-0410-b5e6-
96231b3b80d8