summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2018-07-31 18:27:42 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2018-07-31 18:27:42 +0000
commit62a4cb06a927b48b292ff8120e0282e483d97642 (patch)
treef513225152c6478c8bfa6c14a1f1b15ace36807a /clang/lib/CodeGen
parent67caf04d3a131a720da64419a208cf04dc577290 (diff)
downloadbcm5719-llvm-62a4cb06a927b48b292ff8120e0282e483d97642.tar.gz
bcm5719-llvm-62a4cb06a927b48b292ff8120e0282e483d97642.zip
[OPENMP] Change linkage of offloading symbols to support dropping
offload targets. Changed the linkage of omp_offloading.img_start.<triple> and omp_offloading.img_end.<triple> symbols from external to external weak to allow dropping of some targets during linking. llvm-svn: 338413
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGOpenMPRuntime.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index 060f2ea8f5e..fa850155df4 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -3750,11 +3750,13 @@ CGOpenMPRuntime::createOffloadingBinaryDescriptorRegistration() {
StringRef T = Device.getTriple();
std::string BeginName = getName({"omp_offloading", "img_start", ""});
auto *ImgBegin = new llvm::GlobalVariable(
- M, CGM.Int8Ty, /*isConstant=*/true, llvm::GlobalValue::ExternalLinkage,
+ M, CGM.Int8Ty, /*isConstant=*/true,
+ llvm::GlobalValue::ExternalWeakLinkage,
/*Initializer=*/nullptr, Twine(BeginName).concat(T));
std::string EndName = getName({"omp_offloading", "img_end", ""});
auto *ImgEnd = new llvm::GlobalVariable(
- M, CGM.Int8Ty, /*isConstant=*/true, llvm::GlobalValue::ExternalLinkage,
+ M, CGM.Int8Ty, /*isConstant=*/true,
+ llvm::GlobalValue::ExternalWeakLinkage,
/*Initializer=*/nullptr, Twine(EndName).concat(T));
llvm::Constant *Data[] = {ImgBegin, ImgEnd, HostEntriesBegin,
OpenPOWER on IntegriCloud