From 561bba2e9f3e67979b0cf6104b48067f8f7d6647 Mon Sep 17 00:00:00 2001 From: Joey Gouly Date: Thu, 14 Nov 2013 18:26:10 +0000 Subject: [OpenCL] Make sure we put string literals in the constant address space. llvm-svn: 194717 --- clang/lib/AST/ExprClassification.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/AST/ExprClassification.cpp') diff --git a/clang/lib/AST/ExprClassification.cpp b/clang/lib/AST/ExprClassification.cpp index 4640d7d37d6..54f77efef0f 100644 --- a/clang/lib/AST/ExprClassification.cpp +++ b/clang/lib/AST/ExprClassification.cpp @@ -592,6 +592,8 @@ static Cl::ModifiableType IsModifiable(ASTContext &Ctx, const Expr *E, // Const stuff is obviously not modifiable. if (CT.isConstQualified()) return Cl::CM_ConstQualified; + if (CT.getQualifiers().getAddressSpace() == LangAS::opencl_constant) + return Cl::CM_ConstQualified; // Arrays are not modifiable, only their elements are. if (CT->isArrayType()) -- cgit v1.2.3