summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclBase.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* 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
OpenPOWER on IntegriCloud