- May 24, 2007
-
-
Chris Lattner authored
library to be built for the driver to link. llvm-svn: 39495
-
Chris Lattner authored
llvm-svn: 39494
-
Chris Lattner authored
constants. llvm-svn: 39493
-
Chris Lattner authored
llvm-svn: 39492
-
Chris Lattner authored
llvm-svn: 39491
-
Chris Lattner authored
llvm-svn: 39490
-
Chris Lattner authored
llvm-svn: 39489
-
Chris Lattner authored
llvm-svn: 39488
-
Chris Lattner authored
llvm-svn: 39487
-
Chris Lattner authored
llvm-svn: 39486
-
- May 23, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: Added "global" statistics gathering for Decls/Stmts/Exprs. Very useful for working with a single file. When we start compiling multiple files, will need to enhance this to collect stats on a per-module basis. llvm-svn: 39485
-
Bill Wendling authored
Submitted by: Bill Wendling Reviewed by: Chris Lattner - Removed unneeded <iostream> header. llvm-svn: 39484
-
Bill Wendling authored
Submitted by: Bill Wendling Reviewed by: Chris Lattner - Changed "std::cerr" to "OS" stream to be consistent with the other outputs in the method. llvm-svn: 39483
-
Bill Wendling authored
Submitted by: Bill Wendling Reviewed by: Chris Lattner - Comment fix. llvm-svn: 39482
-
- May 22, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: One bug compiling "Carbon.h" on Leopard, one diagnostic tweak. - CheckIndirectionOperand wasn't operating on the canonical type (so it was complaining about typedef names). - The diagnostic was less than great. Here's what is was: [dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang t.c t.c:4:3: error: invalid argument type to unary expression 'int' *p; ^~ And here's what I changed it to... snaroff:clang naroff$ ../../Debug/bin/clang bug.c bug.c:5:3: error: indirection requires a pointer ('int' operand invalid) *p; ^~ llvm-svn: 39481
-
Steve Naroff authored
Submitted by: Reviewed by: Add Makefile llvm-svn: 39480
-
- May 21, 2007
-
-
Chris Lattner authored
llvm-svn: 39479
-
Chris Lattner authored
llvm-svn: 39478
-
Chris Lattner authored
llvm-svn: 39477
-
Chris Lattner authored
llvm-svn: 39476
-
Chris Lattner authored
integer constants, whoa! :) llvm-svn: 39475
-
Chris Lattner authored
where the parser emitted bogus diagnostics. Before, when compiling: struct A { int X; } someA; int func(int, struct A); int test1(void *P, int C) { return func(((C*40) + *P) / 42+P, someA); } we emitted: bug3.c:7:25: error: invalid operands to binary expression ('int' and 'void') return func(((C*40) + *P) / 42+P, someA); ~~~~~~ ^ ~~ bug3.c:7:31: error: expected ')' return func(((C*40) + *P) / 42+P, someA); ^ bug3.c:7:16: error: to match this '(' return func(((C*40) + *P) / 42+P, someA); ^ now we only emit the first. llvm-svn: 39474
-
Chris Lattner authored
and correctly in terms of C99 6.4.4.1p5. llvm-svn: 39473
-
Chris Lattner authored
llvm-svn: 39472
-
Chris Lattner authored
llvm-svn: 39471
-
Chris Lattner authored
llvm-svn: 39470
-
Chris Lattner authored
llvm-svn: 39469
-
Chris Lattner authored
void foo() { abc: def: hij: case 1: case 1: goto abc baz: goto def } instead of: void foo() { abc: def: hij: case 1: case 1: goto abc baz: goto def } llvm-svn: 39468
-
Chris Lattner authored
llvm-svn: 39467
-
- May 20, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: Bozo bug in last checkin. Needed to move the check for null pointers up (and out of the pointer/pointer clause). llvm-svn: 39466
-
Chris Lattner authored
#define friendlystruct fs struct A { int X; }; void test2(struct A friendlystruct, int C) { return friendlystruct + (C *40); } were getting diagnosed like this: t.c:7:27: error: invalid operands to binary expression ('struct A' and 'int') return friendlystruct + (C *40); ~~ ^ ~~~~~~~~~~~ The problem is that getCharacterData returns a pointer to the macro expansion, not to the macro instantiation. Instead, use getLogicalLoc to get a pointer to the instatiation location, so we relex the macro id. We now get: t.c:7:27: error: invalid operands to binary expression ('struct A' and 'int') return friendlystruct + (C *40); ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~ oooh ahh. :) llvm-svn: 39465
-
Steve Naroff authored
Submitted by: Reviewed by: Fix two bugs... - Sema::CheckConditionalOperands(). Needed to move the check for null pointer constants up to the clause dealing with two pointers types. The previous code would never get executed. - Expr::isNullPointerConstant(). This predicate was much too naive...it should have had a FIXME (my bad). It now deals with "void *" cast expressions. It still has one major bug...it needs to evaluate the expression to correctly determine if it is a null pointer constant (e.g. 7-7 should pass). llvm-svn: 39464
-
Chris Lattner authored
llvm-svn: 39463
-
Chris Lattner authored
llvm-svn: 39462
-
Chris Lattner authored
llvm-svn: 39461
-
- May 19, 2007
-
-
Chris Lattner authored
llvm-svn: 39460
-
Chris Lattner authored
of a subexpression when emitting a diagnostic. Consider this example: struct A { int X; }; void test1(void *P, int C) { return ((C*40) + *P) / 42+P; } void test2(struct A friendlystruct, int C) { return (C *40) + friendlystruct; } void test3(struct A friendlystruct, int C) { return friendlystruct + test2(friendlystruct , C); } clang now produces this output: t.c:4:18: error: invalid operands to binary expression ('int' and 'void') return ((C*40) + *P) / 42+P; ~~~~~~ ^ ~~ This shows the important pieces of a nested (and potentially very complex) expression. t.c:8:18: error: invalid operands to binary expression ('int' and 'struct A') return (C *40) + friendlystruct; ~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ This shows that tabs in source files (after the 'C') and multichar tokens (friendlystruct) are handled correctly. t.c:12:25: error: invalid operands to binary expression ('struct A' and 'void') return friendlystruct + test2(friendlystruct ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~ This shows how multiline ranges are printed. Any part of the range that is not on the same line as the carat is just ignored. This also shows that trailing spaces on the line aren't highlighted. llvm-svn: 39459
-
Chris Lattner authored
but there is no functionality change yet. llvm-svn: 39458
-
Chris Lattner authored
llvm-svn: 39457
-
Steve Naroff authored
Submitted by: Reviewed by: An important, but truly mind numbing change. Added 6 flavors of Sema::Diag() that take 1 or two SourceRanges. Considered adding 3 flavors (using default args), however this wasn't as clear. Removed 2 flavors of Sema::Diag() that took LexerToken's (they weren't used). Changed all the typechecking routines to pass the appropriate range(s). Hacked the diagnostic machinery and driver to acccommodate the new data. What's left? A FIXME in clang.c to use the ranges. Chris offered to do the honors:-) Which includes taking us to the end of an identifier:-) llvm-svn: 39456
-