- Mar 16, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: Down to 0 warning/errors for Carbon.h. Also made a couple trivial name changes... llvm-svn: 39358
-
Steve Naroff authored
Submitted by: Reviewed by: carbon.h looking good! Only 1 warning left...no parse errors! This fixes 3 bugs... - A couple tricky bugs with type canonicalization. Nested typedef's weren't being handled properly. For example, the following didn't work: typdef int __darwin_pid_t; typedef __darwin_pid_t pid_t; int getpgid(pid_t); int getpgid(int); - The storage class wasn't being preserved. As a result, Sema was complaining about the following: extern char *foo; char *foo; - various built-ins weren't registered...resulting in spurious warnings. llvm-svn: 39357
-
- Mar 14, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: This is a "small" checkin. #include_next wasn't working properly on Leopard. This is because the driver has some hard coded paths that don't work on Leopard. The real fix is to derive them, however I don't think we need to solve this now. At this point, anyone working on clang should be able to use Leopard. This fix removed 11 errors processing "carbon.h". The bug that bubbles up to the top is in MergeFunctionDecl(). As part of digging into this part of Sema, I rearranged some methods (and changed the visibility). llvm-svn: 39356
-
Steve Naroff authored
Submitted by: Reviewed by: Added size expression to ArrayType. This was needed to implement Type::isIncompleteType(). At the moment, there is no support for determining if we have a constant expression (which won't be too difficult now that we have support for literal parsing/ast's). Nevertheless, the parser will allow "struct foo { int a[b]; }" (which is illegal). There is still significant work to fully analyze array types. The good news is "carbon.h" goes from 288 bogus errors down to 26! llvm-svn: 39355
-
- Mar 13, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: Move string literal parsing from Sema=>LiteralSupport. This consolidates all the quirky parsing code within the Lexer subsystem (yeah!). This simplifies Sema and (more importantly) allows future parsers (i.e. subclasses of Action) to benefit from this code. llvm-svn: 39354
-
Steve Naroff authored
Submitted by: Reviewed by: Misc. cleanup/polish of NumericLiteralParser and it's two clients, the C preprocessor and AST builder... llvm-svn: 39353
-
Steve Naroff authored
Submitted by: Reviewed by: -Converted the preprocessor to use NumericLiteralParser. -Several minor changes to LiteralSupport interface/implementation. -Added an error diagnostic for floating point usage in pp expr's. llvm-svn: 39352
-
- Mar 10, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: Moved numeric literal support from SemaExpr.cpp to LiteralSupport.[h,cpp] in Lex. This will allow it to be used by both Sema and Preprocessor (and should be the last major refactoring of this sub-system).. Over time, it will be reused by anyone implementing an actions module (i.e. any subclass of llvm::clang::Action. Minor changes to IntegerLiteral in Expr.h. More to come... llvm-svn: 39351
-
- Mar 07, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: Refactored ParseNumericConstant using SkipDigits and friends. This cleaned up the code and removed many "breaks". In the process, I found several bugs that needed to be fixed (proof that this refactoring had real value, not simply aesthetics). Also simplified error handling logic and removed an unused error condition from Diagnostics.def. llvm-svn: 39350
-
- Mar 06, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: More code to parse numeric constants. This checkin includes: - Feedback from Chris. - Support for parsing floating point constants. - Moved the code to "Sema". Changed API in Action. - More/better error diagnostics. At this point, the parsing support should be largely complete. Next step is to work on filling in sensible values (in IntegerLiteral/FloatLiteral). llvm-svn: 39349
-
- Feb 28, 2007
-
-
Steve Naroff authored
Go back to having the clang driver create ASTContext explicitly, passing it to Sema/ASTStreamer (separating the lifetime of ASTContext from the lifetime of Sema). One day it might be useful to consider creating a context object implicitly if one isn't provided (using default arguments in Sema's constructor). At this point, adding this convenience isn't necessary. llvm-svn: 39346
-
Steve Naroff authored
the prerocessor will be available via ASTContext). - Removed the public data member "PP" in ASTContext. - Changed ASTContext's contructor to take TargetInfo/IdentifierTable explicitly. - Implicitly create an ASTContext in Sema's constructor. This simplifies the clients job (and makes ASTContext more private). --As a side effect, added a "PrintStats" hook to Sema. To support this level of encapsulation, ASTContext is always dynamically allocated (by Sema). Previously, ASTContext was being allocated on the stack. I don't believe this should be a performance issue (since ASTContext is fairly course grain and tied to the lifetime of Sema currently). llvm-svn: 39345
-
- Feb 27, 2007
-
-
Steve Naroff authored
This set of changes includes: - convert ExprCXX.h and add to the Xcode project file. -- required adding CXXBoolLiteralExpr to StmtNodes.def. -- required adding visitor support (decl/defn). - make the class codes in StmtNodes.def explicit (to enable range checking). -- this required changing all clients of the STMT macro. - declare the instance data const. llvm-svn: 39344
-
- Feb 26, 2007
-
-
Steve Naroff authored
- adding enum constants & instance data to Stmt. - adding classof() functions to all Stmt's. - modifying contructors to pass the appropriate enum as an arg. Also tightened up a couple "void *" declarations/casts for arrays. llvm-svn: 39343
-
- Feb 22, 2007
-
-
Steve Naroff authored
clang still compiled/linked/ran properly...simply a confusing name regression. From now on I'll make sure I run "cvs diff" before committing any changes! llvm-svn: 39342
-
- Feb 21, 2007
-
-
Steve Naroff authored
rename FloatingConstant->FloatingLiteral rename StringExpr->StringLiteral llvm-svn: 39341
-
- Feb 13, 2007
-
-
Bill Wendling authored
llvm-svn: 39340
-
Bill Wendling authored
llvm-svn: 39338
-
- Feb 11, 2007
-
-
Chris Lattner authored
llvm-svn: 39336
-
- Jan 31, 2007
-
-
Chris Lattner authored
llvm-svn: 39332
-
- Jan 29, 2007
-
-
Chris Lattner authored
of source code. For example: $ clang INPUTS/carbon_h.c -arch i386 -arch ppc prints: ... /usr/lib/gcc/i686-apple-darwin8/4.0.1/include/mmintrin.h:51:3: note: use of a target-specific builtin function, source is not 'portable' __builtin_ia32_emms (); ^ because carbon.h pulls in xmmintrin.h, and __builtin_ia32_emms isn't a builtin on ppc. Though clang now supports target-specific builtins, the full table isn't implemented yet. llvm-svn: 39328
-
- Jan 28, 2007
-
-
Chris Lattner authored
whose decl objects are lazily created the first time they are referenced. Builtin functions are described by the clang/AST/Builtins.def file, which makes it easy to add new ones. This is missing two important pieces: 1. Support for the rest of the gcc builtins. 2. Support for target-specific builtins (e.g. __builtin_ia32_emms). Just adding this builtins reduces the number of implicit function definitions by 6, reducing the # diagnostics from 550 to 544 when parsing carbon.h. I need to add all the i386-specific ones to eliminate several hundred more. ugh. llvm-svn: 39327
-
Chris Lattner authored
llvm-svn: 39326
-
Chris Lattner authored
translation-unit scope, so we only warn about each implicitly defined function once. This cuts the number of errors parsing carbon.h from 616 to 550. llvm-svn: 39325
-
- Jan 27, 2007
-
-
Chris Lattner authored
proto, then a function body, and they have the same type, don't emit an error. This reduces #errors from 654->616 llvm-svn: 39324
-
Chris Lattner authored
int foo; int foo(); llvm-svn: 39323
-
Chris Lattner authored
llvm-svn: 39322
-
Chris Lattner authored
use the folding set. This eliminates 359 slow lookups from carbon.h (the rest) but doesn't substantially speed up parse. llvm-svn: 39320
-
Chris Lattner authored
search. This reduces 'dumb' lookups from 1225 to 359, speeding up parse of carbon.h from 0.173 to 0.156s (10%). llvm-svn: 39319
-
Chris Lattner authored
llvm-svn: 39316
-
Chris Lattner authored
llvm-svn: 39313
-
Chris Lattner authored
"obviously braindead" linear searches. reduces the number of slow type lookups from 10K to 883 on carbon.h, speeding up parsing from 3.5 to 1.26s. llvm-svn: 39312
-
Chris Lattner authored
a foldingset instead. This reduces the number of slow type lookups from 32K to 10K, which speeds up parsing of carbon.h from 11s to 3.5s. llvm-svn: 39311
-
- Jan 26, 2007
-
-
Chris Lattner authored
This speeds up parsing carbon.h from 16.0s to 11.3s, reducing slow lookups from 63K to 32K. llvm-svn: 39308
-
Chris Lattner authored
llvm-svn: 39307
-
Chris Lattner authored
ASTContext::getTagDeclType by not having to do a linear search. With this, parse time for carbon.h drops from 21.8s to 16.0s and # slow lookups drop from 83K to 63K. llvm-svn: 39306
-
Chris Lattner authored
*** AST Context Stats: 30594 types total. 19 builtin types 3929 pointer types 308 array types 18883 function types with proto 8 function types with no proto 2988 typename (typedef) types 4459 tagged types 1476 struct types 80 union types 0 class types 2903 enum types 83298 slow type lookups Next up, making type canonicalization not trivially silly. llvm-svn: 39305
-
Chris Lattner authored
llvm-svn: 39304
-
- Jan 25, 2007
-
-
Chris Lattner authored
struct q { int a, a; }; with: t.c:3:19: error: duplicate member 'a' struct q { int a, a; }; ^ t.c:3:16: error: previous definition is here struct q { int a, a; }; ^ llvm-svn: 39303
-
Chris Lattner authored
This emits these diagnostics: t.c:4:14: error: redefinition of 'a' enum foo22 { a, b }; ^ t.c:3:5: error: previous definition is here int a; ^ t.c:8:17: error: redefinition of enumerator 'b' enum foo23 { c, b }; ^ t.c:4:17: error: previous definition is here enum foo22 { a, b }; ^ 4 diagnostics generated. for: int a; enum foo22 { a, b }; enum foo23 { c, b }; llvm-svn: 39302
-