diff options
author | Mikael Nilsson <mikael.nilsson@arm.com> | 2018-12-12 14:11:59 +0000 |
---|---|---|
committer | Mikael Nilsson <mikael.nilsson@arm.com> | 2018-12-12 14:11:59 +0000 |
commit | 8e20f7a8e079e9229434a170e7e451eb3c779966 (patch) | |
tree | 41b4fe607bea3167baa47bc7cfb5f4cae141367a /lib/Parse/ParseDecl.cpp | |
parent | df55f5633e966afc4b3d5fc76e76f89ba4140b3c (diff) | |
download | clang-8e20f7a8e079e9229434a170e7e451eb3c779966.tar.gz |
[OpenCL] Add generic AS to 'this' pointer
Address spaces are cast into generic before invoking the constructor.
Added support for a trailing Qualifiers object in FunctionProtoType.
Differential Revision: https://reviews.llvm.org/D54862
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348927 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index bff91793d9..caf443de63 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -1427,7 +1427,7 @@ void Parser::ParseLexedAttribute(LateParsedAttribute &LA, RecordDecl *RD = dyn_cast_or_null<RecordDecl>(D->getDeclContext()); // Allow 'this' within late-parsed attributes. - Sema::CXXThisScopeRAII ThisScope(Actions, RD, /*TypeQuals=*/0, + Sema::CXXThisScopeRAII ThisScope(Actions, RD, Qualifiers(), ND && ND->isCXXInstanceMember()); if (LA.Decls.size() == 1) { @@ -6162,13 +6162,14 @@ void Parser::ParseFunctionDeclarator(Declarator &D, : D.getContext() == DeclaratorContext::FileContext && D.getCXXScopeSpec().isValid() && Actions.CurContext->isRecord()); - Sema::CXXThisScopeRAII ThisScope(Actions, - dyn_cast<CXXRecordDecl>(Actions.CurContext), - DS.getTypeQualifiers() | - (D.getDeclSpec().isConstexprSpecified() && - !getLangOpts().CPlusPlus14 - ? Qualifiers::Const : 0), - IsCXX11MemberFunction); + + Qualifiers Q = Qualifiers::fromCVRUMask(DS.getTypeQualifiers()); + if (D.getDeclSpec().isConstexprSpecified() && !getLangOpts().CPlusPlus14) + Q.addConst(); + + Sema::CXXThisScopeRAII ThisScope( + Actions, dyn_cast<CXXRecordDecl>(Actions.CurContext), Q, + IsCXX11MemberFunction); // Parse exception-specification[opt]. bool Delayed = D.isFirstDeclarationOfMember() && |