Skip to content

Commit

Permalink
Compilation fixes for LLVM 3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mkmks committed Mar 31, 2013
1 parent 11f0425 commit 138c0e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions base/cbits/extra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ void LLVMSetDoesNotThrow(LLVMValueRef fn, int DoesNotThrow)
llvm::Function *fnp = llvm::unwrap<llvm::Function>(fn);
assert(fnp);

return fnp->setDoesNotThrow((bool)DoesNotThrow);
return fnp->setDoesNotThrow();
}

LLVMValueRef LLVMGetIntrinsic(LLVMModuleRef module, int id,
Expand Down Expand Up @@ -405,7 +405,7 @@ LLVMModuleRef LLVMGetModuleFromAssembly(const char *asmtext, unsigned txtlen,
llvm::getGlobalContext()))) {
std::string s;
llvm::raw_string_ostream buf(s);
error.Print("llvm-py", buf);
error.print("llvm-py", buf, true);
*out = strdup(buf.str().c_str());
return NULL;
}
Expand Down Expand Up @@ -529,14 +529,14 @@ LLVMBool LLVMIsZeroInitialized(LLVMValueRef Ty) {
}

LLVMBool LLVMIsCString(LLVMValueRef Val) {
if (llvm::ConstantArray *C = llvm::dyn_cast<llvm::ConstantArray>(llvm::unwrap(Val)))
if (llvm::ConstantDataSequential *C = llvm::dyn_cast<llvm::ConstantDataSequential>(llvm::unwrap(Val)))
return C->isCString();
return false;
}

const char *LLVMGetAsCString(LLVMValueRef Val) {
if (llvm::ConstantArray *C = llvm::dyn_cast<llvm::ConstantArray>(llvm::unwrap(Val)))
return (C->getAsString()).c_str();
if (llvm::ConstantDataSequential *C = llvm::dyn_cast<llvm::ConstantDataSequential>(llvm::unwrap(Val)))
return (C->getAsString()).str().c_str();
return NULL;
}

Expand Down Expand Up @@ -576,7 +576,7 @@ define_pass( InstCount )
define_pass( InstructionNamer )
define_pass( LazyValueInfo )
define_pass( LCSSA )
define_pass( LoopDependenceAnalysis )
//define_pass( LoopDependenceAnalysis )
define_pass( LoopExtractor )
define_pass( LoopSimplify )
define_pass( LoopStrengthReduce )
Expand All @@ -600,5 +600,5 @@ define_pass( StripNonDebugSymbols )
define_pass( UnifyFunctionExitNodes )

/* we support only internalize(true) */
llvm::ModulePass *createInternalize2Pass() { return llvm::createInternalizePass(true); }
llvm::ModulePass *createInternalize2Pass() { return llvm::createInternalizePass(); }
define_pass( Internalize2 )
6 changes: 3 additions & 3 deletions base/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ AC_ARG_WITH(llvm_bindir,
llvm_bindir="$withval",
llvm_bindir="$llvm_prefix/bin")dnl

AC_PATH_PROGS(llvm_config, [llvm-config-2.9],
AC_PATH_PROGS(llvm_config, [llvm-config],
[AC_MSG_ERROR(could not find llvm-config in $llvm_bindir)],
["$llvm_bindir:$PATH"])

Expand Down Expand Up @@ -85,7 +85,7 @@ LDFLAGS="$llvm_ldflags $LDFLAGS $TARGET_LDFLAGS"

llvm_extra_ghci_libs=""

AC_SEARCH_LIBS([LLVMModuleCreateWithName],[LLVM-2.7 LLVM-2.8 LLVM-2.9 LLVM-3.0])
AC_SEARCH_LIBS([LLVMModuleCreateWithName],[LLVM-2.7 LLVM-2.8 LLVM-2.9 LLVM-3.0 LLVM-3.2])
if test "$ac_cv_search_LLVMModuleCreateWithName" = "no"; then
llvm_all_libs="`$llvm_config --libs all`"
else
Expand Down Expand Up @@ -125,7 +125,7 @@ dnl AC_CHECK_LIB(LLVMCore, LLVMModuleCreateWithName, [],
dnl [AC_MSG_ERROR(could not find LLVM C bindings)])
dnl fi

llvm_num_version="`echo $llvm_version | tr . 0`"
llvm_num_version="`echo $llvm_version | tr . 0 | tr -d svn`"
AC_DEFINE_UNQUOTED([HS_LLVM_VERSION], [$llvm_num_version],
[Define to the version of LLVM, e.g. 209 for 2.9.])

Expand Down

0 comments on commit 138c0e4

Please sign in to comment.