summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
* fix build on systems where uint64_t != unsigned long longChris Lattner2009-02-151-1/+1
| | | | llvm-svn: 64605
* Add -ffreestanding to suppress the implicit declaration of library builtins ↵Douglas Gregor2009-02-141-1/+1
| | | | | | like printf and malloc. Fixes PR3586 llvm-svn: 64566
* Fixed a problem caused by foreward @class useFariborz Jahanian2009-02-141-0/+12
| | | | | | | | which consequently caused a Seg fault. during meta-data generation. It also addresses an issue related to late binding of newly synthesize ivars (when we support it). llvm-svn: 64563
* Initial implementation of arbitrary fixed-width integer types. Eli Friedman2009-02-131-11/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently only used for 128-bit integers. Note that we can't use the fixed-width integer types for other integer modes without other changes because glibc headers redefines (u)int*_t and friends using the mode attribute. For example, this means that uint64_t has to be compatible with unsigned __attribute((mode(DI))), and uint64_t is currently defined to long long. And I have a feeling we'll run into issues if we try to define uint64_t as something which isn't either long or long long. This doesn't get the alignment right in most cases, including the 128-bit integer case; I'll file a PR shortly. The gist of the issue is that the targets don't really expose the information necessary to figure out the alignment outside of the target description, so there's a non-trivial amount of work involved in getting it working right. That said, the alignment used is conservative, so the only issue with the current implementation is ABI compatibility. This makes it trivial to add some sort of "bitwidth" attribute to make arbitrary-width integers; I'll do that in a followup. We could also use this for stuff like the following for compatibility with gcc, but I have a feeling it would be a better idea for clang to be consistent between C and C++ modes rather than follow gcc's example for C mode. struct {unsigned long long x : 33;} x; unsigned long long a(void) {return x.x+1;} llvm-svn: 64434
* Several cleanups:Steve Naroff2009-02-121-6/+29
| | | | | | | | - rename isObjCIdType/isObjCClassType -> isObjCIdStructType/isObjCClassStructType. The previous name didn't do what you would expect. - add back isObjCIdType/isObjCClassType to do what you would expect. Not currently used, however many of the isObjCIdStructType/isObjCClassStructType clients could be converted over time. - move static Sema function areComparableObjCInterfaces to ASTContext (renamed to areComparableObjCPointerTypes, since it now operates on pointer types). llvm-svn: 64385
* Last @encode'ing fix for objc2's nonfragile abi.Fariborz Jahanian2009-02-111-3/+6
| | | | | | All relevant dejagnu enocding tests pass in this mode. llvm-svn: 64341
* Patch to fix encoding in 64bit abi. With this patchFariborz Jahanian2009-02-111-2/+8
| | | | | | | all but one dejagnu encoding tests for darwin pass in nonfragile abi mode. llvm-svn: 64334
* Start processing template-ids as types when the template-name refersDouglas Gregor2009-02-091-0/+28
| | | | | | | | | | | | | | | | | | | | | to a class template. For example, the template-id 'vector<int>' now has a nice, sugary type in the type system. What we can do now: - Parse template-ids like 'vector<int>' (where 'vector' names a class template) and form proper types for them in the type system. - Parse icky template-ids like 'A<5>' and 'A<(5 > 0)>' properly, using (sadly) a bool in the parser to tell it whether '>' should be treated as an operator or not. This is a baby-step, with major problems and limitations: - There are currently two ways that we handle template arguments (whether they are types or expressions). These will be merged, and, most likely, TemplateArg will disappear. - We don't have any notion of the declaration of class template specializations or of template instantiations, so all template-ids are fancy names for 'int' :) llvm-svn: 64153
* Improve the representation of template type parameters. We nowDouglas Gregor2009-02-051-13/+28
| | | | | | | | | | | canonicalize by template parameter depth, index, and name, and the unnamed version of a template parameter serves as the canonical. TemplateTypeParmDecl no longer needs to inherit from TemplateParmPosition, since depth and index information is present within the type. llvm-svn: 63899
* Basic representation of C++ class templates, from Andrew Sutton.Douglas Gregor2009-02-041-0/+1
| | | | llvm-svn: 63750
* Change the ObjC type encoding for block pointer types to "@?" (for ↵Steve Naroff2009-02-021-1/+1
| | | | | | | | consistency with GCC). This fixes <rdar://problem/6538564> clang ObjC rewriter: Wrong encoding emitted for methods with Block parameters. llvm-svn: 63534
* Handle complex types in ASTContext::mergeTypesDaniel Dunbar2009-01-281-0/+3
| | | | llvm-svn: 63238
* Finish making AST BumpPtrAllocation runtime configurable (based on ↵Steve Naroff2009-01-271-4/+4
| | | | | | | | | | | -disable-free). snaroff% time ../../Release-Asserts/bin/clang INPUTS/Cocoa_h.m 0.179u 0.051s 0:00.23 95.6% 0+0k 0+0io 0pf+0w snaroff% time ../../Release-Asserts/bin/clang INPUTS/Cocoa_h.m -disable-free 0.169u 0.052s 0:00.22 95.4% 0+0k 0+0io 0pf+0w llvm-svn: 63153
* Convert types over to placement new() that takes an ASTContext.Steve Naroff2009-01-271-57/+30
| | | | | | Also changed FunctionTypeProto to be allocated with 8-byte alignment (noticed by Doug). I couldn't think of any reason to allocate on 16-byte boundaries. If anyone remembers why we were doing this, let me know! llvm-svn: 63137
* Fixed a typo in getPreferredTypeAlign method.Fariborz Jahanian2009-01-271-1/+1
| | | | llvm-svn: 63116
* add a new "getPreferredTypeAlign" method to return the preferred alignmentChris Lattner2009-01-271-0/+16
| | | | | | | of a type. The implementation is currently something of a hack, but is sufficient for now and allows clients to be built on it. llvm-svn: 63108
* Make tentative parsing of pointer-to-member decls work, and fix other stuff ↵Sebastian Redl2009-01-241-2/+3
| | | | | | pointed out by Doug. llvm-svn: 62944
* add initial support for the gcc "alignof(decl) is the alignment of the declChris Lattner2009-01-241-0/+20
| | | | | | | not the type" semantics. This can definitely be improved, but is better than what we had. llvm-svn: 62939
* Add support for declaring pointers to members.Sebastian Redl2009-01-241-1/+50
| | | | | | Add serialization support for ReferenceType. llvm-svn: 62934
* Use the ASTContext's allocator for FunctionTypeNoProto and TypeOfExprDouglas Gregor2009-01-201-2/+4
| | | | llvm-svn: 62611
* Detailed documentation for encoding of properties and a test Fariborz Jahanian2009-01-201-1/+22
| | | | | | case. llvm-svn: 62607
* Improving on encoding of objective-c's property types. More to come.Fariborz Jahanian2009-01-201-10/+36
| | | | llvm-svn: 62601
* Remove ScopedDecl, collapsing all of its functionality into Decl, soDouglas Gregor2009-01-201-3/+3
| | | | | | | | | | | | | | | | that every declaration lives inside a DeclContext. Moved several things that don't have names but were ScopedDecls (and, therefore, NamedDecls) to inherit from Decl rather than NamedDecl, including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't store empty DeclarationNames for these things, nor do we try to insert them into DeclContext's lookup structure. The serialization tests are temporarily disabled. We'll re-enable them once we've sorted out the remaining ownership/serialiazation issues between DeclContexts and TranslationUnion, DeclGroups, etc. llvm-svn: 62562
* Make sure all types are allocated with 8-byte alignment.Steve Naroff2009-01-191-21/+21
| | | | | | The QualType smart pointer assumes we have 3 flag bits available. llvm-svn: 62540
* Allocate Types using ASTContext's 'Allocator' object.Ted Kremenek2009-01-191-34/+68
| | | | llvm-svn: 62530
* Vector codegen improvementsNate Begeman2009-01-181-1/+5
| | | | llvm-svn: 62458
* Teach DeclContext how to find the primary declaration for any TagDeclDouglas Gregor2009-01-171-5/+0
| | | | | | | | | | | | | even when we are still defining the TagDecl. This is required so that qualified name lookup of a class name within its definition works (see the new bits in test/SemaCXX/qualified-id-lookup.cpp). As part of this, move the nested redefinition checking code into ActOnTag. This gives us diagnostics earlier (when we try to perform the nested redefinition, rather than when we try to complete the 2nd definition) and removes some code duplication. llvm-svn: 62386
* Don't ICE on user redeclaration of objc's built-in types.Fariborz Jahanian2009-01-161-4/+10
| | | | | | Issue diagnostics instead if types do not match. llvm-svn: 62349
* rename "virtual location" of a macro to "instantiation location".Chris Lattner2009-01-161-0/+1
| | | | llvm-svn: 62315
* Implemenent objective-c's NSObject attribute as a way of ddeclaraing c-typeFariborz Jahanian2009-01-131-1/+18
| | | | | | objects as an objective-c object. llvm-svn: 62197
* Patch to fix encoding of Enum bitfields in ObjC.Fariborz Jahanian2009-01-131-7/+15
| | | | llvm-svn: 62135
* Cleanup DeclContext::addDecl and DeclContext::insert interface, from Piotr RakDouglas Gregor2009-01-121-3/+3
| | | | llvm-svn: 62122
* Provide a new kind of iterator, the specific_decl_iterator, thatDouglas Gregor2009-01-091-2/+2
| | | | | | | | | filters the decls seen by decl_iterator with two criteria: the dynamic type of the declaration and a run-time predicate described by a member function. This simplifies EnumDecl, RecordDecl, and ObjCContainerDecl considerably. It has no measurable performance impact. llvm-svn: 61994
* Back out code for handling VectorType's in getFloatingRank.Daniel Dunbar2009-01-051-2/+0
| | | | llvm-svn: 61764
* Implement getFloatingRank() for extended vectors.Daniel Dunbar2009-01-051-2/+4
| | | | | | | - I'm not sure this is appropriate, but it seems reasonable to be able to call getFloatingRank on anything which isFloatingType(). llvm-svn: 61758
* Last patch, for now, to privde ObjC's encoding of types.Fariborz Jahanian2008-12-231-0/+10
| | | | | | We now pass all gcc's encoding compatibility tests. llvm-svn: 61387
* Lot more encoding work. We are closing the gap toFariborz Jahanian2008-12-231-7/+53
| | | | | | gcc compatibilty in all aspects of encoding now. llvm-svn: 61383
* More encoding support; in this case, encoding ofFariborz Jahanian2008-12-221-2/+9
| | | | | | outer-most const of pointer types. llvm-svn: 61355
* Add ASTContext::getBaseElementType and use it in ↵Anders Carlsson2008-12-211-0/+10
| | | | | | CodeGenFunction::EmitArraySubscriptExpr. llvm-svn: 61303
* Finish up saving original parameter type andFariborz Jahanian2008-12-201-3/+9
| | | | | | using it in ObjC's method parameter encoding. llvm-svn: 61293
* Strangely enough, name of ObjC class is not encoded into theFariborz Jahanian2008-12-201-4/+6
| | | | | | | | full encoding of the class which has an ivar of pointer to this class. Its name is encoded in the type for the ivar in the ivar-list metadata. This patch conforms to the above rule. llvm-svn: 61282
* More encoding support. This time forFariborz Jahanian2008-12-191-38/+62
| | | | | | @encode of classes and bitfields. llvm-svn: 61268
* Several@encode bug fixes for ObjC.Fariborz Jahanian2008-12-191-2/+10
| | | | llvm-svn: 61231
* Removed a slot in ObjCMemRegExpr used inFariborz Jahanian2008-12-181-0/+10
| | | | | | code gen which did not belong there. llvm-svn: 61203
* fix a few more memory leaks: clean the ASTRecordLayouts, ASTObjCInterfaces ↵Nuno Lopes2008-12-171-0/+27
| | | | | | and ASTRecordForInterface maps llvm-svn: 61163
* This patch will build the Records lazily per Steve's comments.Fariborz Jahanian2008-12-171-0/+40
| | | | | | | Note that one test duplicate-ivar-check.m will fail because I need to re-implement duplicate ivar checking. llvm-svn: 61154
* Create new EnumDecl nodes for redeclarations of enums, linking themDouglas Gregor2008-12-151-9/+3
| | | | | | | | | | together in the same way that we link RecordDecl/CXXRecordDecl nodes. Unify ActOnTag and ActOnTagStruct. Fixes PR clang/2753. llvm-svn: 61034
* Address some comments on the name lookup/DeclContext patch from ChrisDouglas Gregor2008-12-111-0/+1
| | | | llvm-svn: 60897
* Actually distinguish between RecordDecl::field_iterator and ↵Douglas Gregor2008-12-111-2/+2
| | | | | | RecordDecl::field_const_iterator, propagating the constness down to the FieldDecls. llvm-svn: 60883
* Unifies the name-lookup mechanisms used in various parts of the ASTDouglas Gregor2008-12-111-30/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and separates lexical name lookup from qualified name lookup. In particular: * Make DeclContext the central data structure for storing and looking up declarations within existing declarations, e.g., members of structs/unions/classes, enumerators in C++0x enums, members of C++ namespaces, and (later) members of Objective-C interfaces/implementations. DeclContext uses a lazily-constructed data structure optimized for fast lookup (array for small contexts, hash table for larger contexts). * Implement C++ qualified name lookup in terms of lookup into DeclContext. * Implement C++ unqualified name lookup in terms of qualified+unqualified name lookup (since unqualified lookup is not purely lexical in C++!) * Limit the use of the chains of declarations stored in IdentifierInfo to those names declared lexically. * Eliminate CXXFieldDecl, collapsing its behavior into FieldDecl. (FieldDecl is now a ScopedDecl). * Make RecordDecl into a DeclContext and eliminates its Members/NumMembers fields (since one can just iterate through the DeclContext to get the fields). llvm-svn: 60878
OpenPOWER on IntegriCloud