- Jul 18, 2007
-
-
Steve Naroff authored
First round of extended vector support. Here is an overview... - added ocu_vector_type attribute, Sema::HandleOCUVectorTypeAttribute(). - added new AST node, OCUVectorType, a subclass of VectorType. - added ASTContext::getOCUVectorType. - changed ASTContext::convertToVectorType() to ASTContext::getVectorType(). This is unrelated to extended vectors, however I was in the vicinity and it was on my todo list. Added a FIXME to Sema::HandleVectorTypeAttribute to deal with converting complex types. llvm-svn: 40007
-
Chris Lattner authored
hooked up to anything, so it's not very useful yet. llvm-svn: 40006
-
Chris Lattner authored
llvm-svn: 39996
-
- Jul 16, 2007
-
-
Chris Lattner authored
not all builtin types have size and alignment equal to pointers :) llvm-svn: 39887
-
- Jul 14, 2007
-
-
Chris Lattner authored
compute type alignment. This info is needed for struct layout. llvm-svn: 39850
-
Chris Lattner authored
llvm-svn: 39838
-
Chris Lattner authored
llvm-svn: 39837
-
Chris Lattner authored
where ASTContext can manage caches for struct layout, etc. llvm-svn: 39835
-
- Jul 13, 2007
-
-
Chris Lattner authored
Keith Bauer. llvm-svn: 39793
-
- Jul 07, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: - Finished semantic analysis for vectors, added some diagnostics. - Added AST for vectors (instantiation, installation into the decl). - Fixed bug in ParseArraySubscriptExpr()...this crasher was introduced by me when we added the range support. - Turned pedantic off by default. Since vectors are gcc extensions, having pedantic on by default was annoying. Turning it off by default is also consistent with gcc (but this wasn't my primary motivation). - Tweaked some comments and diagnostics. Note: The type checking code is still under construction (for vectors). This will be my next check-in. llvm-svn: 39715
-
- Jun 22, 2007
-
-
Chris Lattner authored
types. llvm-svn: 39672
-
- Jun 16, 2007
-
-
Chris Lattner authored
out of the llvm namespace. This makes the clang namespace be a sibling of llvm instead of being a child. The good thing about this is that it makes many things unambiguous. The bad things is that many things in the llvm namespace (notably data structures like smallvector) now require an llvm:: qualifier. IMO, libsystem and libsupport should be split out of llvm into their own namespace in the future, which will fix this issue. llvm-svn: 39659
-
- Jun 03, 2007
-
-
Chris Lattner authored
'char', which varies based on the target. Instead of spreading target knowledge throughout the compiler, bifurcate char into Char_S and Char_U, and have ASTContext create the right one based on the target, when it starts up. llvm-svn: 39577
-
- May 27, 2007
-
-
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
llvm-svn: 39488
-
Chris Lattner authored
llvm-svn: 39487
-
- 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
-
- May 21, 2007
-
-
Chris Lattner authored
llvm-svn: 39472
-
- 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
-