summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-05-21 18:20:08 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2019-05-21 18:20:08 +0000
commit6b21c4a4eed8e7a5ab5d80dfe207eadb7cf5a6ab (patch)
tree0e0c17b3356549787796cc107bdb4c58764247a7 /clang/lib/CodeGen/CodeGenModule.cpp
parentc1b6b9a177760b73f3cfb1c8df5f9cb0a3253068 (diff)
downloadbcm5719-llvm-6b21c4a4eed8e7a5ab5d80dfe207eadb7cf5a6ab.tar.gz
bcm5719-llvm-6b21c4a4eed8e7a5ab5d80dfe207eadb7cf5a6ab.zip
[OPENMP]Use the attributes for dso locality when building for device.
Currently, we ignore all dso locality attributes/info when building for the device and thus all symblos are externally visible and can be preemted at the runtime. It may lead to incorrect results. We need to follow the same logic, compiler uses for static/pie builds. llvm-svn: 361283
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index e592442e6bd..f062f83425a 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -798,7 +798,7 @@ static bool shouldAssumeDSOLocal(const CodeGenModule &CGM,
const auto &CGOpts = CGM.getCodeGenOpts();
llvm::Reloc::Model RM = CGOpts.RelocationModel;
const auto &LOpts = CGM.getLangOpts();
- if (RM != llvm::Reloc::Static && !LOpts.PIE)
+ if (RM != llvm::Reloc::Static && !LOpts.PIE && !LOpts.OpenMPIsDevice)
return false;
// A definition cannot be preempted from an executable.
OpenPOWER on IntegriCloud