<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">I would prefer to have a branch, so we easily know what the last known good version is that works with the current release version of clang/llvm.</div><div class=""><br class=""></div><div class="">Jeroen</div><br class=""><div><blockquote type="cite" class=""><div class="">On 24 Dec 2014, at 16:17, Aaron Watry <<a href="mailto:awatry@gmail.com" class="">awatry@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><p dir="ltr" class="">Looks good to me. </p><p dir="ltr" class="">If we're going to start requiring the newest llvm explicitly (used to be an implicit requirement), do we want to eventually consider cutting a branch before bumping the llvm version (or tied to the llvm release schedule)?</p><p dir="ltr" class="">Maybe it's more appropriate to start cutting releases when we have full support for CL 1.0/1.1.</p><p dir="ltr" class="">--Aaron</p>
<div class="gmail_quote">On Dec 23, 2014 12:54 PM, "Tom Stellard" <<a href="mailto:thomas.stellard@amd.com" class="">thomas.stellard@amd.com</a>> wrote:<br type="attribution" class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Some functions are implemented using hand-written LLVM IR and<br class="">
LLVM assembly format is allowed to change between versions, so we<br class="">
need to start tieing libclc to a specific version of LLVM.<br class="">
---<br class="">
configure.py | 12 ++++++-----<br class="">
utils/prepare-builtins.cpp | 51 ++--------------------------------------------<br class="">
2 files changed, 9 insertions(+), 54 deletions(-)<br class="">
<br class="">
diff --git a/configure.py b/configure.py<br class="">
index 7170f46..d962244 100755<br class="">
--- a/configure.py<br class="">
+++ b/configure.py<br class="">
@@ -5,8 +5,8 @@ def c_compiler_rule(b, name, description, compiler, flags):<br class="">
b.rule(name, command, description + " $out", depfile="$out.d")<br class="">
<br class="">
version_major = 0;<br class="">
-version_minor = 0;<br class="">
-version_patch = 1;<br class="">
+version_minor = 1;<br class="">
+version_patch = 0;<br class="">
<br class="">
from optparse import OptionParser<br class="">
import os<br class="">
@@ -64,9 +64,11 @@ def llvm_config(args):<br class="">
sys.exit(1)<br class="">
<br class="">
llvm_version = string.split(string.replace(llvm_config(['--version']), 'svn', ''), '.')<br class="">
-llvm_system_libs = ''<br class="">
-if (int(llvm_version[0]) == 3 and int(llvm_version[1]) >= 5) or int(llvm_version[0]) > 3:<br class="">
- llvm_system_libs = llvm_config(['--system-libs'])<br class="">
+if (int(llvm_version[0]) != 3 and int(llvm_version[1]) != 6):<br class="">
+ print "libclc requires LLVM 3.6"<br class="">
+ sys.exit(1)<br class="">
+<br class="">
+llvm_system_libs = llvm_config(['--system-libs'])<br class="">
llvm_bindir = llvm_config(['--bindir'])<br class="">
llvm_core_libs = llvm_config(['--libs', 'core', 'bitreader', 'bitwriter']) + ' ' + \<br class="">
llvm_system_libs + ' ' + \<br class="">
diff --git a/utils/prepare-builtins.cpp b/utils/prepare-builtins.cpp<br class="">
index ee51edf..a3c3383 100644<br class="">
--- a/utils/prepare-builtins.cpp<br class="">
+++ b/utils/prepare-builtins.cpp<br class="">
@@ -12,25 +12,8 @@<br class="">
#include "llvm/Support/ToolOutputFile.h"<br class="">
#include "llvm/Config/llvm-config.h"<br class="">
<br class="">
-#define LLVM_360_AND_NEWER \<br class="">
- (LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 6))<br class="">
-<br class="">
-#define LLVM_350_AND_NEWER \<br class="">
- (LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5))<br class="">
-<br class="">
-#if LLVM_350_AND_NEWER<br class="">
#include <system_error><br class="">
<br class="">
-#define ERROR_CODE std::error_code<br class="">
-#define UNIQUE_PTR std::unique_ptr<br class="">
-#else<br class="">
-#include "llvm/ADT/OwningPtr.h"<br class="">
-#include "llvm/Support/system_error.h"<br class="">
-<br class="">
-#define ERROR_CODE error_code<br class="">
-#define UNIQUE_PTR OwningPtr<br class="">
-#endif<br class="">
-<br class="">
using namespace llvm;<br class="">
<br class="">
static cl::opt<std::string><br class="">
@@ -50,30 +33,17 @@ int main(int argc, char **argv) {<br class="">
std::auto_ptr<Module> M;<br class="">
<br class="">
{<br class="">
-#if LLVM_350_AND_NEWER<br class="">
ErrorOr<std::unique_ptr<MemoryBuffer>> BufferOrErr =<br class="">
MemoryBuffer::getFile(InputFilename);<br class="">
std::unique_ptr<MemoryBuffer> &BufferPtr = BufferOrErr.get();<br class="">
if (std::error_code ec = BufferOrErr.getError())<br class="">
-#else<br class="">
- UNIQUE_PTR<MemoryBuffer> BufferPtr;<br class="">
- if (ERROR_CODE ec = MemoryBuffer::getFileOrSTDIN(InputFilename, BufferPtr))<br class="">
-#endif<br class="">
ErrorMessage = ec.message();<br class="">
else {<br class="">
-#if LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 4)<br class="">
-# if LLVM_360_AND_NEWER<br class="">
ErrorOr<Module *> ModuleOrErr =<br class="">
parseBitcodeFile(BufferPtr.get()->getMemBufferRef(), Context);<br class="">
-# else<br class="">
- ErrorOr<Module *> ModuleOrErr = parseBitcodeFile(BufferPtr.get(), Context);<br class="">
-# endif<br class="">
- if (ERROR_CODE ec = ModuleOrErr.getError())<br class="">
+ if (std::error_code ec = ModuleOrErr.getError())<br class="">
ErrorMessage = ec.message();<br class="">
M.reset(ModuleOrErr.get());<br class="">
-#else<br class="">
- M.reset(ParseBitcodeFile(BufferPtr.get(), Context, &ErrorMessage));<br class="">
-#endif<br class="">
}<br class="">
}<br class="">
<br class="">
@@ -103,30 +73,13 @@ int main(int argc, char **argv) {<br class="">
return 1;<br class="">
}<br class="">
<br class="">
-#if LLVM_360_AND_NEWER<br class="">
std::error_code EC;<br class="">
- UNIQUE_PTR<tool_output_file> Out<br class="">
+ std::unique_ptr<tool_output_file> Out<br class="">
(new tool_output_file(OutputFilename, EC, sys::fs::F_None));<br class="">
if (EC) {<br class="">
errs() << EC.message() << '\n';<br class="">
exit(1);<br class="">
}<br class="">
-#else<br class="">
- std::string ErrorInfo;<br class="">
- UNIQUE_PTR<tool_output_file> Out<br class="">
- (new tool_output_file(OutputFilename.c_str(), ErrorInfo,<br class="">
-#if (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR == 4)<br class="">
- sys::fs::F_Binary));<br class="">
-#elif LLVM_VERSION_MAJOR > 3 || (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 5)<br class="">
- sys::fs::F_None));<br class="">
-#else<br class="">
- raw_fd_ostream::F_Binary));<br class="">
-#endif<br class="">
- if (!ErrorInfo.empty()) {<br class="">
- errs() << ErrorInfo << '\n';<br class="">
- exit(1);<br class="">
- }<br class="">
-#endif // LLVM_360_AND_NEWER<br class="">
<br class="">
WriteBitcodeToFile(M.get(), Out->os());<br class="">
<br class="">
--<br class="">
1.8.5.5<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
Libclc-dev mailing list<br class="">
<a href="mailto:Libclc-dev@pcc.me.uk" class="">Libclc-dev@pcc.me.uk</a><br class="">
<a href="http://www.pcc.me.uk/cgi-bin/mailman/listinfo/libclc-dev" target="_blank" class="">http://www.pcc.me.uk/cgi-bin/mailman/listinfo/libclc-dev</a><br class="">
</blockquote></div>
_______________________________________________<br class="">Libclc-dev mailing list<br class=""><a href="mailto:Libclc-dev@pcc.me.uk" class="">Libclc-dev@pcc.me.uk</a><br class="">http://www.pcc.me.uk/cgi-bin/mailman/listinfo/libclc-dev<br class=""></div></blockquote></div><br class=""></body></html>