summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement the interface/implementation layout distinction.Daniel Dunbar2009-05-031-10/+25
| | | | | | | | | | - These routines should now be independent of the Sema state. - This is nearly zero functionality change, the distinction only matters in the non-fragile ABI, and the consumers that care about this distinction should be using getASTObjCImplementationLayout. llvm-svn: 70692
* Split out getASTObjCImplementationLayoutDaniel Dunbar2009-05-031-7/+20
| | | | | | | | | | | - The difference from getASTObjCInterfaceLayout is that the computes the layout including synthesized ivars. - No functionality change, they currently both compute the same thing -- whether that includes synthesized ivars or not depends on when they get called!!! llvm-svn: 70690
* Make a home for exception specs in the AST. Now Sema can hook them up.Sebastian Redl2009-04-301-10/+24
| | | | llvm-svn: 70506
* Properly compute the alignment of typedefs that make use of theDouglas Gregor2009-04-301-8/+42
| | | | | | | | | | | | | | "aligned" attribute. Previously, we were skipping over these attributes when we jumped directly to the canonical type. Now, ASTContext::getTypeInfo walks through typedefs and other "non-canonical" types manually, looking for "aligned" attributes on typedefs. As part of this change, I moved the GNU-specific logic (such as determining the alignment of void or of a function pointer) out of the expression evaluator and into ASTContext::getTypeInfo. llvm-svn: 70497
* int128_t is apparently 128-bit aligned on all 64-bit targets, andChris Lattner2009-04-301-7/+5
| | | | | | | not supported on 32-bit targets, so we can define it to be 128-bit aligned there too :) llvm-svn: 70465
* initial support for __[u]int128_t, which should be basicallyChris Lattner2009-04-301-0/+18
| | | | | | | | compatible with VC++ and GCC. The codegen/mangling angle hasn't been fully ironed out yet. Note that we accept int128_t even in 32-bit mode, unlike gcc. llvm-svn: 70464
* Remove getIntegerConstantExprValue in favor of using EvaluateAsInt.Eli Friedman2009-04-261-3/+2
| | | | llvm-svn: 70145
* Make sure to pull in the target builtin records when initialize the AST ↵Douglas Gregor2009-04-261-1/+1
| | | | | | context, even if we're not going to initialize the __builin_* identifiers llvm-svn: 70111
* PCH support for all of the predefined Objective-C types, such as id,Douglas Gregor2009-04-231-6/+34
| | | | | | | | SEL, Class, Protocol, CFConstantString, and __objcFastEnumerationState. With this, we can now run the Objective-C methods and properties PCH tests. llvm-svn: 69932
* Eliminate the three SmallVectors in ObjCImplDecl (for instanceDouglas Gregor2009-04-231-2/+4
| | | | | | | | | | | methods, class methods, and property implementations) and instead place all of these entities into the DeclContext. This eliminates more linear walks when looking for class or instance methods and should make PCH (de-)serialization of ObjCDecls trivial (and lazy). llvm-svn: 69849
* Remove the serialization code that predates precompiledDouglas Gregor2009-04-221-178/+0
| | | | | | | headers. Future approaches to (de-)serializing ASTs will be based on the PCH infrastructure. llvm-svn: 69828
* Lazy loading of builtins for precompiled headers.Douglas Gregor2009-04-221-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PCH files now contain complete information about builtins, including any declarations that have been synthesized as part of building the PCH file. When using a PCH file, we do not initialize builtins at all; when needed, they'll be found in the PCH file. This optimization translations into a 9% speedup for "Hello, World!" with Carbon.h as a prefix header and roughly a 5% speedup for 403.gcc with its prefix header. We're also reading less of the PCH file for "Hello, World!": *** PCH Statistics: 286/20693 types read (1.382110%) 1630/59230 declarations read (2.751984%) 764/44914 identifiers read (1.701029%) 1/32954 statements read (0.003035%) 5/6187 macros read (0.080815%) down from *** PCH Statistics: 411/20693 types read (1.986179%) 2553/59230 declarations read (4.310316%) 1093/44646 identifiers read (2.448148%) 1/32954 statements read (0.003035%) 21/6187 macros read (0.339421%) llvm-svn: 69815
* Reapply r69771, with updates & fixes:Daniel Dunbar2009-04-221-11/+28
| | | | | | | | | | | | | | | | | | | | | | Rework the shadow struct that is layed out for Objective-C classes. - Superclasses are now always laid out in their shadow structure at the first field. - Prior to this, the entire class heirarchy was flattened into a single structure which meant that alignment, padding, and bitfields were incorrect (the ASTRecordLayout was correct however, which meant our debug info didn't coincide with ivar offsets, for example). - This is still very suboptimal (for example, ivar are looked up recursively, but I believe the ivar layout itself is now at least close to correct. - <rdar://problem/6773388> error: objc[29823]: layout bitmap sliding backwards llvm-svn: 69811
* Simplify addRecordToClass, it is not legal to call it on a forwardDaniel Dunbar2009-04-221-15/+6
| | | | | | declaration now. llvm-svn: 69799
* ObjCQualifiedClass is dead, remove it.Chris Lattner2009-04-221-4/+0
| | | | llvm-svn: 69783
* Reorganize built-in initialization to separate the creation of target ↵Douglas Gregor2009-04-221-1/+2
| | | | | | builtins from marking IdentifierInfos as builtins. No functionality change llvm-svn: 69774
* Revert r69771, I missed some (obvious) details. :/Daniel Dunbar2009-04-221-33/+10
| | | | llvm-svn: 69773
* Mark another TypeForDecl const and make getObjCInterfaceType's argument const.Daniel Dunbar2009-04-221-2/+3
| | | | llvm-svn: 69772
* Rework the shadow struct that is layed out for Objective-C classes.Daniel Dunbar2009-04-221-10/+33
| | | | | | | | | | | | | | | | | | | - Superclasses are now always laid out their shadow structure at the first field. - Prior to this, the entire class heirarchy was flattened into a single structure which meant that alignment, padding, and bitfields weren't packed correctly (the ASTRecordLayout was correct however, which meant our debug info didn't coincide with ivar offsets, for example). - This is still very suboptimal, but I believe the ivar layout itself is now at least close to correct. - <rdar://problem/6773388> error: objc[29823]: layout bitmap sliding backwards llvm-svn: 69771
* Make sure to mark the interface as completed when we see anDaniel Dunbar2009-04-211-0/+3
| | | | | | | | | @implementation that closes a @class delcaration. - I don't know how to make a test case for this, but this strengthens the invariants that hold internally. The functionality change here is the edit to SemaDeclObjC.cpp. llvm-svn: 69728
* Kill ASTContext::[gs]etFieldForDecl, instead we just lookup thingsDaniel Dunbar2009-04-211-10/+0
| | | | | | | | when we need them -- which is exactly what some code was already doing! - No intended functionality change. llvm-svn: 69648
* Assert on a few conditions that (I believe) should holdDaniel Dunbar2009-04-211-0/+2
| | | | | | | w.r.t. ASTContext::[gs]etFieldDecl, and the Field argument to EmitObjCValueForIvar). llvm-svn: 69639
* Make FieldDecl parameter to getObjCEncodingForType... const.Daniel Dunbar2009-04-201-4/+4
| | | | llvm-svn: 69578
* Fix decl type merges when they haveFariborz Jahanian2009-04-151-3/+3
| | | | | | __string/__weak attributes. llvm-svn: 69229
* ASTContext::mergeTypes(): Loosen up the type checking for 'Class' (treating ↵Steve Naroff2009-04-141-5/+5
| | | | | | | | | | | | | | it like 'id'). This fixes <rdar://problem/6782722> XCDataTipsManager.m registers, observes notifications in class methods. The radar above is the result of clang typing 'self' in a class method as 'Class', which results in some spurious warnings (GCC types 'self' in a class method as 'id'). I considered changing the type of 'self' to 'id' (to conform to GCC), however this resulted in *many* test cases breaking. In addition, I really prefer a more strongly typed 'self'. All in all, this is the least obtrusive fix I could find for removing the spurious warnings (though we do loose some valid warnings). llvm-svn: 69041
* Change dyn_cast<> to isa<>. Pointed out by Anders (thanks).Steve Naroff2009-04-141-1/+1
| | | | llvm-svn: 69007
* Fix crasher in ASTContext::getObjCEncodingForMethodDecl().Steve Naroff2009-04-141-5/+7
| | | | | | This was exposed as a result of something else that was recently fixed. llvm-svn: 69004
* fix PR3932: [ObjC]Type defined as 'id' is not recognized as a valid object type.Chris Lattner2009-04-121-11/+18
| | | | | | by making ASTContext::isObjCObjectPointerType accept typedefs of id. llvm-svn: 68931
* Non-pointer objects are none gc'able regardles ofFariborz Jahanian2009-04-111-0/+4
| | | | | | the attribute set on them. llvm-svn: 68844
* Use correct alignment and size for references in records as well.Anders Carlsson2009-04-101-0/+4
| | | | llvm-svn: 68769
* Fix thinko noticed by Chris.Anders Carlsson2009-04-101-1/+1
| | | | llvm-svn: 68762
* Use the same alignment for reference declarations as for pointer declarations.Anders Carlsson2009-04-101-2/+5
| | | | llvm-svn: 68761
* Implementation of pre-compiled headers (PCH) based on lazyDouglas Gregor2009-04-091-1/+17
| | | | | | | | | | | | | | | | | | | de-serialization of abstract syntax trees. PCH support serializes the contents of the abstract syntax tree (AST) to a bitstream. When the PCH file is read, declarations are serialized as-needed. For example, a declaration of a variable "x" will be deserialized only when its VarDecl can be found by a client, e.g., based on name lookup for "x" or traversing the entire contents of the owner of "x". This commit provides the framework for serialization and (lazy) deserialization, along with support for variable and typedef declarations (along with several kinds of types). More declarations/types, along with important auxiliary structures (source manager, preprocessor, etc.), will follow. llvm-svn: 68732
* Add @encode support for complex types.Anders Carlsson2009-04-091-2/+5
| | | | llvm-svn: 68729
* Propagate the ASTContext to various AST traversal and lookup functions.Douglas Gregor2009-04-091-16/+18
| | | | | | No functionality change (really). llvm-svn: 68726
* Added a FIXME.Fariborz Jahanian2009-04-081-0/+2
| | | | llvm-svn: 68646
* Fix buffer overrun when laying out synthesized ivars.Daniel Dunbar2009-04-081-1/+2
| | | | llvm-svn: 68634
* Move the internal DeclContext data structures into a separate header. Douglas Gregor2009-04-071-2/+7
| | | | | | | | Simplify the addition of a case statement to a switch. Fix -print-stats for attribute-qualified types. llvm-svn: 68522
* Fix up lookup rules for properties declared inFariborz Jahanian2009-04-021-22/+0
| | | | | | objc's continuation class. llvm-svn: 68339
* Nonfragile ivar synthesis with property is in a continuationFariborz Jahanian2009-04-011-1/+23
| | | | | | class. llvm-svn: 68234
* remove ASTContext::buildObjCInterfaceType, which breaks canonical Chris Lattner2009-04-011-12/+0
| | | | | | | | types. It is no longer needed now that the code generator re-lays-out interfaces if they are defines after being laid out from a forward decl. llvm-svn: 68194
* Fix block comparisons. Radar 6732116.Mike Stump2009-04-011-3/+3
| | | | llvm-svn: 68171
* Parsing, semantic analysis, and template instantiation for typenameDouglas Gregor2009-04-011-0/+33
| | | | | | | | | | | | | specifiers that terminate in a simple-template-id, e.g., typename MetaFun::template apply<T1, T2> Also, implement template instantiation for dependent nested-name-specifiers that involve unresolved identifiers, e.g., typename T::type::type llvm-svn: 68166
* ir-gen support for nonfragile abi's synthesized ivars.Fariborz Jahanian2009-03-311-0/+6
| | | | llvm-svn: 68122
* Fix a problem in ASTContext::addRecordToClass handling forward declarations.Chris Lattner2009-03-311-16/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a case like: @class foo; foo *P; addRecordToClass was making an empty shadow struct for the foo interface and completing it. Later when an: @interface foo ... @endif foo *Q; was seen, ASTContext::addRecordToClass would think that foo was already laid out and not lay out the definition. This fixes it to create a forward declared struct the first time around, then complete it when the definition is seen. Note that this causes two tests to regress, because something is trying to get the size of the forward declared structs returned by this. Previously, this would end up getting a size of zero but now it properly dies. I'm not sure what the right solution is for this, so I xfailed the tests. Fariborz, please take a look at this. The testcase in rdar://6676794 now gets farther, but dies later because the objc ivar is not assigned a field number. As an aside, I really don't like the fact that the objc front-end is creating shadow C structs for ObjC types. This seems like an implementation detail of the code generator that could be fixed by better factoring of the extant code. llvm-svn: 68106
* disable copying of Type objects.Chris Lattner2009-03-311-1/+1
| | | | llvm-svn: 68103
* fill in temporary smallvectors instead of vectors for performance.Chris Lattner2009-03-311-15/+14
| | | | | | Fix BuildAggrIvarLayout to not access vectors out of range. llvm-svn: 68101
* add a const version of the lookupFieldDeclForIvar method.Chris Lattner2009-03-311-3/+1
| | | | llvm-svn: 68094
* Parsing and AST representation for dependent template names that occurDouglas Gregor2009-03-311-2/+0
| | | | | | | | | | | within nested-name-specifiers, e.g., for the "apply" in typename MetaFun::template apply<T1, T2>::type At present, we can't instantiate these nested-name-specifiers, so our testing is sketchy. llvm-svn: 68081
* fe support for objc2's nonfragile-abi synthesized ivars.Fariborz Jahanian2009-03-311-0/+7
| | | | llvm-svn: 68077
OpenPOWER on IntegriCloud