From 5216fa48d81022c0b1a32c7c08d5205934aaf6f3 Mon Sep 17 00:00:00 2001 From: kai Date: Fri, 3 Aug 2012 22:57:01 +0200 Subject: [PATCH] Remove conditional compiled code by favouring the 3.1 solution. --- gen/toir.cpp | 64 ---------------------------------------------------- 1 file changed, 64 deletions(-) diff --git a/gen/toir.cpp b/gen/toir.cpp index 460da636..4133cae6 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -439,7 +439,6 @@ LLConstant* ComplexExp::toConstElem(IRState* p) ////////////////////////////////////////////////////////////////////////////////////////// -#if LDC_LLVM_VER >= 301 template static inline LLConstant* toConstantArray(LLType* ct, LLArrayType* at, T* str, size_t len, bool nullterm = true) { @@ -452,7 +451,6 @@ static inline LLConstant* toConstantArray(LLType* ct, LLArrayType* at, T* str, s vals.push_back(LLConstantInt::get(ct, 0, false)); return LLConstantArray::get(at, vals); } -#endif ////////////////////////////////////////////////////////////////////////////////////////// @@ -469,35 +467,6 @@ DValue* StringExp::toElem(IRState* p) LLArrayType* at = LLArrayType::get(ct,len+1); LLConstant* _init; -#if LDC_LLVM_VER == 300 - if (cty->size() == 1) { - uint8_t* str = static_cast(string); - llvm::StringRef cont((char*)str, len); - _init = LLConstantArray::get(p->context(), cont, true); - } - else if (cty->size() == 2) { - uint16_t* str = static_cast(string); - std::vector vals; - vals.reserve(len+1); - for(size_t i=0; isize() == 4) { - uint32_t* str = static_cast(string); - std::vector vals; - vals.reserve(len+1); - for(size_t i=0; isize()) { default: @@ -512,7 +481,6 @@ DValue* StringExp::toElem(IRState* p) _init = toConstantArray(ct, at, static_cast(string), len); break; } -#endif llvm::GlobalValue::LinkageTypes _linkage = llvm::GlobalValue::InternalLinkage; if (Logger::enabled()) @@ -557,37 +525,6 @@ LLConstant* StringExp::toConstElem(IRState* p) LLArrayType* at = LLArrayType::get(ct,endlen); LLConstant* _init; -#if LDC_LLVM_VER == 300 - if (cty->size() == 1) { - uint8_t* str = static_cast(string); - llvm::StringRef cont((char*)str, len); - _init = LLConstantArray::get(p->context(), cont, nullterm); - } - else if (cty->size() == 2) { - uint16_t* str = static_cast(string); - std::vector vals; - vals.reserve(len+1); - for(size_t i=0; isize() == 4) { - uint32_t* str = static_cast(string); - std::vector vals; - vals.reserve(len+1); - for(size_t i=0; isize()) { default: @@ -602,7 +539,6 @@ LLConstant* StringExp::toConstElem(IRState* p) _init = toConstantArray(ct, at, static_cast(string), len, nullterm); break; } -#endif if (t->ty == Tsarray) {