diff options
author | Anastasia Stulova <anastasia.stulova@arm.com> | 2018-05-09 13:23:26 +0000 |
---|---|---|
committer | Anastasia Stulova <anastasia.stulova@arm.com> | 2018-05-09 13:23:26 +0000 |
commit | 442dc06868eabebc595a167195064eaaa03e45a9 (patch) | |
tree | 208e09f51a72be29c3d9bef57085b26b9ed95d7d /lib/AST/Expr.cpp | |
parent | 9741e8bd919adb88acf18d39dea02a8da9cb90bd (diff) | |
download | clang-442dc06868eabebc595a167195064eaaa03e45a9.tar.gz |
[OpenCL] Add constant address space to __func__ in AST.
Added string literal helper function to obtain the type
attributed by a constant address space.
Also fixed predefind __func__ expr to use the helper
to constract the string literal correctly.
Differential Revision: https://reviews.llvm.org/D46049
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331877 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index d331c32d2f..f3338dcfa9 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -881,7 +881,8 @@ StringLiteral *StringLiteral::CreateEmpty(const ASTContext &C, void *Mem = C.Allocate(sizeof(StringLiteral) + sizeof(SourceLocation) * (NumStrs - 1), alignof(StringLiteral)); - StringLiteral *SL = new (Mem) StringLiteral(QualType()); + StringLiteral *SL = + new (Mem) StringLiteral(C.adjustStringLiteralBaseType(QualType())); SL->CharByteWidth = 0; SL->Length = 0; SL->NumConcatenated = NumStrs; |