aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Comment.cpp
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2012-08-06 21:31:15 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2012-08-06 21:31:15 +0000
commit04bf29eb1b197e0a103139ab5d63b0b97432f004 (patch)
treea497e391d843f89efa7861d3c51f199c249d05b9 /lib/AST/Comment.cpp
parenta801acd9773cacdbe16690269ecb47bd127440c5 (diff)
Comment AST: DeclInfo: collapse a bunch of boolean flags into an enum.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161352 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Comment.cpp')
-rw-r--r--lib/AST/Comment.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/lib/AST/Comment.cpp b/lib/AST/Comment.cpp
index e35b2a3d5e..96b09d0e38 100644
--- a/lib/AST/Comment.cpp
+++ b/lib/AST/Comment.cpp
@@ -142,9 +142,7 @@ void DeclInfo::fill() {
// Set defaults.
Kind = OtherKind;
- IsTemplateDecl = false;
- IsTemplateSpecialization = false;
- IsTemplatePartialSpecialization = false;
+ TemplateKind = NotTemplate;
IsObjCMethod = false;
IsInstanceMethod = false;
IsClassMethod = false;
@@ -174,8 +172,7 @@ void DeclInfo::fill() {
ResultType = FD->getResultType();
unsigned NumLists = FD->getNumTemplateParameterLists();
if (NumLists != 0) {
- IsTemplateDecl = true;
- IsTemplateSpecialization = true;
+ TemplateKind = TemplateSpecialization;
TemplateParameters =
FD->getTemplateParameterList(NumLists - 1);
}
@@ -202,7 +199,7 @@ void DeclInfo::fill() {
case Decl::FunctionTemplate: {
const FunctionTemplateDecl *FTD = cast<FunctionTemplateDecl>(ThisDecl);
Kind = FunctionKind;
- IsTemplateDecl = true;
+ TemplateKind = Template;
const FunctionDecl *FD = FTD->getTemplatedDecl();
ParamVars = ArrayRef<const ParmVarDecl *>(FD->param_begin(),
FD->getNumParams());
@@ -213,7 +210,7 @@ void DeclInfo::fill() {
case Decl::ClassTemplate: {
const ClassTemplateDecl *CTD = cast<ClassTemplateDecl>(ThisDecl);
Kind = ClassKind;
- IsTemplateDecl = true;
+ TemplateKind = Template;
TemplateParameters = CTD->getTemplateParameters();
break;
}
@@ -221,15 +218,13 @@ void DeclInfo::fill() {
const ClassTemplatePartialSpecializationDecl *CTPSD =
cast<ClassTemplatePartialSpecializationDecl>(ThisDecl);
Kind = ClassKind;
- IsTemplateDecl = true;
- IsTemplatePartialSpecialization = true;
+ TemplateKind = TemplatePartialSpecialization;
TemplateParameters = CTPSD->getTemplateParameters();
break;
}
case Decl::ClassTemplateSpecialization:
Kind = ClassKind;
- IsTemplateDecl = true;
- IsTemplateSpecialization = true;
+ TemplateKind = TemplateSpecialization;
break;
case Decl::Record:
case Decl::CXXRecord:
@@ -251,7 +246,7 @@ void DeclInfo::fill() {
case Decl::TypeAliasTemplate: {
const TypeAliasTemplateDecl *TAT = cast<TypeAliasTemplateDecl>(ThisDecl);
Kind = TypedefKind;
- IsTemplateDecl = true;
+ TemplateKind = Template;
TemplateParameters = TAT->getTemplateParameters();
break;
}