From e78ff5a131c0532621fa92b2bc5cef67cba2dc30 Mon Sep 17 00:00:00 2001 From: kai Date: Sun, 9 Sep 2012 20:36:48 +0200 Subject: [PATCH] Fix broken build with LLVM 3.0. The method ConstantVector::getSplat() does not existin LLVM 3.0. Workarouund is to create a vector and use ConstantVector::get(). --- gen/llvmhelpers.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp index 50c47c07..e53038c9 100644 --- a/gen/llvmhelpers.cpp +++ b/gen/llvmhelpers.cpp @@ -1481,7 +1481,12 @@ LLConstant* DtoConstExpInit(Loc loc, Type* type, Expression* exp) { LLConstant* val = exp->toConstElem(gIR); TypeVector* tv = (TypeVector*)base; +#if LDC_LLVM_VER == 300 + std::vector Elts(tv->size(loc), val); + return llvm::ConstantVector::get(Elts); +#else return llvm::ConstantVector::getSplat(tv->size(loc), val); +#endif } #endif else