diff options
author | Artem Belevich <tra@google.com> | 2018-06-28 17:15:52 +0000 |
---|---|---|
committer | Artem Belevich <tra@google.com> | 2018-06-28 17:15:52 +0000 |
commit | 5ce0a08cf6cf7233b1a505957e3ad518b6e9f6e9 (patch) | |
tree | ed79f0b0e543aac107ed99c6b9052dce9ff5157d | |
parent | c9d675266e213ff9311e8b66160781135f0d6971 (diff) | |
download | bcm5719-llvm-5ce0a08cf6cf7233b1a505957e3ad518b6e9f6e9.tar.gz bcm5719-llvm-5ce0a08cf6cf7233b1a505957e3ad518b6e9f6e9.zip |
[CUDA] Place all CUDA sections in __NV_CUDA segment on Mac.
That's where CUDA binaries appear to put them.
Differential Revision: https://reviews.llvm.org/D48615
llvm-svn: 335880
-rw-r--r-- | clang/lib/CodeGen/CGCUDANV.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGCUDANV.cpp b/clang/lib/CodeGen/CGCUDANV.cpp index f8a7825f0a6..b541b1046f5 100644 --- a/clang/lib/CodeGen/CGCUDANV.cpp +++ b/clang/lib/CodeGen/CGCUDANV.cpp @@ -389,8 +389,9 @@ llvm::Function *CGNVCUDARuntime::makeModuleCtorFunction() { FatMagic = HIPFatMagic; } else { if (RelocatableDeviceCode) - // TODO: Figure out how this is called on mac OS! - FatbinConstantName = "__nv_relfatbin"; + FatbinConstantName = CGM.getTriple().isMacOSX() + ? "__NV_CUDA,__nv_relfatbin" + : "__nv_relfatbin"; else FatbinConstantName = CGM.getTriple().isMacOSX() ? "__NV_CUDA,__nv_fatbin" : ".nv_fatbin"; @@ -398,8 +399,9 @@ llvm::Function *CGNVCUDARuntime::makeModuleCtorFunction() { FatbinSectionName = CGM.getTriple().isMacOSX() ? "__NV_CUDA,__fatbin" : ".nvFatBinSegment"; - // TODO: Figure out how this is called on mac OS! - ModuleIDSectionName = "__nv_module_id"; + ModuleIDSectionName = CGM.getTriple().isMacOSX() + ? "__NV_CUDA,__nv_module_id" + : "__nv_module_id"; ModuleIDPrefix = "__nv_"; // For CUDA, create a string literal containing the fat binary loaded from |