- Apr 28, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: Minor change to assert logic. llvm-svn: 39422
-
- Apr 27, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: - Disabled -pedantic for now (until it ignores system headers). - Removed convertSignedWithGreaterRankThanUnsigned() and convertFloatingRankToComplexType(). The logic is now inlined in maxIntegerType and maxComplexType(). - Removed getIntegerRank/getFloatingRank from the private interface. These are now really private helpers:-) - Declare maxIntegerType/maxFloatingType static. maxComplexType const. - Added an enum for the floating ranks. - Several fixed to getIntegerRank: add Bool, Char, and a clause for enums. llvm-svn: 39421
-
Steve Naroff authored
Submitted by: Reviewed by: More typechecking, refactoring... - Implemented the following routines...CheckAdditiveOperands, CheckCommaOperands, CheckLogicalOperands. - Added maxComplexType, maxFloatingType, & maxIntegerType to ASTContext. Ranking helper functions moved to ASTContext as well (they are private:-) - Simplified UsualArithmeticConversions using the new ASTContext hooks. - Fixed isAssignmentOp()...is was preventing comma exprs from ever being created:-( - Changed a GCC compat extension to truly be an extension (and turned extensions on by default). This now produces a warning by default. llvm-svn: 39418
-
- Apr 06, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: -Changed the name of TypeRef to QualType. Many diffs. -Changed the QualType constructor to require Quals be passed. This makes the code a bit more verbose, however will make the code easier to work on. Given the complexity of types, this should help spot bogosities. -Changed the Expr constructor to require a QualType. Same motivation. llvm-svn: 39395
-
- Apr 05, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: Fix "FIXME: does this lose qualifiers from the typedef??" in ASTContext::getTypedefType(). This change was fairly pervasive...nevertheless, here are the highlights: - Change the type of Type::CanonicalType to TypeRef (was "Type *"). - Change the implementation of TypeRef::getCanonicalType() to work for typedefs. - Make the implementation of Type::getCanonicalType private (only TypeRef should access). This will force clients to use TypeRef::getCanonicalType (the correct version of the function). Since TypeRef overloads "->", it was very easy to fall into this bug... - Changed many references of "Type *" to "TypeRef"...when the raw type pointer is required, use t.getTypePtr(). - Changed all the *Type classes to take a TypeRef. - Made the Type constructor protected (cleanup). - Removed function Expr::getType(). - Convert functions in SemaExpr to use the above support. This fixed the "const" bug I was originally investigating. I will follow this check-in up with a rename of TypeRef->QualType. I will also make sure the constructor does not default to 0 (which can lead to broken code...). llvm-svn: 39394
-
- Apr 03, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: declare getSizeType() const and fix typo in comment... llvm-svn: 39376
-
Steve Naroff authored
Submitted by: Reviewed by: Incorporate code review feedback from Chris... - minor restructure of ParseMemberReferenceExpr logic. The last statement is now the instantiation of the AST node (which I like a lot and will conform to throughout Sema). - declare StmtClassNameTable const. - reword an error diagnostic. - install the correct type for ParseSizeOfAlignOfTypeExpr. Added hook in ASTContext. For now, simply return Context.UnsignedLongTy. Added a FIXME to revisit (i.e. compute using TargetInfo). llvm-svn: 39374
-
- Mar 26, 2007
-
-
Chris Lattner authored
llvm-svn: 39363
-
- Mar 23, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: Type Checking...round 2. This checkin "breaks" parsing carbon.h. I imagine that this will be true for the next week or so. Nevertheless, this round of changes includes the following: - Hacked various Expr classes to pass the appropriate TypeRef. Still have a few more classes to touch. - Implement type checking for ParseArraySubscriptExpr and ParseMemberReferenceExpr. - Added a debug hook to derive the class name for Stmt/Expr nodes. Currently a linear search...could easily optimize if important. - Changed the name of TaggedType->TagType. Now we have TagType and TagDecl (which are easier to remember). - Fixed a bug in StringLiteral conversion I did a couple weeks ago. hadError was not initialized (oops). - changed Sema::Diag to return true. This streamlines the type checking code considerably. - Added many diagnositics. This should be it! llvm-svn: 39361
-
- Mar 16, 2007
-
-
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: 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
-
- Feb 28, 2007
-
-
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 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
-
- 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
-
- Jan 27, 2007
-
-
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
"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
-
- Jan 23, 2007
-
-
Chris Lattner authored
converting a declspec with TST = struct/union. Pretty print as well. llvm-svn: 39284
-
- Jan 22, 2007
-
-
Chris Lattner authored
Make name lookup properly obey C namespaces, simplify decl construction byeliminating the 'next' pointer from the ctor, and add initial support forparsing struct/union tags. llvm-svn: 39266
-
- Dec 03, 2006
-
-
Chris Lattner authored
instead of having a string. llvm-svn: 39237
-
- Dec 02, 2006
-
-
Chris Lattner authored
This lets us pretty print stuff like this: void foo() { int X; X = sizeof(void (*(*)())()); X = sizeof(int(*)(int, float, ...)); X = sizeof(void (*(int arga, void (*argb)(double Y)))(void* Z)); as: X = sizeof(void (*(*)())()) X = sizeof(int (*)(int, float, ...)) X = sizeof(void (*(int, void (*)(double)))(void *)) Ah the wonders of 'modern' C syntax! llvm-svn: 39232
-
- Nov 20, 2006
-
-
Chris Lattner authored
allows us to handle stuff like: typedef int G; .. X = sizeof(G); llvm-svn: 39189
-
- Nov 12, 2006
-
-
Chris Lattner authored
This allows us to handle: int (*A)[restrict static 4][6]; for example. llvm-svn: 39176
-
Chris Lattner authored
llvm-svn: 39175
-
Chris Lattner authored
Teach getPointerType to (stupidly) memoize all created pointers. Give types an enum so we can implement classof. llvm-svn: 39174
-
Chris Lattner authored
parse (and print) things like: int* const* restrict* const volatile*** etc. llvm-svn: 39173
-
- Nov 11, 2006
-
-
Chris Lattner authored
llvm-svn: 39166
-
- Nov 10, 2006
-
-
Chris Lattner authored
llvm-svn: 39164
-
Chris Lattner authored
llvm-svn: 39162
-
- Oct 25, 2006
-
-
Chris Lattner authored
llvm-svn: 39048
-
- Oct 16, 2006
-
-
Chris Lattner authored
llvm-svn: 38991
-
- Aug 17, 2006
-
-
Chris Lattner authored
llvm-svn: 38935
-
Chris Lattner authored
llvm-svn: 38933
-
- Jul 29, 2006
-
-
Chris Lattner authored
llvm-svn: 38784
-