Chris Lattner
a779d69029
Fix a rewriter crash when the whole body of a foreach is itself
...
rewritten, as in Sema/rewrite-foreach-6.m. Fariborz/Steve,
please review this to see if it is sane.
llvm-svn: 46600
2008-01-31 05:10:40 +00:00
Chris Lattner
a94035bbb8
Fix PR1921 by promoting negative indices to intptrty.
...
llvm-svn: 46599
2008-01-31 04:12:50 +00:00
Steve Naroff
2a2c5b98ee
Fix test case and add a FIXME.
...
llvm-svn: 46577
2008-01-30 21:50:43 +00:00
Lauro Ramos Venancio
86b99c1b79
getLLVMFieldNo can't be called before emitting the base value.
...
llvm-svn: 46576
2008-01-30 21:23:20 +00:00
Lauro Ramos Venancio
f5291d2871
A pointer to an opaque type is an "opaque type definition".
...
llvm-svn: 46575
2008-01-30 21:21:08 +00:00
Eli Friedman
1bc0fed9a5
Fix codegen for conditionals with incommpatible pointer types. Code
...
that causes this isn't really correct, but if we're going to accept
this, it should come up with a consistent AST.
llvm-svn: 46557
2008-01-30 17:02:03 +00:00
Chris Lattner
05ba4cbe17
fix a problem reported by Eli, caused by not keeping bool as i1
...
when in a register.
llvm-svn: 46552
2008-01-30 07:01:17 +00:00
Chris Lattner
e850fa2452
make this pass by adding an expected error, add some tests.
...
llvm-svn: 46551
2008-01-30 06:46:30 +00:00
Steve Naroff
1e7873642b
Many refinements to Sema::MergeVarDecl(). This routine still needs some re-work to fully handle tentative decls.
...
This includes a fix to bz1908.
llvm-svn: 46540
2008-01-30 00:44:01 +00:00
Devang Patel
45a65d2ee1
Handle incomplete struct initializer.
...
llvm-svn: 46534
2008-01-29 23:23:18 +00:00
Fariborz Jahanian
284011b462
Rewriting of @synchronized. This has one FIXME in it. But this should allow @sychronized to be rewritten.
...
llvm-svn: 46533
2008-01-29 22:59:37 +00:00
Steve Naroff
ddb1dd8c5f
Tighten up ASTContext::typesAreCompatible()...it needs to make sure the qualifiers match. The comment and C99 citation for this routine were correct...the code needed to conform to the comment/spec. This fixes the test added below.
...
Tightening up this routine forced tweaks to Sema::CheckSubtractionOperands() and Sema::CheckCompareOperands(). For example, they both need to operate on the unqualified pointee...
llvm-svn: 46522
2008-01-29 18:58:14 +00:00
Eli Friedman
7031d734ed
Fix a bug where CodeGen would attempt to erase an instruction that was
...
already used.
llvm-svn: 46519
2008-01-29 18:13:51 +00:00
Anders Carlsson
a8dc3e6b52
Implement __builtin_offsetof.
...
llvm-svn: 46515
2008-01-29 15:56:48 +00:00
Chris Lattner
0c8a1edb8b
Fix a bug where we would incorrectly emit a "cannot paste" error
...
message when handling the GNU ", ## __VA_ARGS__" extension. While
I'm at it, flag uses of this as extensions.
llvm-svn: 46503
2008-01-29 07:54:23 +00:00
Anders Carlsson
ce0740e1f5
Handle binary or in constant expressions.
...
llvm-svn: 46482
2008-01-29 01:33:32 +00:00
Anders Carlsson
0674a7417f
Correctly handle constants that refer to enums.
...
llvm-svn: 46481
2008-01-29 01:28:48 +00:00
Anders Carlsson
6f2a10e8c9
Correctly handle scalars in braces.
...
llvm-svn: 46480
2008-01-29 01:15:48 +00:00
Steve Naroff
f06b5ba047
Fix bz1950. ASTContext::functionTypesAreCompatible() needs to operate on the unqualified parameter types (per C99 6.7.5.3p15).
...
llvm-svn: 46472
2008-01-29 00:15:50 +00:00
Steve Naroff
aeb6b30f64
Fix a bug with struct initializers (in Sema::CheckInitializerListTypes()).
...
Test case included from bz1948 (thanks Neil!).
Also fixed an 80 column violation...
llvm-svn: 46430
2008-01-28 02:00:41 +00:00
Chris Lattner
77927cc33c
Add support for dispatching an objc message to a variable
...
in an initializer list.
llvm-svn: 46367
2008-01-25 19:43:26 +00:00
Chris Lattner
8917c5ace2
First half of a fix for the "objc message send in initializer" bug. This only
...
handles message sends with typenames to start with.
llvm-svn: 46366
2008-01-25 19:37:24 +00:00
Fariborz Jahanian
cc9c5452d1
Diagnose bad receiver type.
...
llvm-svn: 46358
2008-01-25 17:43:39 +00:00
Nate Begeman
43eec490fb
Support checking and codegen of constant vector globals
...
llvm-svn: 46343
2008-01-25 05:34:48 +00:00
Steve Naroff
78c6cdf95e
Replace Sema::CheckVariableInitList, CheckConstantInitList, and CheckForCharArrayInitializer with CheckInitializerListTypes. The new routine now supports struct/union initializers.
...
This is a modified version of a patch by Eli Friedman. This version passes all of the clang tests and supports vectors:-)
Note that Eli and I are still unsatisfied the implementation of CheckInitializerListTypes(). We'd like to find a more elegant implementation. Nevertheless, this is a complex part of the standard (and may be hard to simplify). Since the complexity is localized to this routine, we can iterate without too much disruption:-)
llvm-svn: 46339
2008-01-25 00:51:06 +00:00
Chris Lattner
3efff5472b
Fix a bug recovering from broken code with a goto that Eli reported.
...
llvm-svn: 46336
2008-01-25 00:01:10 +00:00
Fariborz Jahanian
60a901621f
Fixed a nasty bug which took a while to come up with a test case,
...
diagnose, and took even longer to fix. It has to do with rewriting of a message
receiver which is an 'ivar' reference. Fix, however, is to remove a code which
was not doing the right thing and no longer needed.
llvm-svn: 46279
2008-01-23 20:34:40 +00:00
Chris Lattner
7238225c28
add support for -Wundef.
...
llvm-svn: 46274
2008-01-23 17:19:46 +00:00
Fariborz Jahanian
0a71ad2e07
Problem with ObjC's type-encoding of nested structs causing infinit recursion.
...
llvm-svn: 46260
2008-01-22 22:44:46 +00:00
Lauro Ramos Venancio
09af71c2a6
Implement bitfield write.
...
llvm-svn: 46258
2008-01-22 22:36:45 +00:00
Lauro Ramos Venancio
2ddcb25a3b
Implement bitfield read.
...
llvm-svn: 46257
2008-01-22 20:17:04 +00:00
Chris Lattner
97ff7763dc
Fix PR1936, a crash on malformed #if. Thanks to Neil for
...
noticing this!
llvm-svn: 46256
2008-01-22 19:34:51 +00:00
Steve Naroff
f9eb598de3
Sema::CheckInitializerTypes(). Start simpliying and cleaning up...
...
llvm-svn: 46234
2008-01-21 23:53:58 +00:00
Fariborz Jahanian
7718e36e25
Elimate bogus warning when va_start is correctly used in
...
a method.
llvm-svn: 46232
2008-01-21 22:59:53 +00:00
Lauro Ramos Venancio
37bae3e8aa
Simplify the bitfield codegen.
...
llvm-svn: 46230
2008-01-21 22:54:57 +00:00
Fariborz Jahanian
eab81cd03f
Synthesize methods with va-arg list correctly.
...
llvm-svn: 46212
2008-01-21 20:14:23 +00:00
Steve Naroff
c7d2df23f8
Fix two bugs with an @throw that doesn't have a statement.
...
- ObjCAtThrowStmt::getSourceRange() needs to check if it has a statement (and not go "boom":-)
- RewriteTest::RewriteObjCThrowStmt() needs to generate refer to the current exception.
llvm-svn: 46184
2008-01-19 00:42:38 +00:00
Steve Naroff
acb6fa6bea
Sema::FinalizeDeclaratorGroup(): Tighten up the tentative definition rule when dealing with arrays.
...
Bug submitted by Eli.
llvm-svn: 46179
2008-01-18 20:40:52 +00:00
Anders Carlsson
60bfc161a0
Assert that the type of the cast is equal to the _unqualified_ type of the subexpression. Fixes a problem spotted by Nuno Lopes.
...
llvm-svn: 46158
2008-01-18 02:25:57 +00:00
Steve Naroff
b716fbab44
Sema::FinalizeDeclaratorGroup()...make sure we emit an diagnostic for tentative definitions with incomplete types. Touch up all test cases that are effected.
...
llvm-svn: 46152
2008-01-18 00:39:39 +00:00
Fariborz Jahanian
9a5124a67e
Don't ICE on missing interface declaration when declaring one of its protocols.
...
llvm-svn: 46141
2008-01-17 20:33:24 +00:00
Steve Naroff
1aa1941889
Declarator::clear(): Null out variable after it's been deleted.
...
This avoids a double free (which is good:-)
Bug submitted by Eli.
llvm-svn: 46105
2008-01-17 00:36:28 +00:00
Steve Naroff
8a0abea999
Type::isArithmeticType(): disallow incomplete enum decls.
...
Bug submitted by Eli.
llvm-svn: 46102
2008-01-16 23:54:22 +00:00
Chris Lattner
a65e1f3b31
Move promoteExprToType from being a static method in SemaExpr.cpp to being
...
a method named ImpCastExprToType in Sema.
Use this method to insert implicit casts for case statements from their
operand type to the condition type of the switch. This fixes a crash on
test/CodeGen/statements.c, reported by Eli Friedman.
llvm-svn: 46083
2008-01-16 19:17:22 +00:00
Steve Naroff
17832a48f8
Sema::MergeFunctionDecl()...make sure diagnostic is accurate (wrt function declarations/definitions). Patch by Carl Lewis!
...
llvm-svn: 46070
2008-01-16 15:01:34 +00:00
Fariborz Jahanian
b860cbf052
Added support for rewriting of continue/break statements inside ObjC2's foreach-stmt.
...
llvm-svn: 46037
2008-01-15 23:58:23 +00:00
Steve Naroff
abefc391dd
Finish up handling all permutations of "complex int" (in Sema::UsualArithmeticConversions()).
...
A FIXME remains to verify the conversion rules are consistent with GCC.
Thanks to Eli for the new/improved test case...
llvm-svn: 46022
2008-01-15 22:21:49 +00:00
Steve Naroff
6fcfd0581d
- Change Type::isComplexType() to exlude GCC's complex integer extension. In general, we will keep the lowest level Type predicates "pure" (i.e. true to the C99 spec).
...
- Modify Sema::UsualArithmeticConversions() to work with the new definition of Type::isComplexType().
This is a nice cleanup and also fixes a bug submitted by Eli (which I've added to the test suite).
llvm-svn: 46005
2008-01-15 19:36:10 +00:00
Chris Lattner
15346fae70
avoid pasting L + "foo" into L"foo".
...
llvm-svn: 46000
2008-01-15 05:22:14 +00:00
Steve Naroff
7f988889ef
Rework commit r45976, which was incorrect.
...
- Add Type::isComplexIntegerType(), Type::getAsComplexIntegerType().
- Don't inlude complex types with Type::isIntegerType(), which is too general.
- Use the new predicates in Sema::UsualArithmeticConversions() to recognize/convert the types.
llvm-svn: 45992
2008-01-15 01:41:59 +00:00