Lauro Ramos Venancio
01a72ff5d3
Implement codegen for the following static var init.
...
void g() {
static char a[10];
static char *b = a;
}
Now we can compile wget!
llvm-svn: 47627
2008-02-26 21:41:45 +00:00
Lauro Ramos Venancio
8af648ac55
Fix a bug in ConvertAsmString function.
...
llvm-svn: 47618
2008-02-26 19:19:58 +00:00
Lauro Ramos Venancio
c9fbd7301a
Convert x86 target specific inline asm constraints to LLVM.
...
llvm-svn: 47609
2008-02-26 18:33:46 +00:00
Lauro Ramos Venancio
8983891531
Fix PR2086.
...
llvm-svn: 47551
2008-02-25 19:03:15 +00:00
Chris Lattner
5329e7e5ed
Fix PR2090, a typo in digraph processing.
...
llvm-svn: 47540
2008-02-24 19:05:57 +00:00
Nate Begeman
b16d53ea31
add a test case
...
llvm-svn: 47455
2008-02-21 19:44:16 +00:00
Eli Friedman
c62dd9d345
Some const initializer tests for stuff I just committed.
...
llvm-svn: 47442
2008-02-21 18:07:36 +00:00
Chris Lattner
3b418d8446
implement codegen support for sizeof(void), fixing PR2080.
...
llvm-svn: 47429
2008-02-21 05:45:29 +00:00
Chris Lattner
a2417c9d8b
add some semantic checks for address spaces.
...
llvm-svn: 47423
2008-02-21 01:42:41 +00:00
Lauro Ramos Venancio
e2162c6549
Simplify aggregate initilizer implementation. Use the CodeGenModule::EmitConstantExpr method when
...
possible.
Fix mediabench/mpeg2/mpeg2dec test.
llvm-svn: 47336
2008-02-19 19:27:31 +00:00
Chris Lattner
d2a02fe840
fix the second half of PR2041: __restrict is ok in c90 mode, even if
...
restrict isn't.
llvm-svn: 47316
2008-02-19 06:46:10 +00:00
Lauro Ramos Venancio
c58fc4052e
A global without initializer must be emitted as weak.
...
Fix Olden/bh test.
llvm-svn: 47292
2008-02-19 00:04:15 +00:00
Lauro Ramos Venancio
dec89733a7
Implement multi-dimension array initalizer.
...
Fix McCat/08-main test.
llvm-svn: 47286
2008-02-18 22:44:02 +00:00
Steve Naroff
f631ae2cf8
Tweak fix for http://llvm.org/bugs/show_bug.cgi?id=2000 to work across typedefs.
...
llvm-svn: 47269
2008-02-18 15:14:59 +00:00
Chris Lattner
b080ed504e
Fix PR2042. One remaining issue: we don't currently diagnose
...
int foobar(int);
int foobar() {}
which requires ifdef'ing out a testcase in predefined-function.c.
llvm-svn: 47236
2008-02-17 19:31:09 +00:00
Eli Friedman
f7e92acaba
Implemnt isVariablyModifiedType correctly.
...
llvm-svn: 47233
2008-02-17 00:59:11 +00:00
Chris Lattner
df53e20f2d
implement codegen support for aggregates casted to void.
...
llvm-svn: 47226
2008-02-16 23:55:16 +00:00
Lauro Ramos Venancio
bada8d4b5b
Implement extern block var.
...
llvm-svn: 47223
2008-02-16 22:30:38 +00:00
Anders Carlsson
f13b1efa75
Add more tests
...
llvm-svn: 47217
2008-02-16 19:51:36 +00:00
Chris Lattner
27055194b7
Fix CheckEndOfDirective to diagnose lines that contain macros that expand to
...
zero tokens. This fixes PR2045, thanks to Neil for finding another
incredibly subtle corner case :)
llvm-svn: 47203
2008-02-16 01:20:36 +00:00
Anders Carlsson
3ea23a45d9
Make sizeof and __alignof work correctly with packed structs.
...
llvm-svn: 47202
2008-02-16 01:20:23 +00:00
Chris Lattner
287c734075
Fix PR2041: restrict is not a keyword in c90.
...
llvm-svn: 47160
2008-02-15 18:02:59 +00:00
Eli Friedman
78e47634b2
Get rid of outdated code that masks type errors. Fixes PR2036.
...
llvm-svn: 47154
2008-02-15 06:56:02 +00:00
Eli Friedman
e9d0954c06
Nevermind, these tests work... I messed up my testing.
...
llvm-svn: 47153
2008-02-15 06:29:53 +00:00
Eli Friedman
a01cfa75eb
Partial fix for struct compatibility; there's still something messy
...
going on with mixing scopes, though.
llvm-svn: 47152
2008-02-15 06:03:44 +00:00
Steve Naroff
f631997cb5
A much better fix for http://llvm.org/bugs/show_bug.cgi?id=1987 .
...
llvm-svn: 47103
2008-02-14 02:58:32 +00:00
Eli Friedman
2be9af9556
Fix a minor bug in isNullPointerConstant triggered by the linux
...
tgmath.h.
Note that there is another issue with tgmath.h, so mandel.c still
doesn't work.
llvm-svn: 47069
2008-02-13 17:29:58 +00:00
Eli Friedman
a7bf7ed476
Make typechecking for enum+int compatibility stricter.
...
llvm-svn: 47005
2008-02-12 08:46:17 +00:00
Eli Friedman
16f909670e
Fix type compatibility between constant and variable arrays.
...
llvm-svn: 47003
2008-02-12 08:23:06 +00:00
Steve Naroff
ab468cb14b
Allow the parser to detect invalid DeclSpec's. This fixes http://llvm.org/bugs/show_bug.cgi?id=1987 .
...
This commit only "guards" the call to ParseDeclarationSpecifiers() in ParseDeclarationOrFunctionDefinition().
We could consider guarding all calls, however this is a bit radical (since it effectively stops parsing the declaration once we have a bad declspec). Will discuss with Chris tomorrow.
llvm-svn: 46984
2008-02-12 04:08:59 +00:00
Anders Carlsson
6a8350b4f1
Get rid of bogus warnings when the second argument in va_start is either an implicit cast expr or a paren expr.
...
llvm-svn: 46950
2008-02-11 04:20:54 +00:00
Steve Naroff
e78e2af754
Tweak test...
...
llvm-svn: 46946
2008-02-11 02:16:41 +00:00
Steve Naroff
326389b8ce
Fix http://llvm.org/bugs/show_bug.cgi?id=1988 .
...
Sema::CheckInitializerListTypes() needs to ignore invalid structures.
llvm-svn: 46942
2008-02-11 00:06:17 +00:00
Chris Lattner
36fc8790b7
Fix PR1992 by computing the right type for string literals, which
...
is an array type not a pointer type. This requires updating some
diags that change and updating the code generator to handle the
proper form of strings.
llvm-svn: 46941
2008-02-11 00:02:17 +00:00
Eli Friedman
de4496bb9e
Basic codegen test for conditional with void*.
...
llvm-svn: 46940
2008-02-10 23:18:23 +00:00
Eli Friedman
fadc8462be
Add a couple of sema tests for qualifiers with conditionals containing
...
void*.
llvm-svn: 46939
2008-02-10 23:14:16 +00:00
Chris Lattner
7b8134f5c6
Fix PR1999, by emitting a hard error only if an argument declarator is completely
...
missing. Otherwise, it is an implicit int case, which is valid in c90 and invalid
elsewhere, but accepted as an extension.
llvm-svn: 46938
2008-02-10 23:08:00 +00:00
Steve Naroff
1018ea35b7
Refine bug fix to Expr::isLvalue (commit r46917).
...
llvm-svn: 46919
2008-02-10 01:39:04 +00:00
Steve Naroff
43c50866f1
Change Expr::isLvalue() to allow the "void" type. This fixes bz2000 submitted by Neil Booth.
...
Neil, can you point me to the place in the C99 spec that says this is allowed? I thought Expr::isLvalue() conformed to the spec, which says "C99 6.3.2.1: an lvalue is an expression with an object type or an incomplete type other than void.". Please advise.
llvm-svn: 46917
2008-02-10 00:30:18 +00:00
Anders Carlsson
2e64d1a50f
Behave correctly if a constraint expression is invalid.
...
llvm-svn: 46910
2008-02-09 19:57:29 +00:00
Steve Naroff
45173e0ac0
Fix <rdar://problem/5733511> clang doesn't emit error for const array.
...
llvm-svn: 46905
2008-02-09 16:59:44 +00:00
Steve Naroff
a369922449
A bunch-o changes to fix <rdar://problem/5716046> incomplete implementation of ObjC class warning is incomplete
...
As part of this fix, I made a low-level change to the text diagnostics machinery (to basically avoid printing duplicate source lines/carets when you have multiple diagnostics that refer to the same exact place). For now, this only happens with we don't have a source range (could be extended to support source ranges as well).
llvm-svn: 46897
2008-02-08 22:06:17 +00:00
Lauro Ramos Venancio
d74057fa87
Fix a bitfield regression. Reported by Anders Carlsson.
...
llvm-svn: 46889
2008-02-08 19:46:46 +00:00
Steve Naroff
8c099c3f03
Use getLogicalLineNumber() in FuzzyParseMicrosoftAsmStatement(), it's more general and simplifies the code.
...
llvm-svn: 46885
2008-02-08 18:01:27 +00:00
Steve Naroff
db5f7d7699
Support fuzzy parsing MS line-oriented __asm's that originate from a macro (a case where we can't obtain source line info). As the test case indicates, we don't currently support line-oriented asm statements that mix file/macro body tokens.
...
llvm-svn: 46878
2008-02-08 03:36:19 +00:00
Eli Friedman
4297826cac
Improve diagnostic for illegal array initialization.
...
llvm-svn: 46869
2008-02-08 00:48:24 +00:00
Lauro Ramos Venancio
9eff02d9f8
Simplify bitfield codegen.
...
Fix codegen of struct { short a[3]; int b:15; }.
llvm-svn: 46859
2008-02-07 19:29:53 +00:00
Lauro Ramos Venancio
0f166de892
Fix codegen of
...
struct {
char a[3];
unsigned char b:1;
};
Fix PR1990.
llvm-svn: 46856
2008-02-07 18:18:58 +00:00
Chris Lattner
3b5054dda0
Implement support for the extremely atrocious MS /##/ extension,
...
which pastes together a comment. This is only enabled with
-fms-extensions of course.
llvm-svn: 46845
2008-02-07 06:03:59 +00:00
Eli Friedman
1242fff6ec
Make sure to propagate qualifiers through the member operator.
...
llvm-svn: 46830
2008-02-06 22:48:16 +00:00