- Aug 25, 2007
-
-
Neil Booth authored
llvm-svn: 41381
-
Tanya Lattner authored
llvm-svn: 41380
-
Steve Naroff authored
This modest change insures ImplicitCastExpr's get generated for all "assignments", while includes init decls, assignment exprs, call exprs, and return statements. Here are a few examples with the correct AST's... [dylan:~/llvm/tools/clang] admin% cat impcomp.c _Complex double X; void test2(int c) { X = 5; } void foo() { int i; double d = i; double _Complex a = 5; test2(a); a = 5; d = i; } [dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang impcomp.c -parse-ast-dump Read top-level variable decl: 'X' void test2(int c) (CompoundStmt 0x2605ce0 (BinaryOperator 0x2605cc0 '_Complex double' '=' (DeclRefExpr 0x2605c70 '_Complex double' Decl='X' 0x2605af0) (ImplicitCastExpr 0x2605cb0 '_Complex double' (IntegerLiteral 0x2605c90 'int' 5)))) void foo() (CompoundStmt 0x2606030 (DeclStmt 0x2605bd0 0x2605d90 "int i") (DeclStmt 0x2605e20 0x2605de0 "double d = (ImplicitCastExpr 0x2605e10 'double' (DeclRefExpr 0x2605dc0 'int' Decl='i' 0x2605d90))") (DeclStmt 0x2605e90 0x2605e50 "_Complex double a = (ImplicitCastExpr 0x2605e80 '_Complex double' (IntegerLiteral 0x2605e30 'int' 5))") (CallExpr 0x2605f20 'void' (ImplicitCastExpr 0x2605f00 'void (*)(int)' (DeclRefExpr 0x2605ea0 'void (int)' Decl='test2' 0x2605c00)) (ImplicitCastExpr 0x2605f10 'int' (DeclRefExpr 0x2605ec0 '_Complex double' Decl='a' 0x2605e50))) (BinaryOperator 0x2605fa0 '_Complex double' '=' (DeclRefExpr 0x2605f50 '_Complex double' Decl='a' 0x2605e50) (ImplicitCastExpr 0x2605f90 '_Complex double' (IntegerLiteral 0x2605f70 'int' 5))) (BinaryOperator 0x2606010 'double' '=' (DeclRefExpr 0x2605fc0 'double' Decl='d' 0x2605de0) (ImplicitCastExpr 0x2606000 'double' (DeclRefExpr 0x2605fe0 'int' Decl='i' 0x2605d90)))) llvm-svn: 41379
-
Dale Johannesen authored
This means backing out the preceding change to Constants.cpp, alas. llvm-svn: 41378
-
- Aug 24, 2007
-
-
Chris Lattner authored
llvm-svn: 41377
-
Chris Lattner authored
llvm-svn: 41376
-
Chris Lattner authored
llvm-svn: 41375
-
Ted Kremenek authored
concrete subclasses of Stmt are now required to implement child_begin/child_end. llvm-svn: 41374
-
Chris Lattner authored
operators in all their glory :) llvm-svn: 41373
-
Dale Johannesen authored
llvm-svn: 41372
-
Chris Lattner authored
This eliminates a conditional on that path, and ensures ICmpInst/FCmpInst both have an out-of-line virtual method to home the class. llvm-svn: 41371
-
Ted Kremenek authored
llvm-svn: 41370
-
Ted Kremenek authored
llvm-svn: 41369
-
Ted Kremenek authored
llvm-svn: 41368
-
Ted Kremenek authored
llvm-svn: 41366
-
Devang Patel authored
Fix regression that I caused yesterday night while adding logic to select appropriate split condition branch. llvm-svn: 41365
-
Steve Naroff authored
Surpress ImplicitCastExprs for compound assignment expressions. For compound assignments, it is o.k. for the LHS and RHS to have different types. Converting the type can cause errors like the one Chris noticed (below). This change required a fair number of diffs (since there is a lot of shared code between single and compound assignments). This makes the API's look a bit uglier, however I couldn't think of a better way to do it (without duplicating code). Fix the following (incorrect) error: int A; long long B; void foo() { A /= B; } $ clang ~/scalar.c -emit-llvm /Users/sabre/scalar.c:6:5: error: expression is not assignable A /= B; ~ ^ Now it works properly... [dylan:~/llvm/tools/clang] admin% cat compound.c int A; long long B; void foo() { A /= B; } [dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang compound.c -parse-ast-dump Read top-level variable decl: 'A' Read top-level variable decl: 'B' void foo() (CompoundStmt 0x2605c40 (BinaryOperator 0x2605c20 'int' '/=' ComputeTy='long long' (DeclRefExpr 0x2605be0 'int' Decl='A' 0x2605a80) (DeclRefExpr 0x2605c00 'long long' Decl='B' 0x2605ab0))) llvm-svn: 41364
-
Ted Kremenek authored
subclass of Stmt will implement child_begin() and child_end(), which will be used to iterate over all the children (subexpressions/substatements) of a Stmt object. This will provide for easy traversal over the AST, which is useful for a variety of purposes. None of the interfaces to subclasses of Stmt will be changed (other than adding the child_begin and child_end methods). The only caveat is that the implementation of subclasses of Stmt will require colocating all substatements (subexpressions) in an array. This is because we define child_iterator as Stmt**. All accessor methods to subexpressions will need to be altered to reflect this new implementation. This patch includes the typedefs for child_iterator, as well the implementation for child_begin/child_end for the primary expressions and some postfix expressions. llvm-svn: 41363
-
Steve Naroff authored
Make sure we get extension diagnostics for GCC's complex extensions. Now we emit the following when -pedantic-errors is enabled... [dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang complex.c -pedantic-errors complex.c:4:3: error: ISO C does not support '++'/'--' on complex integer types ++x; ^ ~ complex.c:9:7: error: ISO C does not support '~' for complex conjugation X = ~Y; ^ complex.c:10:7: error: ISO C does not support '~' for complex conjugation x = ~y; ^ llvm-svn: 41362
-
Chris Lattner authored
llvm-svn: 41361
-
Chris Lattner authored
llvm-svn: 41360
-
Chris Lattner authored
llvm-svn: 41359
-
Devang Patel authored
condition predicate is GT or GE then execute false branch first. llvm-svn: 41358
-
Devang Patel authored
llvm-svn: 41357
-
Devang Patel authored
llvm-svn: 41356
-
Chris Lattner authored
This patch temporarily breaks compound assignment operators, but greatly simplifies many things. llvm-svn: 41355
-
Devang Patel authored
llvm-svn: 41354
-
Dale Johannesen authored
llvm-svn: 41353
-
Chris Lattner authored
llvm-svn: 41352
-
Chris Lattner authored
llvm-svn: 41350
-
Chris Lattner authored
llvm-svn: 41349
-
Dale Johannesen authored
Interface to rest of the compiler unchanged, as yet. llvm-svn: 41348
-
Chris Lattner authored
llvm-svn: 41347
-
Chris Lattner authored
llvm-svn: 41346
-
Chris Lattner authored
llvm-svn: 41345
-
Chris Lattner authored
llvm-svn: 41344
-
Chris Lattner authored
fixes an assertion on: void f (int z) { switch (z) { case ~0ULL: case -1: return; } } testcase from Neil. llvm-svn: 41343
-
Steve Naroff authored
Support '~' for complex conjugation. This is a GCC extension. This following now compiles without error... _Complex unsigned X, Y; _Complex double x, y; void test2(int c) { X = ~Y; x = ~y; } llvm-svn: 41341
-
- Aug 23, 2007
-
-
Chris Lattner authored
llvm-svn: 41340
-
Chris Lattner authored
"case sizeof x:" instead of: "case sizeofx:" llvm-svn: 41339
-