summaryrefslogtreecommitdiffstats
path: root/clang/AST/ASTContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Put back the flags field in the constant CF string type.Anders Carlsson2007-11-191-5/+7
| | | | llvm-svn: 44222
* Modified ASTContext::getTagDeclType() to accept a NULL pointer for the passedTed Kremenek2007-11-141-4/+11
| | | | | | | | | | | | in TagDecl*. This allows the deserializer to use ASTContext to create the TagTypes. Deserialize TagTypes then rely on pointer-backpatching to resolve the decls. This may not be the interface that we want, but as the implementation of TagTypes will potentially change significantly in the future, I'm leaving this for now. An appropriate FIXME is in place. llvm-svn: 44089
* Type encoding for structs.Fariborz Jahanian2007-11-131-1/+11
| | | | llvm-svn: 44087
* Rewrote type serialization to used the same methodology as we do for Decls.Ted Kremenek2007-11-131-276/+5
| | | | | | | | Removed tons of dead code in ASTContext concerning how types use to be serialized. Removed serialization methods from QualType that are no longer used. llvm-svn: 44070
* Renamed all serialization "Materialize" methods to "Create" to conform withTed Kremenek2007-11-131-2/+2
| | | | | | the new serialization API. llvm-svn: 44035
* Teach ASTContext::tagTypesAreCompatible() about the built-in ObjC types ↵Steve Naroff2007-11-071-0/+4
| | | | | | (Class and id), removing a bogus warning. llvm-svn: 43809
* Started work on new serialization approach within ASTContext toTed Kremenek2007-11-061-1/+106
| | | | | | | | | | | serialize Type objects in the order they are serialized in the Types vector. We also now rely on the methods within ASTContext to unique Type objects and handle the actual creation of Type objects (these are now called by the deserialization code). This approach solves some hairy issues with ownership of objects and allows us to naturally handle recursive types. llvm-svn: 43787
* Misc. serialization changes to ASTContext and Decls. SerializationTed Kremenek2007-11-061-15/+15
| | | | | | for ASTContext is still rapidly evolving. llvm-svn: 43774
* For serialization of ASTContext, added special-casing of serializationTed Kremenek2007-11-051-2/+33
| | | | | | | | | of type sets when emitting complex types and pointer types that are also considered builtins. These types are automatically created in the ctor of ASTContext, and thus should not be serialized (was producing an error during deserialization). llvm-svn: 43733
* Implement rewrite rules for ObjC string constants.Steve Naroff2007-11-031-9/+6
| | | | llvm-svn: 43665
* Rename classes and collections that maintain record layout information.Devang Patel2007-11-011-8/+8
| | | | | | | Now, at AST level record info is maintained by ASTRecordLayout class. Now, at code gen level record info is maintained by CGRecordLayout class. llvm-svn: 43619
* Implemented serialization of QualTypes within ASTContext. ClarifiedTed Kremenek2007-11-011-2/+21
| | | | | | | | | ownership model of some type pointers. Added FIXMEs to serialization. Added comments to ASTContext indicating which variables we are intentionally *not* serializing. llvm-svn: 43618
* Remaining work to collect objective-c's type qualifiers and use them to encodeFariborz Jahanian2007-11-011-2/+21
| | | | | | method types. llvm-svn: 43617
* Changed serialization/deserialization of BuiltinTypes to explicitly serializeTed Kremenek2007-11-011-17/+53
| | | | | | | each type. This ensures that the order in which the types are serialized is clear and remains persistent. llvm-svn: 43615
* add support for vector type compatibility checking. Patch by Nate Begeman.Chris Lattner2007-11-011-1/+15
| | | | llvm-svn: 43604
* Implemented more of serialization/deserialization for ASTContext. We nowTed Kremenek2007-10-311-17/+93
| | | | | | (hypothetically) read in/write out most of the types. Bugs likely exist. llvm-svn: 43584
* Adjusted QualType deserialization to reflect updated deserialization API.Ted Kremenek2007-10-311-4/+4
| | | | | | We now serialize ivar references inside of ASTContext. llvm-svn: 43571
* Implemented serialization of Variable Array Types (VLAs).Ted Kremenek2007-10-311-5/+5
| | | | llvm-svn: 43561
* Renamed ivar "ArrayTypes" in ASTContext to "ComplexArrayTypes".Ted Kremenek2007-10-311-3/+48
| | | | | | Added skeleton code for serialization of ASTContext. llvm-svn: 43558
* Encode Class, SEL and Objective-C objects.Anders Carlsson2007-10-311-1/+24
| | | | llvm-svn: 43540
* minor code cleanupChris Lattner2007-10-301-4/+2
| | | | llvm-svn: 43512
* Added type encoding for 'id' type.Fariborz Jahanian2007-10-301-0/+4
| | | | llvm-svn: 43504
* Added vector to ASTContext to store references to "complete" VLA typesTed Kremenek2007-10-301-3/+3
| | | | | | | (VLAs with a specified size expresssion). This vector owns the references to these type objects. llvm-svn: 43502
* Handle function types.Anders Carlsson2007-10-301-0/+2
| | | | llvm-svn: 43485
* VariableArrayTypes (VLAs) without a size expression are now uniquedTed Kremenek2007-10-291-5/+43
| | | | | | and inserted into a FoldingSet owned by ASTContext. llvm-svn: 43482
* Encoding for objectiive-c methods.Fariborz Jahanian2007-10-291-0/+57
| | | | llvm-svn: 43481
* Address Chris's comments.Anders Carlsson2007-10-291-10/+16
| | | | llvm-svn: 43445
* Fix logic error.Anders Carlsson2007-10-291-1/+1
| | | | llvm-svn: 43443
* Add (partial) support for @encode.Anders Carlsson2007-10-291-0/+100
| | | | llvm-svn: 43439
* Implementation of AST for @protocol expression.Fariborz Jahanian2007-10-171-0/+11
| | | | llvm-svn: 43075
* Patch to implement AST generation for objective-c's @selector expression.Fariborz Jahanian2007-10-161-0/+14
| | | | llvm-svn: 43038
* Change the type of ObjCStringLiteral from "struct __builtin_CFString *" to ↵Steve Naroff2007-10-151-0/+8
| | | | | | | | | | "NSConstantString *". This makes the typecheck much happier. Without this change, the type checker would have to special case "struct __builtin_CFString *". This change does assume the interface for NSConstantString is declared in the translation unit. I left ASTContext::getCFConstantStringType() around for now (with a comment that says it is currently unused). llvm-svn: 43021
* Move type compatibility predicates from Type to ASTContext. In addition, the ↵Steve Naroff2007-10-151-0/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | predicates are now instance methods (they were previously static class methods on Type). This allowed me to fix the following hack from this weekend... // FIXME: Devise a way to do this without using strcmp. // Would like to say..."return getAsStructureType() == IdStructType;", but // we don't have a pointer to ASTContext. bool Type::isObjcIdType() const { if (const RecordType *RT = getAsStructureType()) return !strcmp(RT->getDecl()->getName(), "objc_object"); return false; } ...which is now... bool isObjcIdType(QualType T) const { return T->getAsStructureType() == IdStructType; } Side notes: - I had to remove a convenience function from the TypesCompatibleExpr class. int typesAreCompatible() const {return Type::typesAreCompatible(Type1,Type2);} Which required a couple clients get a little more verbose... - Result = TCE->typesAreCompatible(); + Result = Ctx.typesAreCompatible(TCE->getArgType1(), TCE->getArgType2()); Overall, I think this change also makes sense for a couple reasons... 1) Since ASTContext vends types, it makes sense for the type compatibility API to be there. 2) This allows the type compatibility predeciates to refer to data not strictly present in the AST (which I have found problematic on several occasions). llvm-svn: 43009
* Added ASTContext::setObjcIdType/getObjcIdType(), set by Sema.Steve Naroff2007-10-151-0/+18
| | | | | | Also noticed ASTContext::BuiltinVaListType wasn't being initialized to the null type (so I set it). llvm-svn: 42983
* slightly simplify interfaceChris Lattner2007-10-111-3/+2
| | | | llvm-svn: 42858
* Add __builtin_va_start to the list of builtins, make __builtin_va_list ↵Anders Carlsson2007-10-111-0/+8
| | | | | | available to builtin functions. llvm-svn: 42857
* Patch to create protocol conforming class types.Fariborz Jahanian2007-10-111-0/+25
| | | | llvm-svn: 42856
* Make sure methods with no return type default to "id".Steve Naroff2007-10-091-1/+0
| | | | | | | | | | This fixes a crasher in Sema::MatchTwoMethodDeclarations(), identified by selector-overload.m (just added). Added Action::ActOnTranslationUnitScope() and renamed Action::PopScope to ActOnPopScope. Added a Translation Unit Scope instance variable to Sema (will be very useful to ObjC-related actions, since ObjC declarations are always file-scoped). llvm-svn: 42817
* remove unneeded #includeChris Lattner2007-10-071-1/+0
| | | | llvm-svn: 42731
* move IdentifierTable.h from liblex to libbasic.Chris Lattner2007-10-071-1/+0
| | | | llvm-svn: 42730
* Move ObjC decls to DeclObjC.h, a new AST header.Steve Naroff2007-10-011-0/+1
| | | | | | Update clients and add to project file. llvm-svn: 42494
* Use APFloat for the representation of FP immediates, ask the targetChris Lattner2007-09-221-3/+4
| | | | | | for *which* apfloat to use for a particular type. llvm-svn: 42234
* Remove SelectorTable/SelectorInfo, simply store all selectors in the central ↵Steve Naroff2007-09-191-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | IdentifierTable. Rationale: We currently have a separate table to unique ObjC selectors. Since I don't need all the instance data in IdentifierInfo, I thought this would save space (and make more sense conceptually). It turns out the cost of having duplicate entries for unary selectors (i.e. names without colons) outweighs the cost difference between the IdentifierInfo & SelectorInfo structures. Here is the data: Two tables: *** Selector/Identifier Stats: # Selectors/Identifiers: 51635 Bytes allocated: 1999824 One table: *** Identifier Table Stats: # Identifiers: 49500 Bytes allocated: 1990316 llvm-svn: 42139
* Add support for ObjC keyword selectors.Steve Naroff2007-09-171-1/+17
| | | | | | | | | | - Add SelectorInfo/SelectorTable classes, modeled after IdentifierInfo/IdentifierTable. - Add SelectorTable instance to ASTContext, created lazily through ASTContext::getSelectorInfo(). - Add SelectorInfo slot to ObjcMethodDecl. - Add helper function to derive a SelectorInfo from ObjcKeywordInfo. Misc: Got the Decl stats stuff up and running again...it was missing support for ObjC AST's. llvm-svn: 42023
* fix some warnings, patch by Justin HandvilleChris Lattner2007-09-161-0/+3
| | | | llvm-svn: 42010
* Now that the dust has settled on the Decl refactoring, I noticed FieldDecl ↵Steve Naroff2007-09-141-1/+1
| | | | | | | | didn't need NextDeclarator. As a result, I'm removing it. Removing both slots (NextDeclarator/Next) end up reducing the size of fields/ivars by 40%. llvm-svn: 41948
* get rid of ugly "warning: no newline at end of file"Gabor Greif2007-09-111-1/+1
| | | | | | warnings that some compilers diagnose llvm-svn: 41847
* The goal of this commit is to get just enough Sema support to recognize ↵Steve Naroff2007-09-061-0/+10
| | | | | | | | | | | Objective-C classes as types. That said, the AST nodes ObjcInterfaceDecl, ObjcInterfaceType, and ObjcClassDecl are *very* preliminary. The good news is we no longer need -parse-noop (aka MinimalActions) to parse cocoa.m. llvm-svn: 41752
* Fix a comment.Steve Naroff2007-08-301-3/+2
| | | | llvm-svn: 41618
* Polish yesterday's Array/ConstantArray/VariableArray rewrite, removing a ↵Steve Naroff2007-08-301-20/+15
| | | | | | | | | couple FIXME's. Refactored Array/VariableArray, moving SizeModifier/IndexTypeQuals back up to Array. These attributes are not specific to VLA's. Most of them are specific to array parameter types. llvm-svn: 41616
OpenPOWER on IntegriCloud