aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorAlexey Bader <alexey.bader@intel.com>2019-12-20 12:05:42 +0300
committerAlexey Bader <alexey.bader@intel.com>2021-04-26 13:44:10 +0300
commit7818906ca134775edffb77857f436359d3a50b90 (patch)
tree55ee4f777586912db12ce49d4191d9c9a8038c86 /clang/lib/CodeGen/CodeGenModule.h
parent691badc3d6a76ceb98530d58f80c11565337d767 (diff)
downloadllvm-7818906ca134775edffb77857f436359d3a50b90.zip
llvm-7818906ca134775edffb77857f436359d3a50b90.tar.gz
llvm-7818906ca134775edffb77857f436359d3a50b90.tar.bz2
[SYCL] Implement SYCL address space attributes handling
Default address space (applies when no explicit address space was specified) maps to generic (4) address space. Added SYCL named address spaces `sycl_global`, `sycl_local` and `sycl_private` defined as sub-sets of the default address space. Static variables without address space now reside in global address space when compile for SPIR target, unless they have an explicit address space qualifier in source code. Differential Revision: https://reviews.llvm.org/D89909
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index 83230db..32d74c5 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -855,6 +855,13 @@ public:
/// space, target-specific global or constant address space may be returned.
LangAS GetGlobalVarAddressSpace(const VarDecl *D);
+ /// Return the AST address space of constant literal, which is used to emit
+ /// the constant literal as global variable in LLVM IR.
+ /// Note: This is not necessarily the address space of the constant literal
+ /// in AST. For address space agnostic language, e.g. C++, constant literal
+ /// in AST is always in default address space.
+ LangAS GetGlobalConstantAddressSpace() const;
+
/// Return the llvm::Constant for the address of the given global variable.
/// If Ty is non-null and if the global doesn't exist, then it will be created
/// with the specified type instead of whatever the normal requested type
@@ -866,13 +873,6 @@ public:
ForDefinition_t IsForDefinition
= NotForDefinition);
- /// Return the AST address space of string literal, which is used to emit
- /// the string literal as global variable in LLVM IR.
- /// Note: This is not necessarily the address space of the string literal
- /// in AST. For address space agnostic language, e.g. C++, string literal
- /// in AST is always in default address space.
- LangAS getStringLiteralAddressSpace() const;
-
/// Return the address of the given function. If Ty is non-null, then this
/// function will use the specified type if it has to create it.
llvm::Constant *GetAddrOfFunction(GlobalDecl GD, llvm::Type *Ty = nullptr,