Permalink
Browse files

support building by llvm-3.2

  • Loading branch information...
goccy committed Sep 18, 2013
1 parent 1f6d1a4 commit 3dc2870b52d071ff52b9a66dd60106b22dbc6adf
Showing with 18 additions and 6 deletions.
  1. +2 −0 .gitignore
  2. +4 −1 Makefile.PL
  3. +12 −5 include/codegen.hpp
View
@@ -11,3 +11,5 @@ Makefile
Makefile.old
src/Compiler-CodeGenerator-LLVM.cpp
*.ll
+local
+LLVM.bs
View
@@ -33,8 +33,11 @@ chomp(my $llvm_cflags = `llvm-config --cxxflags`);
$llvm_cflags =~ s/-fno-rtti//;
chomp(my $llvm_ldflags = `llvm-config --ldflags`);
chomp(my $llvm_libs = `llvm-config --libs`);
+chomp(my $llvm_version = `llvm-config --version`);
+my ($captured_version) = $llvm_version =~ /([0-9.]+)/;
+$captured_version =~ s/\./_/g;
-makemaker_args->{CCFLAGS} .= " $llvm_cflags";
+makemaker_args->{CCFLAGS} .= " $llvm_cflags -DLLVM_VERSION_$captured_version";
makemaker_args->{LDLOADLIBS} = "$llvm_ldflags $llvm_libs -lLLVMIRReader";
WriteAll(check_nmake => 0);
View
@@ -1,18 +1,25 @@
#define LLVM_ATTRIBUTE_READONLY
-//#include "llvm/IRBuilder.h"
-//#include "llvm/Module.h"
-//#include "llvm/LLVMContext.h"
-//#include "llvm/ValueSymbolTable.h"
+#ifdef LLVM_VERSION_3_2
+
+#include "llvm/IRBuilder.h"
+#include "llvm/Module.h"
+#include "llvm/LLVMContext.h"
+#include "llvm/ValueSymbolTable.h"
+
+#else
+
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/ValueSymbolTable.h"
#include "llvm/IR/DerivedTypes.h"
+
+#endif
+
#include "llvm/PassManager.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/IPO.h"
-
#include "llvm/Support/raw_os_ostream.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/TargetSelect.h"

0 comments on commit 3dc2870

Please sign in to comment.