summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclBase.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* r90313, in which OverloadedFunctionDecl is removed and never spoken of again.John McCall2009-12-021-1/+0
| | | | llvm-svn: 90313
* Allocate MultipleDC objects using the allocator associated withTed Kremenek2009-12-011-5/+5
| | | | | | | | | | ASTContext instead of malloc. Besides reducing malloc traffic, this also removes a source of memory leaks when using a BumpPtrAllocator for the allocator of ASTContext. There are still leaks when using MallocAllocator because Decl::Destroy() isn't fully finished. Fixes: <rdar://problem/7431556> llvm-svn: 90174
* Streamline Stmt::CollectingStats() and Decl::CollectingStats(). No ↵Kovarththanan Rajaratnam2009-11-291-2/+1
| | | | | | functionality change. llvm-svn: 90078
* Add 1+2 consts.Daniel Dunbar2009-11-211-1/+1
| | | | llvm-svn: 89546
* Incremental progress on using declarations. Split UnresolvedUsingDecl intoJohn McCall2009-11-181-2/+3
| | | | | | | | | | two classes, one for typenames and one for values; this seems to have some support from Doug if not necessarily from the extremely-vague-on-this-point standard. Track the location of the 'typename' keyword in a using-typename decl. Make a new lookup result for unresolved values and deal with it in most places. llvm-svn: 89184
* Add SourceLocations to ObjCClassDecl for the class identifiers referenced by ↵Ted Kremenek2009-11-181-1/+1
| | | | | | @class. llvm-svn: 89170
* Do not register ObjCInterfaceDecls implicitly created by @class in theTed Kremenek2009-11-171-0/+7
| | | | | | | | | | | | | | | | | | current DeclContext. These "imaginary" declarations pose issues for clients searching DeclContext for actual declarations. Instead, register them for name lookup, and add the ObjCInterfaceDecl later to the DeclContext when we hit an actual @interface declaration. This also fixes a bug where the invariant that the Decls in a DeclContext are sorted in order of their appearance is no longer violated. What could happen is that an @class causes an ObjCInterfaceDecl to get added first to the DeclContext, then the ObjCClassDecl itself is added, and then later the SourceLocation of the ObjCInterfaceDecl is updated with the correct location (which is later in the file). This breaks an assumed invariant in ResolveLocation.cpp (and possibly other clients). llvm-svn: 89160
* Instead of hanging a using declaration's target decls directly off the using John McCall2009-11-171-7/+17
| | | | | | | decl, create shadow declarations and put them in scope like normal. Work in progress. llvm-svn: 89048
* Remove OriginalTypeParmDecl; the original type is the one specifiedJohn McCall2009-10-231-1/+0
| | | | | | | | | | | | | in the DeclaratorInfo, if one is present. Preserve source information through template instantiation. This is made more complicated by the possibility that ParmVarDecls don't have DIs, which is possibly worth fixing in the future. Also preserve source information for function parameters in ObjC method declarations. llvm-svn: 84971
* Anonymous namespaces, sema + codegen. A lot of semantics are still broken,John McCall2009-10-011-0/+11
| | | | | | apparently because using directives aren't quite working correctly. llvm-svn: 83184
* Improved representation and support for friend class templates. Angst about ↵John McCall2009-09-161-0/+1
| | | | | | same. llvm-svn: 82088
* When performing unqualified name lookup into a DeclContext, also look intoDouglas Gregor2009-09-101-0/+16
| | | | | | | | all of the parent DeclContexts that aren't represented within the Scope chain. This fixes some name-lookup problems in out-of-line definitions of members of nested classes. llvm-svn: 81451
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-49/+49
| | | | llvm-svn: 81346
* Ensure that the tag decls of friend decls aren't added to the friending class'sJohn McCall2009-09-021-5/+0
| | | | | | | decl list, and remove some workarounds that were due to this. Thanks to Eli for pointing this out and providing the test case. llvm-svn: 80745
* Fix bug 4784 and allow friend declarations to properly extendJohn McCall2009-08-311-4/+4
| | | | | | existing declaration chains. llvm-svn: 80636
* Add a workaround for decls that come from friend decls pointing to ↵Anders Carlsson2009-08-291-2/+12
| | | | | | undeclared classes. llvm-svn: 80438
* For consistency, just make friend declarations AS_public.John McCall2009-08-291-10/+2
| | | | llvm-svn: 80420
* Don't assert that friend declarations must have access specifiers for now.Anders Carlsson2009-08-291-2/+10
| | | | llvm-svn: 80415
* Omnibus friend decl refactoring. Instead of cloning AST classes for friendJohn McCall2009-08-281-4/+1
| | | | | | | | | | | | | | declarations of same, introduce a single AST class and add appropriate bits (encoded in the namespace) for whether a decl is "real" or not. Much hackery about previously-declared / not-previously-declared, but it's essentially mandated by the standard that friends alter lookup, and this is at least fairly non-intrusive. Refactor the Sema methods specific to friends for cleaner flow and less nesting. Incidentally solve a few bugs, but I remain confident that we can put them back. llvm-svn: 80353
* Check in UnresolvedUsingDecl.Anders Carlsson2009-08-281-0/+1
| | | | llvm-svn: 80336
* When checking whether one declaration context encloses another, make sure to ↵Douglas Gregor2009-08-271-0/+10
| | | | | | look at the primary contexts. Thanks to Eli for the test case llvm-svn: 80212
* Add a FriendClassDecl type for holding declarations of friend types in John McCall2009-08-111-0/+1
| | | | | | the AST, and create such declarations. llvm-svn: 78719
* Argument-dependent lookup for friend declarations. Add a new decl type,John McCall2009-08-111-3/+13
| | | | | | | | | | | | FriendFunctionDecl, and create instances as appropriate. The design of FriendFunctionDecl is still somewhat up in the air; you can befriend arbitrary types of functions --- methods, constructors, etc. --- and it's not clear that this representation captures that very well. We'll have a better picture when we start consuming this data in access control. llvm-svn: 78653
* Change uses of:Ted Kremenek2009-07-291-1/+1
| | | | | | | | | | | | | | | | | | | | Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsRecordType() -> Type::getAs<RecordType>() Type::getAsPointerType() -> Type::getAs<PointerType>() Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>() Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>() Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>() Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>() Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsTagType() -> Type::getAs<TagType>() And remove Type::getAsReferenceType(), etc. This change is similar to one I made a couple weeks ago, but that was partly reverted pending some additional design discussion. With Doug's pending smart pointer changes for Types, it seemed natural to take this approach. llvm-svn: 77510
* Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methodsTed Kremenek2009-07-171-1/+1
| | | | | | | | | until Doug Gregor's Type smart pointer code lands (or more discussion occurs). These methods just call the new Type::getAs<XXX> methods, so we still have reduced implementation redundancy. Having explicit getAsXXXType() methods makes it easier to set breakpoints in the debugger. llvm-svn: 76193
* Replaced Type::getAsLValueReferenceType(), Type::getAsRValueReferenceType(), ↵Ted Kremenek2009-07-171-1/+1
| | | | | | Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents. llvm-svn: 76139
* De-ASTContext-ify DeclContext.Argyrios Kyrtzidis2009-06-301-34/+33
| | | | | | | Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating". Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit. llvm-svn: 74506
* Remove the ASTContext parameter from the getBody() methods of Decl and ↵Argyrios Kyrtzidis2009-06-301-4/+4
| | | | | | | | subclasses. Timings showed no significant difference before and after the commit. llvm-svn: 74504
* Decl::getTranslationUnitDecl() should return itself when the Decl is a ↵Argyrios Kyrtzidis2009-06-301-0/+3
| | | | | | TranslationUnitDecl. llvm-svn: 74502
* Remove the ASTContext parameter from the attribute-related methods of Decl.Argyrios Kyrtzidis2009-06-301-9/+11
| | | | | | | | | The implementations of these methods can Use Decl::getASTContext() to get the ASTContext. This commit touches a lot of files since call sites for these methods are everywhere. I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it. llvm-svn: 74501
* -Keep a reference to the ASTContext inside the TranslationUnitDecl.Argyrios Kyrtzidis2009-06-291-0/+16
| | | | | | | | -Introduce Decl::getASTContext() which returns the reference from the TranslationUnitDecl that it is contained in. The general idea is that Decls can point to their own ASTContext so that it is no longer required to "manually" keep track and make sure that you pass the correct ASTContext to Decls' methods, e.g. methods like Decl::getAttrs should eventually not require a ASTContext parameter. llvm-svn: 74434
* See through UsingDecls in more places.Anders Carlsson2009-06-261-0/+3
| | | | llvm-svn: 74269
* Improved semantic analysis and AST respresentation for functionDouglas Gregor2009-06-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | templates. For example, this now type-checks (but does not instantiate the body of deref<int>): template<typename T> T& deref(T* t) { return *t; } void test(int *ip) { int &ir = deref(ip); } Specific changes/additions: * Template argument deduction from a call to a function template. * Instantiation of a function template specializations (just the declarations) from the template arguments deduced from a call. * FunctionTemplateDecls are stored directly in declaration contexts and found via name lookup (all forms), rather than finding the FunctionDecl and then realizing it is a template. This is responsible for most of the churn, since some of the core declaration matching and lookup code assumes that all functions are FunctionDecls. llvm-svn: 74213
* Parsing and AST support for using declarations, from John Thompson!Douglas Gregor2009-06-201-0/+1
| | | | llvm-svn: 73812
* Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.Douglas Gregor2009-06-181-33/+14
| | | | llvm-svn: 73702
* Improvements to TemplateArgumentListBuilder to make it work better with ↵Anders Carlsson2009-06-131-0/+7
| | | | | | parameter packs. llvm-svn: 73272
* Initial infrastructure for class template partial specialization. HereDouglas Gregor2009-05-311-0/+4
| | | | | | | | | | | | | we have the basics of declaring and storing class template partial specializations, matching class template partial specializations at instantiation time via (limited) template argument deduction, and using the class template partial specialization's pattern for instantiation. This patch is enough to make a simple is_pointer type trait work, but not much else. llvm-svn: 72662
* Get rid of CXXTempVarDecl.Anders Carlsson2009-05-301-1/+0
| | | | llvm-svn: 72637
* Introduced DeclContext::isDependentContext, which determines whether aDouglas Gregor2009-05-281-0/+15
| | | | | | | | | | | | | | | | | | | given DeclContext is dependent on type parameters. Use this to properly determine whether a TagDecl is dependent; previously, we were missing the case where the TagDecl is a local class of a member function of a class template (phew!). Also, make sure that, when we instantiate declarations within a member function of a class template (or a function template, eventually), that we add those declarations to the "instantiated locals" map so that they can be found when instantiating declaration references. Unfortunately, I was not able to write a useful test for this change, although the assert() that fires when uncommenting the FIXME'd line in test/SemaTemplate/instantiate-declref.cpp tells the "experienced user" that we're now doing the right thing. llvm-svn: 72526
* A couple more small changes which are probably required for Cygwin Eli Friedman2009-04-271-1/+1
| | | | | | builds to work (PR4088). llvm-svn: 70269
* Implement function-try-blocks. However, there's a very subtle bug that I ↵Sebastian Redl2009-04-261-0/+17
| | | | | | can't track down. llvm-svn: 70155
* CXXTempVarDecls aren't looked up. Fixes tests.Anders Carlsson2009-04-241-0/+1
| | | | llvm-svn: 69960
* Eliminate Sema::ObjCImplementations, relying instead on name lookup. What's ↵Douglas Gregor2009-04-241-3/+7
| | | | | | | | | | | good for uniformity is good for PCH (or is it the other way around?). As part of this, make ObjCImplDecl inherit from NamedDecl (since ObjCImplementationDecls now need to have names so that they can be found). This brings ObjCImplDecl very, very close to ObjCContainerDecl; we may be able to merge them soon. llvm-svn: 69941
* Various minor fixes to PCH reading and writing, with generalDouglas Gregor2009-04-101-0/+7
| | | | | | | cleanup. Aside from a minor tweak to the PCH file format, no functionality change. llvm-svn: 68793
* Implementation of pre-compiled headers (PCH) based on lazyDouglas Gregor2009-04-091-0/+112
| | | | | | | | | | | | | | | | | | | 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
* Propagate the ASTContext to various AST traversal and lookup functions.Douglas Gregor2009-04-091-22/+32
| | | | | | No functionality change (really). llvm-svn: 68726
* Simple DeclContext's internal representation by always storing aDouglas Gregor2009-04-091-103/+14
| | | | | | | | StoredDeclsMap, instead of using the it's-an-array-or-its-a-map trick. I'll verify that performance isn't impacted later; for now, I need the common representation. llvm-svn: 68715
* improve compatibility with VC+, patch by John Thompson!Chris Lattner2009-04-081-1/+0
| | | | llvm-svn: 68586
* Allow us to ask for the access specifier of a translation unitDouglas Gregor2009-04-071-1/+2
| | | | llvm-svn: 68548
* Move the internal DeclContext data structures into a separate header. Douglas Gregor2009-04-071-109/+1
| | | | | | | | Simplify the addition of a case statement to a switch. Fix -print-stats for attribute-qualified types. llvm-svn: 68522
OpenPOWER on IntegriCloud