summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclBase.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* change another PointerIntPair into a PointerUnion.Chris Lattner2009-03-291-31/+17
| | | | llvm-svn: 67991
* switch DeclBase::DeclCtx to the new happy and type-safeChris Lattner2009-03-291-4/+2
| | | | | | llvm::PointerUnion class. llvm-svn: 67988
* adjust to llvm mainline changes.Chris Lattner2009-03-291-1/+1
| | | | llvm-svn: 67980
* Let getIdentifierNamespaceForKind know about aliases and have it treat them ↵Anders Carlsson2009-03-281-0/+1
| | | | | | just like namespace decls. llvm-svn: 67963
* rename NextDeclInScope to NextDeclInContext, since the pointerChris Lattner2009-03-281-7/+7
| | | | | | points within contexts not scopes. llvm-svn: 67919
* minor cleanups: make getIdentifierNamespace() be a single loadChris Lattner2009-03-271-8/+69
| | | | | | instead of a load + large inlined switch. llvm-svn: 67864
* reduce # const_casts, no functionality change.Chris Lattner2009-03-271-2/+2
| | | | llvm-svn: 67861
* change Decl::DeclCtx to use a PointerIntPair instead of hand bitmangling.Chris Lattner2009-03-271-2/+4
| | | | llvm-svn: 67858
* Tighten the setAccess assert. We now allow AS_none if the decl contex is not ↵Anders Carlsson2009-03-251-0/+8
| | | | | | | | a C++ record decl. Also, fix fallout from the change. llvm-svn: 67717
* partially inline getAttrs() to speed up PR3810 (and lots ofChris Lattner2009-03-211-4/+2
| | | | | | other code presumably) by 4.3% llvm-svn: 67430
* rename PrettyStackTraceDecl -> PrettyStackTraceActionsDecl.Chris Lattner2009-03-051-0/+22
| | | | | | | | | | | | | | | | Introduce a new PrettyStackTraceDecl. Use it to add the top level LLVM IR generation stuff in Backend.cpp to stack traces. We now get crashes like: Stack dump: 0. Program arguments: clang t.c -emit-llvm 1. <eof> parser at end of file 2. t.c:1:5: LLVM IR generation of declaration 'a' Abort for IR generation crashes. llvm-svn: 66153
* add an a Attr::Destroy method and force clients to go through it. As part of Chris Lattner2009-03-041-10/+13
| | | | | | this, make DeclBase::Destroy destroy attributes instead of the DeclBase dtor. llvm-svn: 66020
* improve compatibility with GCC 4.4, patch by Michel Salim (PR3697)Chris Lattner2009-03-021-0/+1
| | | | llvm-svn: 65884
* Make the type associated with a ClassTemplateSpecializationDecl be aDouglas Gregor2009-02-261-2/+1
| | | | | | | | nicely sugared type that shows how the user wrote the actual specialization. This sugared type won't actually show up until we start doing instantiations. llvm-svn: 65577
* Use RecordFirst/RecordLast range checks in DeclContextDouglas Gregor2009-02-261-1/+1
| | | | llvm-svn: 65489
* Perform additional semantic checking of class templateDouglas Gregor2009-02-251-0/+8
| | | | | | | | | | | | specializations. In particular: - Make sure class template specializations have a "template<>" header, and complain if they don't. - Make sure class template specializations are declared/defined within a valid context. (e.g., you can't declare a specialization std::vector<MyType> in the global namespace). llvm-svn: 65476
* Add copy assignment operator, caught by doug.Chris Lattner2009-02-231-0/+9
| | | | llvm-svn: 65331
* optimize the 'StoredDeclsMap' for the common case where there is Chris Lattner2009-02-201-44/+121
| | | | | | | | | | exactly one decl with a specific name in a specific context. This avoids a bunch of malloc traffic and shrinks StoredDeclsMap to hold one pointer instead of 3 words (for a std::vector). This speeds up -fsyntax-only on cocoa.h with PTH by ~7.3%. llvm-svn: 65103
* make the redeclaration case faster for the common instance of a redeclarationChris Lattner2009-02-201-8/+19
| | | | | | | | where there is exactly one existing declaration. This is common. this speeds up clang about 3% on cocoa.h for me 0.165 -> 0.160s llvm-svn: 65096
* 80 colsChris Lattner2009-02-201-1/+2
| | | | llvm-svn: 65095
* slight code simplifications.Chris Lattner2009-02-201-15/+12
| | | | llvm-svn: 65094
* only do one DenseMap lookup instead of two (one to find out if there isChris Lattner2009-02-191-12/+12
| | | | | | already an entry and one to insert). llvm-svn: 65030
* minor simplification.Chris Lattner2009-02-191-3/+3
| | | | llvm-svn: 65029
* use early exit to reduce indentation.Chris Lattner2009-02-191-25/+26
| | | | llvm-svn: 65028
* Implement basic parsing and semantic analysis for explicitDouglas Gregor2009-02-171-28/+23
| | | | | | | | | | | | | | | | | | specialization of class templates, e.g., template<typename T> class X; template<> class X<int> { /* blah */ }; Each specialization is a different *Decl node (naturally), and can have different members. We keep track of forward declarations and definitions as for other class/struct/union types. This is only the basic framework: we still have to deal with checking the template headers properly, improving recovery when there are failures, handling nested name specifiers, etc. llvm-svn: 64848
* Move DeclContext::getParent and getLexicalParent in-line.Argyrios Kyrtzidis2009-02-171-8/+0
| | | | llvm-svn: 64806
* Currently all DeclContexts are Decls as well; use cast<Decl> instead of ↵Argyrios Kyrtzidis2009-02-171-8/+2
| | | | | | dyn_cast. llvm-svn: 64805
* DeclContext had its "casting machinery" inside the class definition so that ↵Argyrios Kyrtzidis2009-02-161-2/+46
| | | | | | | | if a new declaration context Decl appeared, the necessary changes would be in one place. Since, now, only DeclNodes.def needs to be modified, move things out-of-line and simplify the DeclContext class. llvm-svn: 64630
* Make DeclContexts maintenance a bit easier.Argyrios Kyrtzidis2009-02-161-1/+1
| | | | | | | | | -In DeclNodes.def, only mark as DeclContexts the top classes that directly derive from DeclContext. If the Decl has subclasses, it should be marked with DECL_CONTEXT_BASE. -Use DeclNodes.def to automate the DeclContext::classof and DeclContext::CastTo definitions. llvm-svn: 64629
* Basic representation of C++ class templates, from Andrew Sutton.Douglas Gregor2009-02-041-1/+2
| | | | llvm-svn: 63750
* Semantic analysis, ASTs, and unqualified name lookup support for C++Douglas Gregor2009-02-031-3/+15
| | | | | | using directives, from Piotr Rak! llvm-svn: 63646
* Add a macro-based enumeration of all of the Decl nodes (like we doDouglas Gregor2009-02-021-225/+27
| | | | | | | with Stmt/Expr nodes), and convert some of the more mundane switch-on-all-decl-kinds uses over to use this new file. llvm-svn: 63570
* Remove many references to ASTContext::getAllocator(), replacing them with ↵Steve Naroff2009-01-271-1/+1
| | | | | | | | calls to the recently added placement new (which uses ASTContext's allocator for memory). Also added ASTContext::Deallocate(). This will simplify runtime replacement of ASTContext's allocator. Keeping the allocator private (and removing getAllocator() entirely) is also goodness. llvm-svn: 63135
* Allocate expresssions through ASTContext (still more work to do).Steve Naroff2009-01-201-0/+29
| | | | | | Add debug hook to DeclContext. llvm-svn: 62605
* Rename DeclContext::insert to DeclContext::makeDeclVisibleInContext and ↵Douglas Gregor2009-01-201-8/+8
| | | | | | document both it and DeclContext::addDecl properly llvm-svn: 62581
* Remove the TopLevelDecls from TranslationUnit, since all of those decls are ↵Douglas Gregor2009-01-201-15/+10
| | | | | | owned by the ASTContext's TranslationUnitDecl. There are definitely some leaking Decls now that I'll tackle tomorrow llvm-svn: 62568
* Remove ScopedDecl, collapsing all of its functionality into Decl, soDouglas Gregor2009-01-201-35/+59
| | | | | | | | | | | | | | | | 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
* Teach DeclContext how to find the primary declaration for any TagDeclDouglas Gregor2009-01-171-29/+7
| | | | | | | | | | | | | 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
* Fix a subtle bug in DeclContext::DestroyDecls().Steve Naroff2009-01-141-4/+8
| | | | llvm-svn: 62205
* Turn off some Destroy calls that are currenly causing double-destruction of ↵Douglas Gregor2009-01-131-1/+5
| | | | | | ScopedDecls. We will re-enable this later, when we have time to fully solve the ownership issue. llvm-svn: 62175
OpenPOWER on IntegriCloud