summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Substantially alter the design of the Objective C type AST by introducingJohn McCall2010-05-151-101/+119
| | | | | | | | | | | | | | | | | | | | | ObjCObjectType, which is basically just a pair of one of {primitive-id, primitive-Class, user-defined @class} with a list of protocols. An ObjCObjectPointerType is therefore just a pointer which always points to one of these types (possibly sugared). ObjCInterfaceType is now just a kind of ObjCObjectType which happens to not carry any protocols. Alter a rather large number of use sites to use ObjCObjectType instead of ObjCInterfaceType. Store an ObjCInterfaceType as a pointer on the decl rather than hashing them in a FoldingSet. Remove some number of methods that are no longer used, at least after this patch. By simplifying ObjCObjectPointerType, we are now able to easily remove and apply pointers to Objective-C types, which is crucial for a certain kind of ObjC++ metaprogramming common in WebKit. llvm-svn: 103870
* Merged Elaborated and QualifiedName types.Abramo Bagnara2010-05-111-47/+18
| | | | llvm-svn: 103517
* Allocate most of DeclarationNamesTable using ASTContext's allcocator. The ↵Ted Kremenek2010-05-101-3/+0
| | | | | | | | only things that aren't allocated this way are the internal FoldingSets. llvm-svn: 103429
* Start converting pieces of DeclarationNameTable to be allocated using ↵Ted Kremenek2010-05-101-1/+6
| | | | | | | | | | ASTContext's allocator. While DeclarationNameTable doesn't leak, it uses 'malloc' too often. Start with having 'CXXLiteralOperatorNames' allocated using ASTContext's allocator and add a 'DoDestroy()' method to DeclarationNameTable that is called by ~ASTContext. llvm-svn: 103426
* Implement encoding of methods which have instantiatedFariborz Jahanian2010-05-071-0/+11
| | | | | | template arguments. llvm-svn: 103221
* When synthesizing Objective C records, give the synthetic fields publicJohn McCall2010-04-301-0/+8
| | | | | | | | access. Fixes an assertion. Fixes rdar://problem/7927811. Too lazy to reduce a test case. llvm-svn: 102776
* Revert "Fix for PR6953: per gcc, regparm and noreturn affect the ↵Daniel Dunbar2010-04-281-8/+13
| | | | | | compatibility of", it is breaking the builds of quite a few projects (emacs, dovecot, gnutar, bison). llvm-svn: 102501
* Fix for PR6953: per gcc, regparm and noreturn affect the compatibility ofEli Friedman2010-04-271-13/+8
| | | | | | | | | function types. This could potentially have unexpected side-effects, so look here if there are new regressions. llvm-svn: 102464
* More simplifications.Benjamin Kramer2010-04-271-17/+7
| | | | llvm-svn: 102447
* Move CollectIvarsToConstructOrDestruct to SemaFariborz Jahanian2010-04-271-49/+0
| | | | | | | from AST, consider ivar array of objects (per Doug's comment). llvm-svn: 102446
* Simplify some code. No change in functionality.Benjamin Kramer2010-04-271-18/+9
| | | | llvm-svn: 102445
* Make the InjectedClassNameType the canonical type of the current instantiationJohn McCall2010-04-271-12/+17
| | | | | | | | | | | | | | | | of a class template or class template partial specialization. That is to say, in template <class T> class A { ... }; or template <class T> class B<const T*> { ... }; make 'A<T>' and 'B<const T*>' sugar for the corresponding InjectedClassNameType when written inside the appropriate context. This allows us to track the current instantiation appropriately even inside AST routines. It also allows us to compute a DeclContext for a type much more efficiently, at some extra cost every time we write a template specialization (which can be optimized, but I've left it simple in this patch). llvm-svn: 102407
* New method to construct/destruct ivars that have non-trivial default Fariborz Jahanian2010-04-261-0/+49
| | | | | | constructors or destructors, not used yet. llvm-svn: 102403
* Turn CXXMethodVector into a generic class template.Anders Carlsson2010-04-231-49/+0
| | | | llvm-svn: 102208
* More work toward implementingFariborz Jahanian2010-04-231-0/+40
| | | | | | NeXt's -fno-constant-cfstrings - wip. llvm-svn: 102189
* When computing the alignof value for a vector type, ensure thatDan Gohman2010-04-211-1/+1
| | | | | | | the alignment is a power of 2, even in the esoteric case of a vector element which does not have a power-of-2 sizeof value. llvm-svn: 102036
* AST: Dump ASTRecordLayout objects when they are created with ↵Daniel Dunbar2010-04-191-0/+5
| | | | | | -fdump-record-layouts. llvm-svn: 101815
* Fix -Wcast-qual warnings.Dan Gohman2010-04-191-1/+2
| | | | llvm-svn: 101786
* Add encoding of reference types like gcc does for objc methods andFariborz Jahanian2010-04-131-3/+8
| | | | | | blocks. Fixes PR6468. llvm-svn: 101196
* Implement method type encoding in the presenseFariborz Jahanian2010-04-081-2/+2
| | | | | | of c-style arguments. Completes radar 7445205. llvm-svn: 100813
* Fix a misuse of iterators when iterating through block'sFariborz Jahanian2010-04-081-2/+2
| | | | | | parameters list for encoding. llvm-svn: 100788
* Put type restriction on convesion to nonconforming 'id' back in Fariborz Jahanian2010-04-061-3/+2
| | | | | | block pointer type comparison. llvm-svn: 100533
* Relax the typesafty rules of block pointers types whichFariborz Jahanian2010-04-011-2/+3
| | | | | | take'id' or return 'id' in their type. Fixes radar 7814131. llvm-svn: 100129
* Extend DependentNameType with a keyword enum that specifies whetherDouglas Gregor2010-03-311-14/+24
| | | | | | | this was parsed as a typename-specifier, elaborated-type-specifier (including the kind), or just a dependent qualified type name. llvm-svn: 100039
* Rename TypenameType to DependentNameType in anticipation of someDouglas Gregor2010-03-311-16/+16
| | | | | | refactoring work in this area. llvm-svn: 100019
* Remember the regparm attribute in FunctionType::ExtInfo.Rafael Espindola2010-03-301-7/+20
| | | | | | Fixes PR3782. llvm-svn: 99940
* the big refactoring bits of PR3782.Rafael Espindola2010-03-301-34/+43
| | | | | | | | This introduces FunctionType::ExtInfo to hold the calling convention and the noreturn attribute. The next patch will extend it to include the regparm attribute and fix the bug. llvm-svn: 99920
* Be a bit more consistent in using operator->Rafael Espindola2010-03-291-2/+2
| | | | | | | This patch moves some methods from QualType to Type and changes the users to use -> instead of . llvm-svn: 99805
* Implement a framework for the delay of arbitrary diagnostics withinJohn McCall2010-03-241-1/+2
| | | | | | | | | templates. So delay access-control diagnostics when (for example) the target of a friend declaration is a specific specialization of a template. I was surprised to find that this was required for an access-controlled selfhost. llvm-svn: 99383
* More clean up of ivars which are either in class extensions andFariborz Jahanian2010-03-221-27/+15
| | | | | | | | implementation or synthesized into an implementation. Also, fixes a code gen. bug when ivars are itroduced in interleaved implementations. (related to radar 7547942). llvm-svn: 99193
* Remove the capture, serialization, and deserialization of commentDouglas Gregor2010-03-191-197/+1
| | | | | | | | ranges as part of the ASTContext. This code is not and was never used, but contributes ~250k to the size of the Cocoa.h precompiled header. llvm-svn: 99007
* objective-c patch to provide type safty when blocks are passing orFariborz Jahanian2010-03-171-7/+59
| | | | | | | returning objc objects. There will be a corresponding objective-c++ patch soon. llvm-svn: 98696
* Let SourceManager::getBufferData return StringRef instead of a pair of two ↵Benjamin Kramer2010-03-161-2/+2
| | | | | | const char*. llvm-svn: 98630
* Give SourceManager a Diagnostic object with which to report errors,Douglas Gregor2010-03-161-10/+12
| | | | | | and start simplifying the interfaces in SourceManager that can fail. llvm-svn: 98594
* Introduce a new BufferResult class to act as the return type ofDouglas Gregor2010-03-151-9/+15
| | | | | | | | | | | | | | SourceManager's getBuffer() (and similar) operations. This abstract can be used to force callers to cope with errors in getBuffer(), such as missing files and changed files. Fix a bunch of callers to use the new interface. Add some very basic checks for file consistency (file size, modification time) into ContentCache::getBuffer(), although these checks don't help much until we've updated the main callers (e.g., SourceManager::getSpelling()). llvm-svn: 98585
* Check compatibility of vector types using their canonicalizations.John McCall2010-03-121-1/+2
| | | | | | | | | Fixes an assertion arising C overload analysis, but really I can't imagine that this wouldn't cause a thousand other uncaught failures. Fixes PR6600. llvm-svn: 98400
* Extend the builtin syntax to allow address-space qualifiers on pointers andJohn McCall2010-03-121-4/+15
| | | | | | references. Based on a patch by Arnaud de Grandmaison! llvm-svn: 98327
* For ivars created using @synthesize, set their DeclContext to beTed Kremenek2010-03-111-28/+4
| | | | | | | | | | | | the @implementation (instead of the @interface) and actually add the ivar to the DeclContext (which we weren't doing before). This allows us to simplify ASTContext::CollectNonClassIvars() by removing ASTContext::CollectProtocolSynthesizedIvars(). Now all ivars can be found by either inspecting the ObjCInterfaceDecl and its companion ObjCImplementationDecl. llvm-svn: 98280
* Allow the fast path through ASTContext::getTypeDeclType to be inlined.John McCall2010-03-101-18/+16
| | | | llvm-svn: 98138
* Create a new InjectedClassNameType to represent bare-word references to the John McCall2010-03-101-1/+58
| | | | | | | | | | | | | injected class name of a class template or class template partial specialization. This is a non-canonical type; the canonical type is still a template specialization type. This becomes the TypeForDecl of the pattern declaration, which cleans up some amount of code (and complicates some other parts, but whatever). Fixes PR6326 and probably a few others, primarily by re-establishing a few invariants about TypeLoc sizes. llvm-svn: 98134
* Allocate ASTRecordLayout objects using the allocator associated with ASTContext.Ted Kremenek2010-03-081-13/+13
| | | | | | | This allows them to be allocated using a BumpPtrAllocated in the common case. llvm-svn: 97978
* Patch to build qualifier on objective-cFariborz Jahanian2010-03-051-3/+5
| | | | | | pointer types. Fixes radar 7626768. llvm-svn: 97847
* Eliminate the static map of overridden C++ methods, which was going toDouglas Gregor2010-03-021-0/+80
| | | | | | come back to bite us at some point. llvm-svn: 97607
* Split out types that are non-canonical unless dependent as their ownJohn McCall2010-03-011-3/+1
| | | | | | | | | | | category. Use this in a few places to eliminate unnecessary TST cases and do some future-proofing. Provide terrible manglings for typeof. Mangle decltype with some hope of accuracy. Our manglings for some of the cases covered in the testcase are different from gcc's, which I've raised as an issue with the ABI list. llvm-svn: 97523
* Forgot to include nested protocols in collection, resulting inFariborz Jahanian2010-02-251-1/+3
| | | | | | bogus warning. Fixes radar 7682116. llvm-svn: 97157
* When a reference to a field of a struct/union/class is passed to theCharles Davis2010-02-231-0/+6
| | | | | | | __alignof__ operator, make sure to take into account the packed alignment of the struct/union/class itself. Matches GCC's behavior and fixes PR6362. llvm-svn: 96884
* More support for ivars in class extension.Fariborz Jahanian2010-02-231-0/+8
| | | | llvm-svn: 96850
* Eliminate the default arguments to ASTContext::getFunctionType(),Douglas Gregor2010-02-211-2/+6
| | | | | | | | fixing up a few callers that thought they were propagating NoReturn information but were in fact saying something about exception specifications. llvm-svn: 96766
* Patch removes IVars list from ObjCInterfaceDecl andFariborz Jahanian2010-02-191-7/+14
| | | | | | instead relies on their DeclContext for iteration, etc. llvm-svn: 96638
* Make the various type-decl Types (and their associated ASTContext routines)John McCall2010-02-161-7/+8
| | | | | | accept const decls. llvm-svn: 96325
OpenPOWER on IntegriCloud