summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix handling of dependent nested namespace specifiers in UsingDeclsDouglas Gregor2010-09-291-4/+20
| | | | | | during template instantiation, from Martin Vejnar! llvm-svn: 115051
* Reinstate r114925 and r114929, both steps towardDouglas Gregor2010-09-281-2/+1
| | | | | | <rdar://problem/8459981>. llvm-svn: 114984
* Temporarily revert 114929 114925 114924 114921. It looked like they (or at leastBill Wendling2010-09-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | one of them) was causing a series of failures: http://google1.osuosl.org:8011/builders/clang-x86_64-darwin10-selfhost/builds/4518 svn merge -c -114929 https://llvm.org/svn/llvm-project/cfe/trunk --- Reverse-merging r114929 into '.': U include/clang/Sema/Sema.h U include/clang/AST/DeclCXX.h U lib/Sema/SemaDeclCXX.cpp U lib/Sema/SemaTemplateInstantiateDecl.cpp U lib/Sema/SemaDecl.cpp U lib/Sema/SemaTemplateInstantiate.cpp U lib/AST/DeclCXX.cpp svn merge -c -114925 https://llvm.org/svn/llvm-project/cfe/trunk --- Reverse-merging r114925 into '.': G include/clang/AST/DeclCXX.h G lib/Sema/SemaDeclCXX.cpp G lib/AST/DeclCXX.cpp svn merge -c -114924 https://llvm.org/svn/llvm-project/cfe/trunk --- Reverse-merging r114924 into '.': G include/clang/AST/DeclCXX.h G lib/Sema/SemaDeclCXX.cpp G lib/Sema/SemaDecl.cpp G lib/AST/DeclCXX.cpp U lib/AST/ASTContext.cpp svn merge -c -114921 https://llvm.org/svn/llvm-project/cfe/trunk --- Reverse-merging r114921 into '.': G include/clang/AST/DeclCXX.h G lib/Sema/SemaDeclCXX.cpp G lib/Sema/SemaDecl.cpp G lib/AST/DeclCXX.cpp llvm-svn: 114933
* Centralize the management of CXXRecordDecl::DefinitionData'sDouglas Gregor2010-09-281-2/+1
| | | | | | | | | | | HasTrivialConstructor, HasTrivialCopyConstructor, HasTrivialCopyAssignment, and HasTrivialDestructor bits in CXXRecordDecl's methods. This completes all but the Abstract bit and the set of conversion functions, both of which will require a bit of extra work. The majority of <rdar://problem/8459981> is now implemented (but not all of it). llvm-svn: 114929
* When emitting a new-expression inside a conditional expression,John McCall2010-09-171-1/+2
| | | | | | | | | | | | | | | | the cleanup might not be dominated by the allocation code. In this case, we have to store aside all the delete arguments in case we need them later. There's room for optimization here in cases where we end up not actually needing the cleanup in different branches (or being able to pop it after the initialization code). Also make sure we only call this operator delete along the path where we actually allocated something. Fixes rdar://problem/8439196. llvm-svn: 114145
* Diagnose the instantiation of variables (including static dataDouglas Gregor2010-09-121-0/+6
| | | | | | members) with function type. Fixes PR8047. llvm-svn: 113723
* Eliminate the comma locations from all of the Sema routines that dealDouglas Gregor2010-09-091-17/+5
| | | | | | | | with comma-separated lists. We never actually used the comma locations, nor did we store them in the AST, but we did manage to waste time during template instantiation to produce fake locations. llvm-svn: 113495
* Fix PR7402 when it strikes via template instantiation.Chandler Carruth2010-09-031-0/+5
| | | | llvm-svn: 113019
* Rename DeclContext::getLookupContext to getRedeclContext and change its ↵Sebastian Redl2010-08-311-2/+2
| | | | | | semantics slightly. No functionality change in the absence of inline namespaces. Also, change a few places where inline namespaces actually make a difference to be prepared for them. llvm-svn: 112563
* When template substitution into a template parameter reduces the levelDouglas Gregor2010-08-301-6/+8
| | | | | | | | | | | | of that parameter, reduce the level by the number of active template argument lists rather than by 1. The number of active template argument lists is only > 1 when we have a class template partial specialization of a member template of a class template that itself is a member template of another class template. ... and Boost.MSM does this. Fixes PR7669. llvm-svn: 112551
* zap tabsGabor Greif2010-08-301-1/+1
| | | | llvm-svn: 112541
* fix dual aspect of PR8007,Gabor Greif2010-08-301-3/+19
| | | | | | | | | | namely when the friend function prototype is already used at the point of the template definition that is supposed to inject the friend function. Testcase verifies four scenarios. I would like receive some code review for this. llvm-svn: 112524
* simplify by relying on cascading operator->Gabor Greif2010-08-281-3/+3
| | | | llvm-svn: 112373
* simplifyGabor Greif2010-08-281-2/+3
| | | | llvm-svn: 112372
* One who seeks knowledge learns something new every day.John McCall2010-08-261-14/+12
| | | | | | | | | One who seeks the Tao unlearns something new every day. Less and less remains until you arrive at non-action. When you arrive at non-action, nothing will be left undone. llvm-svn: 112244
* Split out a header to hold APIs meant for the Sema implementation from Sema.h.John McCall2010-08-251-1/+1
| | | | | | | Clients of Sema don't need to know (for example) the list of diagnostics we support. llvm-svn: 112093
* Rename *PendingImplicitInstantiations to *PendingInstantiations. NoChandler Carruth2010-08-251-15/+15
| | | | | | functionality changed. llvm-svn: 112040
* Support explicit instantiation of function templates and members of classChandler Carruth2010-08-251-8/+24
| | | | | | | | | | | | | templates when only the declaration is in scope. This requires deferring the instantiation to be lazy, and ensuring the definition is required for that translation unit. We re-use the existing pending instantiation queue, previously only used to track implicit instantiations which were required to be lazy. Fixes PR7979. A subsequent change will rename *PendingImplicitInstantiations to *PendingInstatiations for clarity given its broader role. llvm-svn: 112037
* Move more stuff out of Sema.h.John McCall2010-08-251-6/+6
| | | | llvm-svn: 112026
* Struggle mightily against header inclusion in Sema.h.John McCall2010-08-241-0/+1
| | | | llvm-svn: 111904
* OwningExprResult -> ExprResult. This patch brought to you byJohn McCall2010-08-241-10/+8
| | | | | | | M-x query-replace-regexp \(Sema::\|Action::\|Parser::\|\)Owning\(Expr\|Stmt\)Result -> \2Result llvm-svn: 111903
* Kill off ExprArg (now just Expr*) and StmtArg (now just Stmt*).John McCall2010-08-231-8/+6
| | | | llvm-svn: 111863
* Sundry incremental steps towards killing off Action.John McCall2010-08-231-5/+5
| | | | llvm-svn: 111795
* DeclPtrTy -> Decl *John McCall2010-08-211-18/+15
| | | | llvm-svn: 111733
* Correctly instantiate templates with non-type template arguments thatJohn McCall2010-08-191-1/+1
| | | | | | are local externs. Fixes <rdar://problem/8302138>. llvm-svn: 111570
* Generate Attr subclasses with TableGen.Alexis Hunt2010-08-181-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | Now all classes derived from Attr are generated from TableGen. Additionally, Attr* is no longer its own linked list; SmallVectors or Attr* are used. The accompanying LLVM commit contains the updates to TableGen necessary for this. Some other notes about newly-generated attribute classes: - The constructor arguments are a SourceLocation and a Context&, followed by the attributes arguments in the order that they were defined in Attr.td - Every argument in Attr.td has an appropriate accessor named getFoo, and there are sometimes a few extra ones (such as to get the length of a variadic argument). Additionally, specific_attr_iterator has been introduced, which will iterate over an AttrVec, but only over attributes of a certain type. It can be accessed through either Decl::specific_attr_begin/end or the global functions of the same name. llvm-svn: 111455
* zap dead code.Chris Lattner2010-08-181-4/+0
| | | | llvm-svn: 111365
* Use Enumerators.data() instead of &Enumerators[0] to fix a potentialEli Friedman2010-08-151-1/+1
| | | | | | assertion failure. llvm-svn: 111092
* Commit improved version of 111026 & 111027.Argyrios Kyrtzidis2010-08-151-2/+2
| | | | | | | | | | | | | | | | | | | | Unused warnings for functions: -static functions -functions in anonymous namespace -class methods in anonymous namespace -class method specializations in anonymous namespace -function specializations in anonymous namespace Unused warnings for variables: -static variables -variables in anonymous namespace -static data members in anonymous namespace -static data members specializations in anonymous namespace Reveals lots of opportunities for dead code removal in llvm codebase that will interest my esteemed colleagues. llvm-svn: 111086
* Revert 111026 & 111027, build breakage.Argyrios Kyrtzidis2010-08-131-7/+1
| | | | llvm-svn: 111036
* The unused warnings extravaganza continues. Warn for:Argyrios Kyrtzidis2010-08-131-1/+3
| | | | | | | | | -static variables -variables in anonymous namespace (fixes rdar://7794535) -static data members in anonymous namespace -static data members specializations in anonymous namespace llvm-svn: 111027
* Expand the unused warnings for functions. Warn for:Argyrios Kyrtzidis2010-08-131-0/+4
| | | | | | | | | | -static function declarations -functions in anonymous namespace -class methods in anonymous namespace -class method specializations in anonymous namespace -function specializations in anonymous namespace llvm-svn: 111026
* Move Sema's headers into include/clang/Sema, renaming a few along the way.Douglas Gregor2010-08-121-2/+2
| | | | llvm-svn: 110945
* Added locations and type source info for DeclarationName inside UsingDecl.Abramo Bagnara2010-08-121-9/+13
| | | | llvm-svn: 110912
* Added locations and type source info for DeclarationName.Abramo Bagnara2010-08-111-22/+10
| | | | llvm-svn: 110860
* Remove the DeclaredInCondition bit now that it's no longer used.Nick Lewycky2010-08-061-1/+0
| | | | llvm-svn: 110432
* Instantiate attributes from the pattern record when instantiatingJohn McCall2010-08-011-13/+12
| | | | | | a class template. Fixes rdar://problem/8243419. llvm-svn: 109967
* Remove the vast majority of the Destroy methods from the AST library,Douglas Gregor2010-07-251-6/+1
| | | | | | since we aren't going to be calling them ever. llvm-svn: 109377
* Hide FunctionTemplateDecl's specializations folding set as implementation ↵Argyrios Kyrtzidis2010-07-201-18/+10
| | | | | | | | | | | detail and introduce FunctionTemplateDecl::findSpecialization. Redeclarations of specializations will not cause the previous decl to be removed from the set, the set will keep the canonical decl. findSpecialization will return the most recent redeclaration. llvm-svn: 108834
* Hide the specializations folding sets of ClassTemplateDecl as an ↵Argyrios Kyrtzidis2010-07-201-20/+5
| | | | | | | | | | | | | implementation detail (InsertPos leaks though) and add methods to its interface for adding/finding specializations. Simplifies its users a bit and we no longer need to replace specializations in the folding set with their redeclarations. We just return the most recent redeclarations. As a bonus, it fixes http://llvm.org/PR7670. llvm-svn: 108832
* When instantiating function definitions set parameter names to those used in ↵Peter Collingbourne2010-07-181-4/+8
| | | | | | | | | | | | | | template The rationale is that we are copying the entire definition including parameter names which may differ between the declaration and the definition. This is particularly important if any parameters are unnamed in the declaration, as a DeclRef to an unnamed ParmVarDecl would cause the pretty printer to produce invalid output. llvm-svn: 108643
* Set DeclContext of ParamVarDecl only. No needFariborz Jahanian2010-07-131-3/+0
| | | | | | | to set that of VarDecl for block variables (they are already set). Per Doug's comment. llvm-svn: 108273
* More block instantiation stuff. Set variable/param DeclContextFariborz Jahanian2010-07-131-0/+3
| | | | | | to block context when first instantiating them. llvm-svn: 108266
* Instantiate attributes when first building an instantiatedFariborz Jahanian2010-07-131-6/+3
| | | | | | VarDecl. llvm-svn: 108218
* Copy over attributes to instantiated variable.Fariborz Jahanian2010-07-121-1/+4
| | | | llvm-svn: 108195
* When performing substitution of template arguments within the body ofDouglas Gregor2010-07-081-10/+20
| | | | | | | a template, be sure to include the template arguments from the injected-class-name. Fixes PR7587. llvm-svn: 107895
* Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead ↵Argyrios Kyrtzidis2010-07-071-3/+3
| | | | | | | | of getBody() when we are just checking the existence of a body, to avoid de-serialization of the body from PCH. Makes de-serialization of the function body even more "lazier". llvm-svn: 107768
* Implement dependent alignment attribute support. This is a bit gross given theChandler Carruth2010-06-251-4/+19
| | | | | | | | | | | | | current attribute system, but it is enough to handle class templates which specify parts of their alignment in terms of their template parameters. This also replaces the attributes test in SemaTemplate with one that actually tests working attributes instead of broken ones. I plan to add more tests here for non-dependent attributes in a subsequent patch. Thanks to John for walking me through some of this. =D llvm-svn: 106818
* Given Decl::isUsed() a flag indicating when to consider the "used"Douglas Gregor2010-06-171-1/+3
| | | | | | | | | attribute as part of the calculation. Sema::MarkDeclReferenced(), and a few other places, want only to consider the "used" bit to determine, e.g, whether to perform template instantiation. Fixes a linkage issue with Boost.Serialization. llvm-svn: 106252
* Revert r106099; it broke self-host.Douglas Gregor2010-06-161-3/+5
| | | | llvm-svn: 106100
OpenPOWER on IntegriCloud