summaryrefslogtreecommitdiff
path: root/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-08-02 17:59:51 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-08-02 17:59:51 +0000
commit7cb19e8bd99e7a7f926ad363aa2b4dd58fb8e380 (patch)
tree8d5195e81c160c2a7c7d93674e053a67d0f31092 /contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp
parent1c4688a8498fea1db507842ff8dedaacad8ef77b (diff)
parentc7e70c433efc6953dc3888b9fbf9f3512d7da2b0 (diff)
Notes
Diffstat (limited to 'contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp
index ecdf78d4b347..8c5e0df0969b 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp
@@ -1431,7 +1431,7 @@ void CodeGenModule::setNonAliasAttributes(GlobalDecl GD,
F->addAttributes(llvm::AttributeList::FunctionIndex, Attrs);
}
}
-
+
if (const auto *CSA = D->getAttr<CodeSegAttr>())
GO->setSection(CSA->getName());
else if (const auto *SA = D->getAttr<SectionAttr>())
@@ -3176,6 +3176,10 @@ LangAS CodeGenModule::GetGlobalVarAddressSpace(const VarDecl *D) {
return LangAS::cuda_constant;
else if (D && D->hasAttr<CUDASharedAttr>())
return LangAS::cuda_shared;
+ else if (D && D->hasAttr<CUDADeviceAttr>())
+ return LangAS::cuda_device;
+ else if (D && D->getType().isConstQualified())
+ return LangAS::cuda_constant;
else
return LangAS::cuda_device;
}