diff options
author | Mikael Nilsson <mikael.nilsson@arm.com> | 2018-12-13 10:15:27 +0000 |
---|---|---|
committer | Mikael Nilsson <mikael.nilsson@arm.com> | 2018-12-13 10:15:27 +0000 |
commit | 9d2872db7495d35fbc8606d7c5bdf05b7c18f750 (patch) | |
tree | 59bc6a940ee26d236aba1b6633b0e4e8590fcab0 /clang/lib/Sema/SemaExprCXX.cpp | |
parent | ce86b919da2fcf50829fe14201d12ab5bea70343 (diff) | |
download | bcm5719-llvm-9d2872db7495d35fbc8606d7c5bdf05b7c18f750.tar.gz bcm5719-llvm-9d2872db7495d35fbc8606d7c5bdf05b7c18f750.zip |
[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.
Note: This recommits the previously reverted patch,
but now it is commited together with a fix for lldb.
Differential Revision: https://reviews.llvm.org/D54862
llvm-svn: 349019
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index ceb55d9f340..2b054c4b0f3 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -1094,7 +1094,7 @@ QualType Sema::getCurrentThisType() { Sema::CXXThisScopeRAII::CXXThisScopeRAII(Sema &S, Decl *ContextDecl, - unsigned CXXThisTypeQuals, + Qualifiers CXXThisTypeQuals, bool Enabled) : S(S), OldCXXThisTypeOverride(S.CXXThisTypeOverride), Enabled(false) { @@ -1107,11 +1107,10 @@ Sema::CXXThisScopeRAII::CXXThisScopeRAII(Sema &S, else Record = cast<CXXRecordDecl>(ContextDecl); - // We care only for CVR qualifiers here, so cut everything else. - CXXThisTypeQuals &= Qualifiers::FastMask; - S.CXXThisTypeOverride - = S.Context.getPointerType( - S.Context.getRecordType(Record).withCVRQualifiers(CXXThisTypeQuals)); + QualType T = S.Context.getRecordType(Record); + T = S.getASTContext().getQualifiedType(T, CXXThisTypeQuals); + + S.CXXThisTypeOverride = S.Context.getPointerType(T); this->Enabled = true; } |