- May 30, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: Implement some FIXME's that stand in the way of fully typechecking "for" statements. This involved: - Adding a DeclStmt AST node (with statement visitor). The DeclStmt printer is preliminary. - Added a ParseDeclStmt action, called from Parser::ParseForStatement() and Parser::ParseStatementOrDeclaration(). DID NOT add to Parser::ParseIdentifierStatement()...probably could have, however didn't really understand the context of this rule (will speak with Chris). - Removed ParseExprStmt (and it's clients)...it was vestigial. llvm-svn: 39518
-
- May 29, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: - Finished Sema::ParseReturnStmt(). Still need to tweak ranges. - Tweaked location for function arguments (they now point at the expression directly, no parens or commas). - Added InvalidOperands helper...was sick of looking at the same 3 lines in ~9 Check functions. - Added a few diags and moved a group of statement diags to the proper comment/category. llvm-svn: 39517
-
Chris Lattner authored
extern int pintFunc(int *, int *); int test() { pintFunc(0, 3); } We now print: t3.c:4:13: warning: passing argument 2 makes pointer from integer without a cast pintFunc(0, ~~~~~~~~ ^ instead of: t3.c:4:13: warning: passing argument 2 makes pointer from integer without a cast pintFunc(0, ~~~~~~~~ llvm-svn: 39516
-
Steve Naroff authored
Submitted by: Reviewed by: Implement type checking for ParseDoStmt, ParseWhileStmt, ParseIfStmt, and ParseForStmt. ParseForStmt still under construction (contains a FIXME). llvm-svn: 39515
-
- May 28, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: Add range support to Sema::CheckConditionalOperands(). llvm-svn: 39514
-
Steve Naroff authored
Submitted by: Reviewed by: Refine Sema::ParseCallExpr() diags (range support, add types). Before: func-assign.c:27:11: warning: passing argument 1 from incompatible pointer type pintFunc(&FOO); ^ func-assign.c:28:12: error: incompatible type for argument 1 floatFunc(&FOO); ^ func-assign.c:29:12: error: too many arguments to function floatFunc(1,2,3); ^ After: func-assign.c:27:11: warning: passing incompatible pointer 'struct foo *' to function expecting 'int *' pintFunc(&FOO); ~~~~~~~~^~~~~ func-assign.c:28:12: error: passing incompatible type 'struct foo *' to function expecting 'float' floatFunc(&FOO); ~~~~~~~~~^~~~~ func-assign.c:29:12: error: too many arguments to function floatFunc(1,2,3); ~~~~~~~~~^ ~ llvm-svn: 39513
-
Steve Naroff authored
Submitted by: Reviewed by: - Implement FIXME in Sema::CheckIndirectionOperand(). - Added "const" to FunctionDecl::getResultType(). llvm-svn: 39512
-
Chris Lattner authored
llvm-svn: 39511
-
Chris Lattner authored
llvm-svn: 39510
-
Chris Lattner authored
the label identifier. Handle fwd references etc. This allows us to detect uses of undefined labels and label redefinitions, such as: t.c:2:12: error: redefinition of label 'abc' abc: ; abc: ^ t.c:2:3: error: previous definition is here abc: ; abc: ^ t.c:12:12: error: use of undeclared label 'hijl' goto hijl; ^ llvm-svn: 39509
-
Chris Lattner authored
void foo() { if (0) break; abc: def: hij: break; into: void foo() { if ((0)') ; abc: def: hij: ; instead of dropping the if and labels (due to break not being in a loop). llvm-svn: 39508
-
Chris Lattner authored
llvm-svn: 39507
-
Chris Lattner authored
llvm-svn: 39506
-
Chris Lattner authored
llvm-svn: 39505
-
Chris Lattner authored
llvm-svn: 39504
-
Chris Lattner authored
llvm-svn: 39503
-
Chris Lattner authored
llvm-svn: 39502
-
Steve Naroff authored
Submitted by: Reviewed by: - Added type checking to Sema::ParseReturnStmt (still under construction). - Improved Expr::isLvalue() and Expr::isModifiableLvalue() to return more info. Used the info in Sema::CheckAssignmentOperands() to produce more descriptive diagnostics. Added FIXME to other clients of isLvalue()/etc. - Added a SourceLocation slot to MemberExpr...changed the implementation of getSourceRange(). - Added getResultType() helper to FunctionDecl. - Changed many Diag calls to use the SourceRange support (now that it's a big hit...we better milk it:-). llvm-svn: 39501
-
Bill Wendling authored
Submitted by: Bill Wendling Reviewed by: - Can do just a 'cast<>()' because we're checking that it's Tagged. llvm-svn: 39500
-
Bill Wendling authored
Submitted by: Bill Wendling Reviewed by: Steve Naroff - Steve suggested avoiding the dyn_cast by using the "Tagged" type class and having the "default" just return false. llvm-svn: 39499
-
Bill Wendling authored
Submitted by: Bill Wendling Reviewed by: Chris Lattner - Rework the isDerivedType method so that if a language doesn't support references, it won't have to pay the price for them. This inlines the checks for derived types and turns it into a switch statement instead. llvm-svn: 39498
-
- May 27, 2007
-
-
Bill Wendling authored
Submitted by: Bill Wendling Reviewed by: C++ references testcase. llvm-svn: 39497
-
Bill Wendling authored
Submitted by: Bill Wendling Reviewed by: Chris Lattner - Initial support for C++ references. Adding to the AST and Parser. Skeletal support added in the semantic analysis portion. Full semantic analysis is to be done soon. llvm-svn: 39496
-
- 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
-