[Libclc-dev] [PATCH 1/2] Fix build with LLVM 3.3

Tom Stellard tom at stellard.net
Mon Feb 25 07:36:42 PST 2013


Hi,

Peter can correct me if I'm wrong, but based on previous changes, I don't
think that libclc is meant to support multiple llvm versions. So,
you can probably drop the ifdefs from this patch.

-Tom

On Mon, Feb 25, 2013 at 04:23:05PM +0100, Niels Ole Salscheider wrote:
> ---
>  configure.py               | 3 ++-
>  utils/prepare-builtins.cpp | 7 +++++++
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/configure.py b/configure.py
> index d861c24..840d430 100755
> --- a/configure.py
> +++ b/configure.py
> @@ -62,7 +62,8 @@ def llvm_config(args):
>  
>  llvm_bindir = llvm_config(['--bindir'])
>  llvm_core_libs = llvm_config(['--ldflags', '--libs', 'core', 'bitreader', 'bitwriter'])
> -llvm_cxxflags = llvm_config(['--cxxflags']) + ' -fno-exceptions -fno-rtti'
> +llvm_version = llvm_config(['--version'])
> +llvm_cxxflags = llvm_config(['--cxxflags']) + ' -fno-exceptions -fno-rtti' + ' -DHAVE_LLVM=0x0' + llvm_version.replace('.', '0').replace('svn', '')
>  
>  llvm_clang = os.path.join(llvm_bindir, 'clang')
>  llvm_link = os.path.join(llvm_bindir, 'llvm-link')
> diff --git a/utils/prepare-builtins.cpp b/utils/prepare-builtins.cpp
> index ae7731b..ac4624f 100644
> --- a/utils/prepare-builtins.cpp
> +++ b/utils/prepare-builtins.cpp
> @@ -1,9 +1,16 @@
>  #include "llvm/ADT/OwningPtr.h"
>  #include "llvm/Bitcode/ReaderWriter.h"
> +#if HAVE_LLVM < 0x0303
>  #include "llvm/Function.h"
>  #include "llvm/GlobalVariable.h"
>  #include "llvm/LLVMContext.h"
>  #include "llvm/Module.h"
> +#else
> +#include "llvm/IR/Function.h"
> +#include "llvm/IR/GlobalVariable.h"
> +#include "llvm/IR/LLVMContext.h"
> +#include "llvm/IR/Module.h"
> +#endif
>  #include "llvm/Support/CommandLine.h"
>  #include "llvm/Support/ManagedStatic.h"
>  #include "llvm/Support/MemoryBuffer.h"
> -- 
> 1.8.1.3
> 
> 
> _______________________________________________
> Libclc-dev mailing list
> Libclc-dev at pcc.me.uk
> http://www.pcc.me.uk/cgi-bin/mailman/listinfo/libclc-dev




More information about the Libclc-dev mailing list