diff options
author | David Blaikie <dblaikie@gmail.com> | 2012-08-10 00:55:35 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2012-08-10 00:55:35 +0000 |
commit | 4ef832ffc1147ce2f9777f9fad650cb3139a1d00 (patch) | |
tree | dc93f3b50bb92e4186c00d1311690f5325daa33f /lib/Sema | |
parent | 74896e074856c3248d88ddddf45bfda7256ab022 (diff) |
Provide isConst/Volatile on CXXMethodDecl.
This also provides isConst/Volatile/Restrict on FunctionTypes to coalesce
the implementation with other callers (& update those other callers).
Patch contributed by Sam Panzer (panzer@google.com).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161647 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/SemaCodeComplete.cpp | 6 | ||||
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 4 | ||||
-rw-r--r-- | lib/Sema/SemaLambda.cpp | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index bb0840558a..2e099e96a4 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -2369,11 +2369,11 @@ AddFunctionTypeQualsToCompletionString(CodeCompletionBuilder &Result, // Handle multiple qualifiers. std::string QualsStr; - if (Proto->getTypeQuals() & Qualifiers::Const) + if (Proto->isConst()) QualsStr += " const"; - if (Proto->getTypeQuals() & Qualifiers::Volatile) + if (Proto->isVolatile()) QualsStr += " volatile"; - if (Proto->getTypeQuals() & Qualifiers::Restrict) + if (Proto->isRestrict()) QualsStr += " restrict"; Result.AddInformativeChunk(Result.getAllocator().CopyString(QualsStr)); } diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 2ee9e84a61..3aae99ab74 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -4852,7 +4852,7 @@ static NamedDecl* DiagnoseInvalidRedeclaration( bool NewFDisConst = false; if (CXXMethodDecl *NewMD = dyn_cast<CXXMethodDecl>(NewFD)) - NewFDisConst = NewMD->getTypeQualifiers() & Qualifiers::Const; + NewFDisConst = NewMD->isConst(); for (llvm::SmallVector<std::pair<FunctionDecl*, unsigned>, 1>::iterator NearMatch = NearMatches.begin(), NearMatchEnd = NearMatches.end(); @@ -4860,7 +4860,7 @@ static NamedDecl* DiagnoseInvalidRedeclaration( FunctionDecl *FD = NearMatch->first; bool FDisConst = false; if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD)) - FDisConst = MD->getTypeQualifiers() & Qualifiers::Const; + FDisConst = MD->isConst(); if (unsigned Idx = NearMatch->second) { ParmVarDecl *FDParam = FD->getParamDecl(Idx-1); diff --git a/lib/Sema/SemaLambda.cpp b/lib/Sema/SemaLambda.cpp index 3a10c2af91..6414c6fbac 100644 --- a/lib/Sema/SemaLambda.cpp +++ b/lib/Sema/SemaLambda.cpp @@ -437,7 +437,7 @@ void Sema::ActOnStartOfLambdaDefinition(LambdaIntroducer &Intro, LambdaScopeInfo *LSI = enterLambdaScope(Method, Intro.Range, Intro.Default, ExplicitParams, ExplicitResultType, - (Method->getTypeQualifiers() & Qualifiers::Const) == 0); + !Method->isConst()); // Handle explicit captures. SourceLocation PrevCaptureLoc |