diff --git a/gen/functions.cpp b/gen/functions.cpp index f3bf2571..96b58fca 100644 --- a/gen/functions.cpp +++ b/gen/functions.cpp @@ -612,7 +612,16 @@ static void set_param_attrs(TypeFunction* f, llvm::Function* func, FuncDeclarati llvm::AttrListPtr oldAttrs = func->getAttributes(); #endif for (size_t i = 0; i < oldAttrs.getNumSlots(); ++i) { +#if LDC_LLVM_VER >= 303 + const unsigned Index = oldAttrs.getSlotIndex(i); + llvm::AttrBuilder &builder = llvm::AttrBuilder(oldAttrs.getSlotAttributes(i), Index).addAttribute(llvm::Attribute::None); + llvm::AttributeWithIndex curr = llvm::AttributeWithIndex::get(Index, + llvm::Attribute::get( + gIR->context(), + builder)); +#else llvm::AttributeWithIndex curr = oldAttrs.getSlot(i); +#endif bool found = false; for (size_t j = 0; j < newSize; ++j) { diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 12155111..7aee5dcf 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -316,10 +316,12 @@ macro(build_runtime d_flags c_flags ld_flags lib_suffix path_suffix outlist_targ dc(${f} "${d_flags}" "${RUNTIME_DIR}" "${target_suffix}" DCRT_O DCRT_BC) endforeach() - # Always build zlib and other C parts of the runtime in release mode. - set_source_files_properties(${CORE_C} ${DCRT_C} PROPERTIES - COMPILE_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_RELEASE}" - ) + if(NOT MSVC) + # Always build zlib and other C parts of the runtime in release mode. + set_source_files_properties(${CORE_C} ${DCRT_C} PROPERTIES + COMPILE_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_RELEASE}" + ) + endif() if(EXISTS ${RUNTIME_DIR}) set(GCCBUILTINS "${PROJECT_BINARY_DIR}/gccbuiltins_x86.di")