OLD | NEW |
1 //===------- SemaTemplate.h - C++ Templates ---------------------*- C++ -*-===/ | 1 //===------- SemaTemplate.h - C++ Templates ---------------------*- C++ -*-===/ |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 //===----------------------------------------------------------------------===/ | 7 //===----------------------------------------------------------------------===/ |
8 // | 8 // |
9 // This file provides types used in the semantic analysis of C++ templates. | 9 // This file provides types used in the semantic analysis of C++ templates. |
10 // | 10 // |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 assert(Depth < TemplateArgumentLists.size()); | 87 assert(Depth < TemplateArgumentLists.size()); |
88 assert(Index < TemplateArgumentLists[getNumLevels() - Depth - 1].size()); | 88 assert(Index < TemplateArgumentLists[getNumLevels() - Depth - 1].size()); |
89 const_cast<TemplateArgument&>( | 89 const_cast<TemplateArgument&>( |
90 TemplateArgumentLists[getNumLevels() - Depth - 1][Index]) | 90 TemplateArgumentLists[getNumLevels() - Depth - 1][Index]) |
91 = Arg; | 91 = Arg; |
92 } | 92 } |
93 | 93 |
94 /// \brief Add a new outermost level to the multi-level template argument | 94 /// \brief Add a new outermost level to the multi-level template argument |
95 /// list. | 95 /// list. |
96 void addOuterTemplateArguments(const TemplateArgumentList *TemplateArgs) { | 96 void addOuterTemplateArguments(const TemplateArgumentList *TemplateArgs) { |
97 addOuterTemplateArguments(ArgList(TemplateArgs->data(), | 97 TemplateArgumentLists.push_back(ArgList(TemplateArgs->data(), |
98 TemplateArgs->size())); | 98 TemplateArgs->size())); |
99 } | 99 } |
100 | 100 |
101 /// \brief Add a new outmost level to the multi-level template argument | 101 /// \brief Add a new outmost level to the multi-level template argument |
102 /// list. | 102 /// list. |
103 void addOuterTemplateArguments(const TemplateArgument *Args, | 103 void addOuterTemplateArguments(const TemplateArgument *Args, |
104 unsigned NumArgs) { | 104 unsigned NumArgs) { |
105 addOuterTemplateArguments(ArgList(Args, NumArgs)); | 105 TemplateArgumentLists.push_back(ArgList(Args, NumArgs)); |
106 } | 106 } |
107 | 107 |
108 /// \brief Add a new outmost level to the multi-level template argument | |
109 /// list. | |
110 void addOuterTemplateArguments(ArgList Args) { | |
111 TemplateArgumentLists.push_back(Args); | |
112 } | |
113 | |
114 /// \brief Retrieve the innermost template argument list. | 108 /// \brief Retrieve the innermost template argument list. |
115 const ArgList &getInnermost() const { | 109 const ArgList &getInnermost() const { |
116 return TemplateArgumentLists.front(); | 110 return TemplateArgumentLists.front(); |
117 } | 111 } |
118 }; | 112 }; |
119 | 113 |
120 /// \brief The context in which partial ordering of function templates occurs. | 114 /// \brief The context in which partial ordering of function templates occurs. |
121 enum TPOC { | 115 enum TPOC { |
122 /// \brief Partial ordering of function templates for a function call. | 116 /// \brief Partial ordering of function templates for a function call. |
123 TPOC_Call, | 117 TPOC_Call, |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 Decl *InstantiateTypedefNameDecl(TypedefNameDecl *D, bool IsTypeAlias); | 497 Decl *InstantiateTypedefNameDecl(TypedefNameDecl *D, bool IsTypeAlias); |
504 ClassTemplatePartialSpecializationDecl * | 498 ClassTemplatePartialSpecializationDecl * |
505 InstantiateClassTemplatePartialSpecialization( | 499 InstantiateClassTemplatePartialSpecialization( |
506 ClassTemplateDecl *ClassTemplate, | 500 ClassTemplateDecl *ClassTemplate, |
507 ClassTemplatePartialSpecializationDecl *PartialSpec); | 501 ClassTemplatePartialSpecializationDecl *PartialSpec); |
508 void InstantiateEnumDefinition(EnumDecl *Enum, EnumDecl *Pattern); | 502 void InstantiateEnumDefinition(EnumDecl *Enum, EnumDecl *Pattern); |
509 }; | 503 }; |
510 } | 504 } |
511 | 505 |
512 #endif // LLVM_CLANG_SEMA_TEMPLATE_H | 506 #endif // LLVM_CLANG_SEMA_TEMPLATE_H |
OLD | NEW |