summaryrefslogtreecommitdiffstats
path: root/clang/clang.xcodeproj
Commit message (Collapse)AuthorAgeFilesLines
...
* detect and diagnose empty case ranges:Chris Lattner2007-08-231-1/+1
| | | | | | | | switch.c:16:8: warning: empty case range specified case 100 ... 99: ; // expected-warning {{empty case range}} ^~~~~~~~~~ llvm-svn: 41328
* Parse ObjC @protocol expressions.Anders Carlsson2007-08-231-1/+1
| | | | llvm-svn: 41320
* add cfg.h/cfg.cpp to the xcode project at Ted's request.Chris Lattner2007-08-211-0/+8
| | | | llvm-svn: 41253
* minor nicities.Chris Lattner2007-08-211-1/+0
| | | | llvm-svn: 41244
* Implement parsing and code generation of Objective-C string literals.Anders Carlsson2007-08-211-0/+5
| | | | llvm-svn: 41238
* Split complex arithmetic codegen out from aggregate codegen.Chris Lattner2007-08-211-0/+4
| | | | | | | | | | | | | | | | This means that we get rid of tons of intermediate allocas. For example: void foo(double _Complex a, double _Complex b) { a = b+a+a; } this used to have 4 temporary allocas, now it has zero of them. This also simplifies the individual visitor methods because they now can all operate on real/imag pairs instead of having to load/store all over the place. llvm-svn: 41217
* Switch StmtVisitor from using dynamic to static dispatch. This makes it Chris Lattner2007-08-211-5/+0
| | | | | | | significantly faster and actually reduces the amount of code in the system. This also allows for future visitor changes. llvm-svn: 41211
* Implement code generation for constant CFStrings.Anders Carlsson2007-08-211-0/+6
| | | | llvm-svn: 41206
* initial support for checking format strings, patch by Ted Kremenek:Chris Lattner2007-08-101-0/+4
| | | | | | "I've coded up some support in clang to flag warnings for non-constant format strings used in calls to printf-like functions (all the functions listed in "man fprintf"). Non-constant format strings are a source of many security exploits in C/C++ programs, and I believe are currently detected by gcc using the flag -Wformat-nonliteral." llvm-svn: 41003
* New file, just a placeholder for now.Chris Lattner2007-08-101-0/+4
| | | | llvm-svn: 41002
* add a new AST dumper interface (E->dump()). This dumps outChris Lattner2007-08-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | the AST in a structural, non-pretty, form useful for understanding the AST. It isn't quite done yet, but is already somewhat useful. For this example: int test(short X, long long Y) { return X < ((100)); } we get (with -parse-ast-dump): int test(short X, long long Y) (CompoundStmt 0x2905ce0 (ReturnStmt 0x2905cd0 (BinaryOperator 0x2905cb0 '<' (ImplicitCastExpr 0x2905ca0 (DeclRefExpr 0x2905c20 Decl='X' 0x2905bb0)) (ParenExpr 0x2905c80 (ParenExpr 0x2905c60 (IntegerLiteral 0x2905c40 100)))))) llvm-svn: 40954
* Implement codegen for __builtin_choose_expr. For example:Chris Lattner2007-08-041-1/+1
| | | | | | | | | | | | | | | | | | | struct X { int A; }; void foo() { struct X s; int i; i = __builtin_choose_expr(0, s, i); } compiles to: %tmp = load i32* %i ; <i32> [#uses=1] store i32 %tmp, i32* %i wow :) llvm-svn: 40801
* Add a test case to validate code gen for typeof/builtin_types_compatible.Steve Naroff2007-08-031-1/+1
| | | | | | | | | | | | | | | This test case currently generates the following unexpected warnings (when compared with gcc). [dylan:clang/test/Parser] admin% ../../../../Debug/bin/clang -parse-ast-check builtin_types_compatible.c Warnings seen but not expected: Line 28: expression result unused Line 29: expression result unused Line 30: expression result unused Line 31: expression result unused Line 32: expression result unused Line 33: expression result unused llvm-svn: 40789
* add internals manual to projectChris Lattner2007-07-311-0/+4
| | | | llvm-svn: 40645
* add two missing files to the xcode project.Chris Lattner2007-07-311-0/+8
| | | | llvm-svn: 40643
* make isPointerType() a pure predicate, rename theChris Lattner2007-07-311-1/+1
| | | | | | existing one to getAsPointerType() llvm-svn: 40639
* Add parsing and AST support for GNU "typeof".Steve Naroff2007-07-311-1/+1
| | | | | | | Many small changes to lot's of files. Still some FIXME's, however the basic support is in place. llvm-svn: 40631
* Fix Sema::ParseCallExpr()...it wasn't doing the default array/function ↵Steve Naroff2007-07-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | promotions on it's argument types. This resulted in the following errors when compiling promote_types_in_proto.c test... [dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang test/Parser/promote_types_in_proto.c test/Parser/promote_types_in_proto.c:7:24: error: incompatible types passing 'char *[]' to function expecting 'char *const []' arrayPromotion(argv); ~~~~~~~~~~~~~~ ^~~~ test/Parser/promote_types_in_proto.c:8:27: error: incompatible types passing 'void (char *const [])' to function expecting 'void (char *const [])' functionPromotion(arrayPromotion); ~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~ 2 diagnostics generated. When fixing this, noticed that both ParseCallExpr() and ParseReturnStmt() were prematurely comparing types for equivalence. This is incorrect (since the expr. promotions haven't been done yet). To fix this, I moved the check "down" to Sema::CheckAssignmentConstraints(). I also converted Type::isArrayType() to the modern API (since I needed it). Still more Type predicates to convert. llvm-svn: 40475
* Add a cache to SourceManager to accellerate line # lookup. This is aChris Lattner2007-07-241-1/+1
| | | | | | | | | | | bottleneck for -E computation, because every token that starts a line needs to determine *which* line it is on (so -E mode can insert the appropriate vertical whitespace). This optimization improves this common case where it is striding through the line # table. This speeds up -E on xalancbmk by 3.2% llvm-svn: 40459
* Fix a really subtle bug in the macro expander caching code, whereChris Lattner2007-07-221-1/+1
| | | | | | | redefinition of a macro could cause invalid memory to be deleted. Found preprocessing 253.perlbmk. llvm-svn: 40380
* Minor simplification to Expr::isLvalue().Steve Naroff2007-07-211-1/+1
| | | | llvm-svn: 40375
* Update project for LexerToken.h -> Token.hChris Lattner2007-07-201-4/+4
| | | | llvm-svn: 40106
* initial layout support for structures and unions. This isn't actuallyChris Lattner2007-07-181-0/+4
| | | | | | hooked up to anything, so it's not very useful yet. llvm-svn: 40006
* Change DefaultFunctionArrayConversions and UsualUnaryConversions to return ↵Steve Naroff2007-07-161-1/+1
| | | | | | | | | void. The caller needs to query the expression for the type. Since both these functions guarantee the expression contains a valid type, removed old/vacuous asserts (from code calling both of these routines). llvm-svn: 39930
* Make octal constant lexing use AdvanceToTokenCharacter to give moreChris Lattner2007-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | accurate diagnostics. For test/Lexer/comments.c we now emit: int x = 000000080; /* expected-error {{invalid digit}} */ ^ constants.c:7:4: error: invalid digit '8' in octal constant 00080; /* expected-error {{invalid digit}} */ ^ The last line is due to an escaped newline. The full line looks like: int y = 0000\ 00080; /* expected-error {{invalid digit}} */ Previously, we emitted: constants.c:4:9: error: invalid digit '8' in octal constant int x = 000000080; /* expected-error {{invalid digit}} */ ^ constants.c:6:9: error: invalid digit '8' in octal constant int y = 0000\ ^ which isn't too bad, but the new way is better for the user, regardless of whether there is an escaped newline or not. All the other lexer-related diagnostics should switch over to using AdvanceToTokenCharacter where appropriate. Help wanted :). This implements test/Lexer/constants.c. llvm-svn: 39906
* "Someone typed "PtrToInt" where they meant "IntToPtr".Chris Lattner2007-07-131-1/+1
| | | | | | | | | I've added a tests/CodeGen directory, and a test for this case that used to fail and now passes." Patch by Keith Bauer llvm-svn: 39794
* Two changes...Steve Naroff2007-07-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | - Teach all the integer/float predicates on Type about Vectors. - Disallow bitwise compliment on float vectors. For example... typedef float __attribute__(( vector_size(16) )) float4; float4 float4_return() { float4 xx; return ~xx; } ...now emits the following diagnostic... [administrators-powerbook59:~/llvm/tools/clang] admin% ../../Debug/bin/clang bug.c bug.c:8:12: error: invalid argument type to unary expression 'float4' return ~xx; ^ 1 diagnostic generated. llvm-svn: 39791
* Bug #:Steve Naroff2007-07-111-8/+0
| | | | | | | | | | | | | Submitted by: Reviewed by: Removed Attr.[h,cpp]...they didn't have any useful content. When more (GCC) attributes are added, we might want to create a file of this ilk. For now, it's better to remove them (to eliminate any confusion). I also update the Xcode project file... llvm-svn: 39729
* remove diagchecker.h, add more missing files.Chris Lattner2007-06-281-4/+8
| | | | llvm-svn: 39702
* add diag checker to xcode projChris Lattner2007-06-271-0/+8
| | | | llvm-svn: 39691
* implement lowering of complex typesChris Lattner2007-06-221-1/+1
| | | | llvm-svn: 39668
* implement codegen of the relational operationsChris Lattner2007-06-201-1/+1
| | | | | | One major FIXME though. llvm-svn: 39666
* add new files to xcode projectChris Lattner2007-06-161-0/+8
| | | | llvm-svn: 39662
* Update the xcode project for billChris Lattner2007-06-131-3/+11
| | | | llvm-svn: 39651
* Bug #:Steve Naroff2007-06-091-2/+2
| | | | | | | | Submitted by: Reviewed by: Move Attr.h to the correct group in the Xcode project file... llvm-svn: 39630
* Bug #:Steve Naroff2007-06-091-0/+8
| | | | | | | | | | Submitted by: Reviewed by: Lot's of attribute scaffolding. Modernized ParseArraySubscriptExpr...call DefaultFunctionArrayConversion (which simplified the logic considerably) and upgrade Diags to use the range support. llvm-svn: 39628
* add a new text file for low-prio QOI todosChris Lattner2007-06-081-0/+4
| | | | llvm-svn: 39606
* Emit better diagnostics for out of range digits:Chris Lattner2007-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | diag.c:1:9: error: invalid digit '8' in octal constant int x = 000080; ^ diag.c:2:9: error: invalid digit 'A' in decimal constant int z = 1000080ABC; ^ instead of: diag.c:1:9: error: invalid suffix '80' on integer constant int x = 000080; ^ diag.c:2:9: error: invalid suffix 'ABC' on integer constant int z = 1000080ABC; ^ llvm-svn: 39605
* Submitted by: Bill WendlingBill Wendling2007-06-071-24/+9
| | | | | | | | | | Reviewed by: Chris Lattner - Separated out the diagnostic client from the clang driver. This is in preparation for creating a diagnostic client that will be used to check error and warning messages. llvm-svn: 39603
* Bug #:Steve Naroff2007-06-061-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Submitted by: Reviewed by: The following code illustrates a bug in the semantic analysis for assignments: int func() { int *P; char *x; P = x; // type of this assignment expression should be "int *", NOT "char *". } While the type checking/diagnostics are correct, the type of the assignment expression is incorrect (which shows up during code gen). With the fix, the llvm code looks correct... [dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang cast.c -emit-llvm cast.c:4:5: warning: incompatible pointer types assigning 'char *' to 'int *' P = x; // type of assignment expression is "int *", NOT "char *". ~ ^ ~ ; ModuleID = 'foo' define i32 @func() { entry: %P = alloca i32* ; <i32**> [#uses=1] %x = alloca i8* ; <i8**> [#uses=1] %allocapt = bitcast i32 undef to i32 ; <i32> [#uses=0] %tmp = load i8** %x ; <i8*> [#uses=1] %conv = bitcast i8* %tmp to i32* ; <i32*> [#uses=1] store i32* %conv, i32** %P ret i32 undef } Even though the fix was simple, I decided to rename/refactor the surrounding code to make a clearer distinction between constraint checking and conversion. - Renamed AssignmentConversionResult -> AssignmentCheckResult. - Renamed UsualAssignmentConversions -> CheckAssignmentConstraints. - Changed the return type of CheckAssignmentConstraints and CheckPointerTypesForAssignment from QualType -> AssignmentCheckResult. These routines no longer take a reference to the result (obviously). - Changed CheckAssignmentOperands to return the correct type (with spec annotations). llvm-svn: 39601
* implement support for casts to/from pointers.Chris Lattner2007-06-061-24/+1
| | | | llvm-svn: 39595
* xcode randomly changed the project, who knows what this doesChris Lattner2007-06-051-1/+1
| | | | llvm-svn: 39594
* Bug #:Steve Naroff2007-06-051-0/+23
| | | | | | | | Submitted by: Reviewed by: Touch up a couple comments (one was incorrect/out-of-date). llvm-svn: 39589
* implement codegen of while stmts and lvalue evaluation of paren exprs :)Chris Lattner2007-06-051-23/+0
| | | | llvm-svn: 39582
* Bug #:Steve Naroff2007-06-031-0/+23
| | | | | | | | | | | | | | | | | | | Submitted by: Reviewed by: Apply UsualUnaryConversion() to statement conditions that expect scalars. UsualUnaryConversion() converts function/arrays to pointers. This fixes the following... int func() { int A[10]; while (A) { } if (A) ; for (; A; ) ; } llvm-svn: 39580
* Implement scaffolding for lvalues. Implement block vardecl lvalues.Chris Lattner2007-06-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to translate: int func() { register int X; { int Y; return 1+X+Y; } } into: define i32 @func() { entry: %X = alloca i32 ; <i32*> [#uses=1] %Y = alloca i32 ; <i32*> [#uses=1] %allocapt = bitcast i32 undef to i32 ; <i32> [#uses=0] %tmp = load i32* %X ; <i32> [#uses=1] %tmp1 = add i32 1, %tmp ; <i32> [#uses=1] %tmp2 = load i32* %Y ; <i32> [#uses=1] %tmp3 = add i32 %tmp1, %tmp2 ; <i32> [#uses=1] ret i32 %tmp3 ; No predecessors! ret i32 undef } llvm-svn: 39555
* reorder files alphabeticallyChris Lattner2007-06-021-1/+1
| | | | llvm-svn: 39551
* add new files.Chris Lattner2007-06-021-23/+8
| | | | llvm-svn: 39544
* Bug #:Steve Naroff2007-06-011-0/+23
| | | | | | | | | | | | | | | Submitted by: Reviewed by: Implement support for GCC __attribute__. - Implement "TODO" in Parser::ParseAttributes. Changed the return type from void to Parser::DeclTy. Changed all call sites to accept the return value. - Added Action::ParseAttribute and Sema::ParseAttribute to return an appropriate AST node. Added new node AttributeDecl to Decl.h. Still to do...hook up to the Decl... llvm-svn: 39539
* Implement conversion of clang ast types to LLVM types, at least for some trivialChris Lattner2007-05-291-23/+0
| | | | | | cases. llvm-svn: 39519
OpenPOWER on IntegriCloud