From 7248349dd59448b0ececdc70aa03bfeb869b19da Mon Sep 17 00:00:00 2001 From: foreman Date: Sun, 8 Mar 2015 14:31:29 -0400 Subject: [PATCH] P4 to Git Change 1128505 by smekhano@stas-solstice-HSA on 2015/03/08 14:17:51 ECR #333753 - Part of the changes to allow use of llvm 3.6 These changes required with llvm 3.6 but do not break compilation with llvm 3.2. Testing: precheckin, smoke Reviewed by Brian Sumner Affected files ... ... //depot/stg/opencl/drivers/opencl/compiler/lib/amdoclcl.def.in#10 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/amdoclcl.map.in#9 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/build/Makefile.common#28 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/spir.hpp#4 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/cpu/build/Makefile.cpu#10 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/gpu/MDParser/AMDILMDTypes.h#2 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/gpu/build/Makefile.gpu#29 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/gpu/hsail_be.cpp#38 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/gpu/sc/HSAIL/hsail-tools/HSAILAsm/HSAILAsm.cpp#5 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/gpu/sc/HSAIL/hsail-tools/htdefs#6 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/jit/src/build/Makefile.src#4 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/jit/src/jit.cpp#14 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/top.hpp#5 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpuprogram.cpp#63 edit --- rocclr/compiler/lib/amdoclcl.def.in | 2 ++ rocclr/compiler/lib/amdoclcl.map.in | 2 ++ rocclr/compiler/lib/backends/common/spir.hpp | 2 +- rocclr/compiler/lib/promotions/oclutils/top.hpp | 4 +++- rocclr/runtime/device/cpu/cpuprogram.cpp | 3 ++- 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/rocclr/compiler/lib/amdoclcl.def.in b/rocclr/compiler/lib/amdoclcl.def.in index 981004bdb7..797c4bfcbb 100644 --- a/rocclr/compiler/lib/amdoclcl.def.in +++ b/rocclr/compiler/lib/amdoclcl.def.in @@ -92,7 +92,9 @@ aclJITObjectImageDestroy aclJITObjectImageFinalize aclJITObjectImageSize aclJITObjectImageData +#if defined(LEGACY_COMPLIB) aclJITObjectImageDisassembleKernel +#endif aclJITObjectImageIterateSymbols aclJITObjectImageGetGlobalsSize #if defined(WITH_TARGET_HSAIL) diff --git a/rocclr/compiler/lib/amdoclcl.map.in b/rocclr/compiler/lib/amdoclcl.map.in index 1ca2459ab9..cf282d315b 100644 --- a/rocclr/compiler/lib/amdoclcl.map.in +++ b/rocclr/compiler/lib/amdoclcl.map.in @@ -92,7 +92,9 @@ global: aclJITObjectImageFinalize; aclJITObjectImageSize; aclJITObjectImageData; +#if defined(LEGACY_COMPLIB) aclJITObjectImageDisassembleKernel; +#endif aclJITObjectImageIterateSymbols; aclJITObjectImageGetGlobalsSize; #if defined(WITH_TARGET_HSAIL) diff --git a/rocclr/compiler/lib/backends/common/spir.hpp b/rocclr/compiler/lib/backends/common/spir.hpp index 73d346df8e..c877737970 100644 --- a/rocclr/compiler/lib/backends/common/spir.hpp +++ b/rocclr/compiler/lib/backends/common/spir.hpp @@ -27,7 +27,7 @@ namespace amdcl : LLVMCompilerStage(cl, elf, log) {} virtual ~SPIR() {} - virtual llvm::Module* loadBitcode(std::string &spirBinary); + virtual llvm::Module* loadBitcode(std::string &spirBinary) override; virtual llvm::Module* loadSPIR(std::string &spirBinary); const void* toBinary(const void *text, size_t text_size, size_t *binary_size); diff --git a/rocclr/compiler/lib/promotions/oclutils/top.hpp b/rocclr/compiler/lib/promotions/oclutils/top.hpp index 62f9048c47..cc95b8ae89 100644 --- a/rocclr/compiler/lib/promotions/oclutils/top.hpp +++ b/rocclr/compiler/lib/promotions/oclutils/top.hpp @@ -64,7 +64,9 @@ typedef int64_t ssize_t; #ifdef _WIN32 # define SIZE_T_FMT "%Iu" # define PTR_FMT "0x%p" -# define snprintf sprintf_s +# if !defined(snprintf) +# define snprintf sprintf_s +# endif #else /*!_WIN32*/ # define SIZE_T_FMT "%zu" # define PTR_FMT "%p" diff --git a/rocclr/runtime/device/cpu/cpuprogram.cpp b/rocclr/runtime/device/cpu/cpuprogram.cpp index a60af2d77c..5511aef197 100644 --- a/rocclr/runtime/device/cpu/cpuprogram.cpp +++ b/rocclr/runtime/device/cpu/cpuprogram.cpp @@ -421,6 +421,7 @@ public: aclJITObjectImage image; }; +#if defined(LEGACY_COMPLIB) static bool disasSymbolsCallback(std::string symbol, const void* value, void* data) { @@ -457,7 +458,7 @@ disasSymbolsCallbackCStr(const char* symbol, const void* value, void* data) { std::string symbolString(symbol); return disasSymbolsCallback(symbolString, value, data); } - +#endif bool Program::compileBinaryToISA(amd::option::Options* options)